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

# Create business metric

> Create a new BusinessMetric.



## OpenAPI

````yaml https://api.vantage.sh/v2/oas_v3.json post /business_metrics
openapi: 3.0.1
info:
  title: Vantage
  description: Vantage API
  termsOfService: https://www.vantage.sh/terms-of-use
  contact:
    name: Vantage Support
    url: https://www.vantage.sh
    email: support@vantage.sh
  version: 2.0.0
servers:
  - url: https://api.vantage.sh/v2
security:
  - oauth2:
      - read
tags:
  - name: AccessGrants
    description: Operations about AccessGrants
  - name: AnomalyAlerts
    description: Operations about AnomalyAlerts
  - name: AnomalyNotifications
    description: Operations about AnomalyNotifications
  - name: AuditLogs
    description: Operations about AuditLogs
  - name: BillingProfiles
    description: Operations about BillingProfiles
  - name: BillingRules
    description: Operations about BillingRules
  - name: BudgetAlerts
    description: Operations about BudgetAlerts
  - name: Budgets
    description: Operations about Budgets
  - name: BusinessMetrics
    description: Operations about BusinessMetrics
  - name: Canvases
    description: Operations about Canvases
  - name: CostAlertEvents
    description: Operations about CostAlertEvents
  - name: CostAlerts
    description: Operations about CostAlerts
  - name: CostProvider
    description: Operations about CostProviders
  - name: CostProviderAccounts
    description: Operations about CostProviderAccounts
  - name: Costs
    description: Operations about Costs
  - name: CostService
    description: Operations about CostServices
  - name: Dashboards
    description: Operations about Dashboards
  - name: DataExports
    description: Operations about DataExports
  - name: ExchangeRates
    description: Operations about ExchangeRates
  - name: FinancialCommitmentReports
    description: Operations about FinancialCommitmentReports
  - name: FinancialCommitments
    description: Operations about FinancialCommitments
  - name: Folders
    description: Operations about Folders
  - name: Integrations
    description: Operations about Integrations
  - name: Invoices
    description: Operations about Invoices
  - name: KubernetesEfficiencyReports
    description: Operations about KubernetesEfficiencyReports
  - name: ManagedAccounts
    description: Operations about ManagedAccounts
  - name: Me
    description: Operations about Mes
  - name: NetworkFlowReports
    description: Operations about NetworkFlowReports
  - name: OpenAPISpecification
    description: Operations about OpenAPISpecifications
  - name: Ping
    description: Operations about Pings
  - name: Prices
    description: Operations about Prices
  - name: Recommendations
    description: Operations about Recommendations
  - name: RecommendationViews
    description: Operations about RecommendationViews
  - name: ReportNotifications
    description: Operations about ReportNotifications
  - name: ResourceReports
    description: Operations about ResourceReports
  - name: Resources
    description: Operations about Resources
  - name: SavedFilters
    description: Operations about SavedFilters
  - name: Segments
    description: Operations about Segments
  - name: Tags
    description: Operations about Tags
  - name: Teams
    description: Operations about Teams
  - name: UnitCosts
    description: Operations about UnitCosts
  - name: UserFeedback
    description: Operations about UserFeedbacks
  - name: Users
    description: Operations about Users
  - name: VirtualTags
    description: Operations about VirtualTags
  - name: Workspaces
    description: Operations about Workspaces
paths:
  /business_metrics:
    post:
      tags:
        - BusinessMetrics
      summary: Create business metric
      description: Create a new BusinessMetric.
      operationId: createBusinessMetric
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createBusinessMetric'
        required: true
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessMetric'
              example:
                token: bsnss_mtrc_e8d0a6f35c9f4e8c
                title: New Biz Metric
                created_by_token: usr_464e70f8e230fa62
                cost_report_tokens_with_metadata:
                  - cost_report_token: rprt_67a1e1ac3bb7cefd
                    unit_scale: per_thousand
                    label_filter:
                      - Dev
                      - Prod
                      - Staging
                      - ''
                import_type: csv
                integration_token: ''
        '400':
          description: BadRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '404':
          description: NotFound
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
        '422':
          description: UnprocessableEntity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
      security:
        - oauth2:
            - write
