> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cachethq.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Metric



## OpenAPI

````yaml api-reference/openapi.json post /metrics
openapi: 3.1.0
info:
  title: Cachet
  version: 0.0.1
  description: >-
    API documentation for Cachet, the open-source, self-hosted status page
    system.
servers:
  - url: http://localhost/api
  - url: https://v3.cachethq.io/api
    description: The Cachet v3 demo server.
security:
  - http: []
tags:
  - name: Cachet
  - name: Components
  - name: Component Groups
  - name: Incidents
  - name: Incident Updates
  - name: Incident Templates
  - name: Metrics
  - name: Metric Points
  - name: Schedules
  - name: Schedule Updates
paths:
  /metrics:
    post:
      tags:
        - Metrics
      summary: Create Metric
      operationId: cachet.api.metrics.store
      requestBody:
        description: '`CreateMetricRequestData`'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMetricRequestData'
      responses:
        '200':
          description: '`Metric`'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Metric'
                required:
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/MissingAbilityException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    CreateMetricRequestData:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
        suffix:
          type: string
          maxLength: 255
        calc_type:
          anyOf:
            - $ref: '#/components/schemas/MetricTypeEnum'
            - type: 'null'
        description:
          type:
            - string
            - 'null'
        default_value:
          type:
            - number
            - 'null'
        display_chart:
          type:
            - boolean
            - 'null'
        threshold:
          type:
            - integer
            - 'null'
          minimum: 0
          maximum: 60
        places:
          type:
            - integer
            - 'null'
      required:
        - name
        - suffix
      title: CreateMetricRequestData
    Metric:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
            - metrics
        attributes:
          type: object
          properties:
            id:
              type: integer
            name:
              type: string
            suffix:
              type: string
            description:
              type:
                - string
                - 'null'
            default_value:
              type:
                - string
                - 'null'
            calc_type:
              $ref: '#/components/schemas/MetricTypeEnum'
            display_chart:
              type: boolean
            places:
              type: integer
            default_view:
              $ref: '#/components/schemas/MetricViewEnum'
            threshold:
              type: integer
            order:
              type: integer
            visible:
              $ref: '#/components/schemas/ResourceVisibilityEnum'
            created:
              type: object
              properties:
                human:
                  type: string
                string:
                  type: string
              required:
                - human
                - string
            updated:
              type: object
              properties:
                human:
                  type: string
                string:
                  type: string
              required:
                - human
                - string
          required:
            - id
            - name
            - suffix
            - description
            - default_value
            - calc_type
            - display_chart
            - places
            - default_view
            - threshold
            - order
            - visible
            - created
            - updated
        relationships:
          type: object
          properties:
            points:
              type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/MetricPointIdentifier'
              required:
                - data
      required:
        - id
        - type
      title: Metric
    MetricTypeEnum:
      type: integer
      enum:
        - 0
        - 1
      title: MetricTypeEnum
    MetricViewEnum:
      type: integer
      enum:
        - 0
        - 1
        - 2
        - 3
      title: MetricViewEnum
    ResourceVisibilityEnum:
      type: integer
      enum:
        - 0
        - 1
        - 2
      title: ResourceVisibilityEnum
    MetricPointIdentifier:
      type: object
      properties:
        type:
          type: string
          enum:
            - metricPoints
        id:
          type: string
      required:
        - type
        - id
      title: MetricPointIdentifier
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    MissingAbilityException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    http:
      type: http
      scheme: bearer

````