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

# Create metrics

> Create/upload new metrics data for a company. Supports both standard and custom metrics, including budget data.

**Notes:**
- Each request can only be for one company.
- Supports both standard and custom metrics.
- Can write to budgets by specifying `budget_id` and `is_budget_metric`.
- Required fields:
  - `value`
  - `company_id`
  - `category`
  - `metric_cadence`
  - `date`
- Optional fields:
  - `currency` (only for money-type metrics)
  - `is_budget_metric` (defaults to False)
- Query parameters:
  - `on_conflict` ('overwrite' | 'skip', default: 'overwrite')

**Permissions:**
- User must be authenticated via OAuth.
- User must have access to the company.
- User must have ADMIN or EDITOR role.



## OpenAPI

````yaml post /metrics/
openapi: 3.0.1
info:
  title: Standard Metrics API Documentation
  description: >-
    Welcome to Standard Metric's API docs!


    To use our API you will need to make an OAuth appliction (or use an existing
    one) in the developer settings tab on your settings page and then exchange
    your client id and secret for an access token (via the `/o/token/` endpoint.
    This token can then be sent in the `Authorization` header to authenticate
    your requests to our api. See below for an example.


    All endpoints are paginated and will return a maximum of 100 results per
    page. See the endpoints below and example responses for more details on
    pagination parameters. A maximum of 120 requests per minute can be made to
    our API.


    Authentication example (with python):

    ```>>> import base64

    >>> import base64

    >>> client_id = "YOUR_CLIENT_ID"

    >>> client_secret = "YOUR_CLIENT_SECRET"

    >>> credential = f"{client_id}:{client_secret}"

    >>> base64.b64encode(credential.encode("utf-8"))

    b'ENCODED_CREDENTIAL'


    You can now exchange this credential for an access token, eg:


    curl -X POST \
        -H "Authorization: Basic ENCODED_CREDENTIAL" \
        -H "Cache-Control: no-cache" \
        -H "Content-Type: application/x-www-form-urlencoded" \
        "https://api.standardmetrics.io/o/token/" \
        -d "grant_type=client_credentials"

    You will receive the following response:


    {
        "access_token": "YOUR_ACCESS_TOKEN",
        "expires_in": 36000,
        "token_type": "Bearer",
        "scope": "read write"
    }


    Make sure not to forget to prepend "Bearer " to your access token in the
    Authorization header while making requests.
  version: '1.0'
servers:
  - url: https://api.standardmetrics.io/v1
security:
  - Bearer: []
paths:
  /metrics/:
    post:
      tags:
        - metrics
      summary: Create metrics
      description: >-
        Create/upload new metrics data for a company. Supports both standard and
        custom metrics, including budget data.


        **Notes:**

        - Each request can only be for one company.

        - Supports both standard and custom metrics.

        - Can write to budgets by specifying `budget_id` and `is_budget_metric`.

        - Required fields:
          - `value`
          - `company_id`
          - `category`
          - `metric_cadence`
          - `date`
        - Optional fields:
          - `currency` (only for money-type metrics)
          - `is_budget_metric` (defaults to False)
        - Query parameters:
          - `on_conflict` ('overwrite' | 'skip', default: 'overwrite')

        **Permissions:**

        - User must be authenticated via OAuth.

        - User must have access to the company.

        - User must have ADMIN or EDITOR role.
      operationId: metrics_create
      parameters:
        - name: on_conflict
          in: query
          description: >-
            Conflict resolution strategy when a metric already exists for the
            same company, category, and date. 'overwrite' (default) updates the
            existing row. 'skip' leaves the existing row unchanged.
          schema:
            type: string
            default: overwrite
            enum:
              - overwrite
              - skip
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                properties:
                  value:
                    type: string
                    description: Metric value
                    example: '1000'
                  company_id:
                    type: string
                    description: Company ID
                    example: RjX8
                  category:
                    type: string
                    description: >-
                      Metric category (can also be the name of a custom metric
                      using its display name (e.g., "Total Number of
                      Customers"))
                    example: cash_in_bank
                    enum:
                      - accounts_payable
                      - accounts_receivable
                      - arr
                      - assets
                      - burn_per_fte
                      - cash_flow_from_financing_activities
                      - cash_flow_from_investing_activities
                      - cash_flow_from_operating_activities
                      - cash_in_bank
                      - cash_payments
                      - cash_receipts
                      - churned_arr
                      - contraction_arr
                      - cost_of_goods_sold
                      - current_assets
                      - current_liabilities
                      - custom
                      - ebitda
                      - equity
                      - expansion_arr
                      - fair_value
                      - fully_diluted_shares
                      - gross_irr
                      - gross_margin
                      - gross_profit
                      - headcount
                      - investment_amount
                      - latest_price_per_share
                      - liabilities
                      - long_term_liabilities
                      - moic
                      - net_assets
                      - net_burn
                      - net_income
                      - net_new_arr
                      - net_operating_profit
                      - net_other_income
                      - net_profit
                      - new_logo_arr
                      - non_current_assets
                      - operating_margin
                      - other_non_current_assets
                      - ownership
                      - post_money_valuation
                      - pre_money_valuation
                      - property_plants_and_equipment
                      - reactivation_arr
                      - realized_value
                      - revenue
                      - revenue_growth
                      - revenue_per_fte
                      - runway
                      - short_term_investments
                      - total_change_in_cash
                      - total_operating_expenses
                      - total_shares_owned
                  date:
                    type: string
                    description: Date
                    example: '2023-07-31'
                  metric_cadence:
                    type: string
                    description: Metric cadence
                    example: point_in_time
                    enum:
                      - point_in_time
                      - day
                      - week
                      - month
                      - quarter
                      - half_year
                      - year
                  currency:
                    type: string
                    description: Currency. Only required for money-type metrics.
                    example: USD
                    enum:
                      - AED
                      - AUD
                      - BDT
                      - BRL
                      - CAD
                      - CHF
                      - CNY
                      - COP
                      - CZK
                      - DKK
                      - EUR
                      - GBP
                      - GHS
                      - HKD
                      - IDR
                      - ILS
                      - INR
                      - ISK
                      - JOD
                      - JPY
                      - KES
                      - KRW
                      - MXN
                      - NGN
                      - NOK
                      - NZD
                      - PEN
                      - PHP
                      - PKR
                      - SAR
                      - SEK
                      - SGD
                      - THB
                      - TRY
                      - TWD
                      - TZS
                      - USD
                      - VND
                      - ZAR
                  is_budget_metric:
                    type: boolean
                    description: Is budget metric. Defaults to False if not provided.
                    example: true
                  budget_id:
                    type: string
                    description: Budget ID
                    example: yzJm
        required: true
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    value:
                      type: string
                      description: Metric value
                      example: '1000'
                    company_id:
                      type: string
                      description: Company ID
                      example: RjX8
                    category:
                      type: string
                      description: >-
                        Metric category (can also be the name of a custom metric
                        using its display name (e.g., "Total Number of
                        Customers"))
                      example: cash_in_bank
                      enum:
                        - accounts_payable
                        - accounts_receivable
                        - arr
                        - assets
                        - burn_per_fte
                        - cash_flow_from_financing_activities
                        - cash_flow_from_investing_activities
                        - cash_flow_from_operating_activities
                        - cash_in_bank
                        - cash_payments
                        - cash_receipts
                        - churned_arr
                        - contraction_arr
                        - cost_of_goods_sold
                        - current_assets
                        - current_liabilities
                        - custom
                        - ebitda
                        - equity
                        - expansion_arr
                        - fair_value
                        - fully_diluted_shares
                        - gross_irr
                        - gross_margin
                        - gross_profit
                        - headcount
                        - investment_amount
                        - latest_price_per_share
                        - liabilities
                        - long_term_liabilities
                        - moic
                        - net_assets
                        - net_burn
                        - net_income
                        - net_new_arr
                        - net_operating_profit
                        - net_other_income
                        - net_profit
                        - new_logo_arr
                        - non_current_assets
                        - operating_margin
                        - other_non_current_assets
                        - ownership
                        - post_money_valuation
                        - pre_money_valuation
                        - property_plants_and_equipment
                        - reactivation_arr
                        - realized_value
                        - revenue
                        - revenue_growth
                        - revenue_per_fte
                        - runway
                        - short_term_investments
                        - total_change_in_cash
                        - total_operating_expenses
                        - total_shares_owned
                    date:
                      type: string
                      description: Date
                      example: '2023-07-31'
                    metric_cadence:
                      type: string
                      description: Metric cadence
                      example: point_in_time
                      enum:
                        - point_in_time
                        - day
                        - week
                        - month
                        - quarter
                        - half_year
                        - year
                    currency:
                      type: string
                      description: Currency. Only required for money-type metrics.
                      example: USD
                      enum:
                        - AED
                        - AUD
                        - BDT
                        - BRL
                        - CAD
                        - CHF
                        - CNY
                        - COP
                        - CZK
                        - DKK
                        - EUR
                        - GBP
                        - GHS
                        - HKD
                        - IDR
                        - ILS
                        - INR
                        - ISK
                        - JOD
                        - JPY
                        - KES
                        - KRW
                        - MXN
                        - NGN
                        - NOK
                        - NZD
                        - PEN
                        - PHP
                        - PKR
                        - SAR
                        - SEK
                        - SGD
                        - THB
                        - TRY
                        - TWD
                        - TZS
                        - USD
                        - VND
                        - ZAR
                    is_budget_metric:
                      type: boolean
                      description: Is budget metric. Defaults to False if not provided.
                      example: true
                    budget_id:
                      type: string
                      description: Budget ID
                      example: yzJm
components:
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Your valid bearer token. All Auth tokens persist for all requests. Make
        sure to replace Client Credential `Basic` tokens with `Bearer` tokens
        after retrieving your bearer token. Go to the API Reference/Setup, User
        Guides/Initial Setup, or API Reference/Get API Access Token page to get
        your token.

````