components:
  schemas:
    createBusinessMetric:
      required:
        - title
      type: object
      properties:
        title:
          type: string
          description: The title of the BusinessMetrics.
        cost_report_tokens_with_metadata:
          type: array
          description: >-
            The tokens for any CostReports that use the BusinessMetric, the unit
            scale, and label filter.
          items:
            required:
              - cost_report_token
            type: object
            properties:
              cost_report_token:
                type: string
                description: The token of the CostReport the BusinessMetric is attached to.
              unit_scale:
                type: string
                description: >-
                  Determines the scale of the BusinessMetric's values within the
                  CostReport.
                default: per_unit
                enum:
                  - per_unit
                  - per_hundred
                  - per_thousand
                  - per_million
                  - per_billion
              label_filter:
                type: array
                description: Include only values with these labels in the CostReport.
                items:
                  type: string
        values:
          type: array
          description: The dates, amounts, and (optional) labels for the BusinessMetric.
          items:
            required:
              - amount
              - date
            type: object
            properties:
              date:
                type: string
                format: date-time
              amount:
                type: number
                format: double
              label:
                type: string
                nullable: true
          x-omitempty: true
        forecasted_values:
          type: array
          description: >-
            The dates, amounts, and (optional) labels for forecasted
            BusinessMetric values.
          items:
            required:
              - amount
              - date
            type: object
            properties:
              date:
                type: string
                format: date-time
              amount:
                type: number
                format: double
              label:
                type: string
                nullable: true
          x-omitempty: true
        datadog_metric_fields:
          type: object
          properties:
            integration_token:
              type: string
              description: >-
                Integration token for the account from which you would like to
                fetch metrics.
            query:
              type: string
              description: >-
                Datadog metrics query string. e.g.
                sum:aws.applicationelb.request_count{region:us-east-1}.rollup(avg,daily)
          description: Datadog metric configuration fields
        cloudwatch_fields:
          type: object
          properties:
            integration_token:
              type: string
              description: >-
                Integration token for the account from which you would like to
                fetch metrics.
            stat:
              type: string
            region:
              type: string
            namespace:
              type: string
            metric_name:
              type: string
            label_dimension:
              type: string
            dimensions:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  value:
                    type: string
          description: Cloudwatch configuration fields.
        snowflake_metric_fields:
          type: object
          properties:
            integration_token:
              type: string
              description: >-
                Integration token for the Snowflake integration from which you
                would like to fetch metrics.
            sql_query:
              type: string
              description: >-
                Snowflake SQL query returning date, value, and optional label
                columns.
          description: Snowflake metric configuration fields.
      description: Create a new BusinessMetric.
    BusinessMetric:
      required:
        - cost_report_tokens_with_metadata
        - import_type
        - integration_token
        - title
        - token
      type: object
      properties:
        token:
          type: string
          description: The token of the BusinessMetric.
          nullable: false
          example: bsnss_mtrc_1234
        title:
          type: string
          description: The title of the BusinessMetric.
          nullable: false
          example: Total Revenue
        created_by_token:
          type: string
          description: The token of the Creator of the BusinessMetric.
          nullable: true
          example: usr_1234
        cost_report_tokens_with_metadata:
          type: array
          description: >-
            The tokens for any CostReports that use the BusinessMetric, the unit
            scale, and label filter.
          items:
            $ref: '#/components/schemas/AttachedCostReportForBusinessMetric'
        import_type:
          type: string
          description: The type of import for the BusinessMetric.
          nullable: true
          example: datadog_metrics
          enum:
            - datadog_metrics
            - cloudwatch
            - snowflake_metrics
            - metronome_metrics
            - csv
        integration_token:
          type: string
          description: The Integration token used to import the BusinessMetric.
          nullable: true
        cloudwatch_fields:
          $ref: '#/components/schemas/CloudwatchFields'
        datadog_metric_fields:
          $ref: '#/components/schemas/DatadogMetricFields'
        snowflake_metric_fields:
          $ref: '#/components/schemas/SnowflakeMetricFields'
      description: BusinessMetric model
    Errors:
      required:
        - errors
      type: object
      properties:
        links:
          $ref: '#/components/schemas/Links'
        errors:
          type: array
          nullable: false
          items:
            type: string
      description: Errors model
    AttachedCostReportForBusinessMetric:
      required:
        - calculation_type
        - cost_report_token
        - unit_scale
      type: object
      properties:
        cost_report_token:
          type: string
          description: The token of the CostReport the BusinessMetric is attached to.
          nullable: true
          example: rprt_1234
        unit_scale:
          type: string
          description: >-
            Determines the scale of the BusinessMetric's values within a
            particular CostReport.
          nullable: false
          example: per_hundred
          enum:
            - per_unit
            - per_hundred
            - per_thousand
            - per_million
            - per_billion
        calculation_type:
          type: string
          description: >-
            The calculation type applied when this BusinessMetric is used in the
            CostReport.
          nullable: false
          example: unit_cost
          enum:
            - unit_cost
            - gross_margin
            - usage_unit_cost
            - raw_business_metric
        label_filter:
          type: array
          description: >-
            The labels that the BusinessMetric is filtered by within a
            particular CostReport.
          nullable: true
          items:
            type: string
            example: ''
          x-omitempty: true
    CloudwatchFields:
      required:
        - dimensions
        - label_dimension
        - metric_name
        - namespace
        - region
        - stat
      type: object
      properties:
        stat:
          type: string
          description: The time aggregation function used to import Cloudwatch metrics.
          nullable: false
          example: Average
          enum:
            - Sum
            - Average
            - Minimum
            - Maximum
        region:
          type: string
          description: The region used to import Cloudwatch metrics.
          nullable: false
          example: us-east-1
        namespace:
          type: string
          description: The namespace used to import Cloudwatch metrics.
          nullable: false
          example: AWS/EC2
        metric_name:
          type: string
          description: The metric name used to import Cloudwatch metrics.
          nullable: false
          example: CPUUtilization
        dimensions:
          type: array
          description: >-
            The dimensions used to pull specific statistical data for Cloudwatch
            metrics.
          items:
            $ref: '#/components/schemas/CloudwatchDimension'
        label_dimension:
          type: string
          description: The dimension used to aggregate the Cloudwatch metrics.
          nullable: true
    DatadogMetricFields:
      required:
        - query
      type: object
      properties:
        query:
          type: string
          description: The query used to import Datadog metrics.
          nullable: false
          example: >-
            sum:aws.applicationelb.request_count{region:us-east-1}.rollup(avg,daily)
    SnowflakeMetricFields:
      required:
        - sql_query
      type: object
      properties:
        sql_query:
          type: string
          description: The SQL query used to import Snowflake metrics.
          nullable: false
          example: SELECT date, value, label FROM my_metrics_table
    Links:
      type: object
      properties:
        self:
          type: string
          description: The URL of the current page of results.
          nullable: true
        first:
          type: string
          description: The URL of the first page of results.
          nullable: true
        next:
          type: string
          description: The URL of the next page of results, if one exists.
          nullable: true
        last:
          type: string
          description: The URL of the last page of results, if one exists.
          nullable: true
        prev:
          type: string
          description: The URL of the previous page of results, if one exists.
          nullable: true
    CloudwatchDimension:
      required:
        - name
        - value
      type: object
      properties:
        name:
          type: string
          nullable: false
        value:
          type: string
          nullable: false
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://console.vantage.sh/account/profile
          scopes:
            read: Grants read access
            write: Grants write access

````