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

# Add a dimension to a product

> Adds a dimension. Its `key` is what usage data is matched on: send one (lower-case letters, digits, underscores) or it is made from the name, as the app makes it. Keys are unique across the workspace (one held is a 409) and fixed once set. `type` defaults to number.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/products/{product_id}/dimensions
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/products/{product_id}/dimensions:
    post:
      tags:
        - products
      summary: Add a dimension to a product
      description: >-
        Adds a dimension. Its `key` is what usage data is matched on: send one
        (lower-case letters, digits, underscores) or it is made from the name,
        as the app makes it. Keys are unique across the workspace (one held is a
        409) and fixed once set. `type` defaults to number.
      operationId: products_create_dimension
      parameters:
        - in: path
          name: product_id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                currency:
                  anyOf:
                    - type: boolean
                    - type: 'null'
                  default: null
                  title: Currency
                hidden:
                  anyOf:
                    - type: boolean
                    - type: 'null'
                  default: null
                  title: Hidden
                key:
                  anyOf:
                    - pattern: ^[a-z0-9][a-z0-9_]{0,99}$
                      type: string
                    - type: 'null'
                  default: null
                  description: >-
                    Lower-case letters, digits and underscores; made from the
                    name when not sent
                  title: Key
                name:
                  maxLength: 200
                  minLength: 1
                  title: Name
                  type: string
                order:
                  anyOf:
                    - maximum: 10000
                      minimum: 0
                      type: integer
                    - type: 'null'
                  default: null
                  title: Order
                show_change:
                  anyOf:
                    - type: boolean
                    - type: 'null'
                  default: null
                  title: Show Change
                suffix:
                  anyOf:
                    - maxLength: 40
                      type: string
                    - type: 'null'
                  default: null
                  title: Suffix
                type:
                  default: null
                  enum:
                    - number
                    - text
                    - boolean
                    - date
                    - percent
                    - ratio
                  title: Type
                  type: string
              required:
                - name
              type: object
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Dimension'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    Dimension:
      properties:
        currency:
          default: false
          description: Whether the app shows values as money
          title: Currency
          type: boolean
        hidden:
          default: false
          description: Whether the app hides the dimension
          title: Hidden
          type: boolean
        id:
          title: Id
          type: string
        key:
          description: >-
            What usage data is matched on; unique across the workspace, and
            fixed
          title: Key
          type: string
        name:
          title: Name
          type: string
        order:
          anyOf:
            - type: integer
            - type: 'null'
          description: Its place among the product's dimensions; null for last
          title: Order
        product:
          description: The id of the product it measures
          title: Product
          type: string
        show_change:
          default: false
          description: Whether the app shows the change since the period before
          title: Show Change
          type: boolean
        suffix:
          anyOf:
            - type: string
            - type: 'null'
          description: Shown after a value, such as 'users'
          title: Suffix
        type:
          anyOf:
            - enum:
                - number
                - text
                - boolean
                - date
                - percent
                - ratio
              type: string
            - type: 'null'
          description: >-
            number, text, boolean, date, percent (0 to 100) or ratio (0 to 1);
            null for a type the app stores that this API does not know
          title: Type
      required:
        - id
        - product
        - key
        - name
      title: Dimension
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.