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

# List all Usage Metrics

> List all Usage Metrics



## OpenAPI

````yaml usage.latest.product.live GET /usage-metrics
openapi: 3.0.0
info:
  title: Usage
  description: Manage usage events and metrics
  version: '0.1'
servers:
  - url: https://dev.seqhq.io/api
    description: DEV
  - url: https://sandbox.sequencehq.com/api
    description: SANDBOX
  - url: https://eu.sequencehq.com/api
    description: PRODUCTION
security: []
tags: []
paths:
  /usage-metrics:
    servers: []
    parameters: []
    get:
      tags:
        - Usage Metrics
      summary: List all Usage Metrics
      description: List all Usage Metrics
      operationId: getUsageMetrics
      parameters:
        - name: Authorization
          in: header
          description: >-
            Your [API credentials](/reference/authentication). Eg. `Basic
            {credentials}`.
          required: true
          schema:
            type: string
        - name: limit
          in: query
          description: >-
            Maximum number of objects to return per-page. Must be between 1 and
            100 (inclusive).
          required: false
          schema:
            type: integer
        - name: after
          in: query
          description: >-
            Pagination offset. To page through items, omit this parameter to
            retrieve the first page, and then successively use the value you get
            from `pagination.after` or `pagination.before` to retrieve each
            page.
          required: false
          schema:
            type: string
        - name: before
          in: query
          description: >-
            Pagination offset. To page through items, omit this parameter to
            retrieve the first page, and then successively use the value you get
            from `pagination.next` or `pagination.previous` to retrieve each
            page.
          required: false
          schema:
            type: string
        - name: name
          in: query
          description: Filter metrics by name (case-insensitive substring)
          required: false
          schema:
            type: string
        - name: id
          in: query
          description: Filter metrics by ID (case-insensitive substring)
          required: false
          schema:
            type: string
        - name: eventType
          in: query
          description: >-
            Filter metrics by event type(s). Comma-separated; individual values
            must be percent-encoded so values containing commas are preserved.
          required: false
          schema:
            type: string
        - name: eventProperty
          in: query
          description: >-
            Filter metrics by aggregation property name(s). Comma-separated;
            individual values must be percent-encoded so values containing
            commas are preserved.
          required: false
          schema:
            type: string
        - name: aggregationType
          in: query
          description: Filter metrics by aggregation type(s); comma-separated
          required: false
          schema:
            type: string
        - name: Sequence-Version
          in: header
          description: Use this header to select an API version
          required: false
          schema:
            type: string
            enum:
              - '2024-07-30'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ListUsageMetricEndpointProductResponseModel
                example:
                  items:
                    - id: f092246c-6b90-4106-bcca-304ccf06bf45
                      sequenceAccountId: ec1479a2-6ba1-421f-a7de-0853a20d17a1
                      name: Total length of sent messages.
                      description: Total length of sent messages.
                      metricType: GROUPED
                      eventType: message_sent
                      aggregationType: COUNT
                      aggregationProperty: message_length
                      groupingProperty: channel
                      unit: bytes
                      createdAt: '2022-06-28T16:47:00Z'
                      deletedAt: '2022-06-28T16:47:00Z'
                      propertyFilters:
                        channels:
                          - text
                          - email
                      caseSensitive: true
                      propertiesToNegate:
                        - channels
                      parameters:
                        - id: 2963e49a-c8e0-4673-89f5-7a805c0faf14
                          usageMetricId: f092246c-6b90-4106-bcca-304ccf06bf45
                          name: myParam
                          type: INTEGER
                          description: My parameter
                          defaultValue: '10'
                  pagination:
                    after: MDE4NDUyNjYtNmQ2NC03N2M4LTlhZGYtNDQ4N2Q5NGQxNDU3
                    before: MDE4NDQyMWUtYTljYy03MTFiLWFmOTMtYmYwNTExZDRkODMz
                    totalResultSize: 10
              examples:
                ListUsageMetricEndpointProductResponseModel:
                  summary: ''
                  value:
                    items:
                      - id: f092246c-6b90-4106-bcca-304ccf06bf45
                        sequenceAccountId: ec1479a2-6ba1-421f-a7de-0853a20d17a1
                        name: Total length of sent messages.
                        description: Total length of sent messages.
                        metricType: GROUPED
                        eventType: message_sent
                        aggregationType: COUNT
                        aggregationProperty: message_length
                        groupingProperty: channel
                        unit: bytes
                        createdAt: '2022-06-28T16:47:00Z'
                        deletedAt: '2022-06-28T16:47:00Z'
                        propertyFilters:
                          channels:
                            - text
                            - email
                        caseSensitive: true
                        propertiesToNegate:
                          - channels
                        parameters:
                          - id: 2963e49a-c8e0-4673-89f5-7a805c0faf14
                            usageMetricId: f092246c-6b90-4106-bcca-304ccf06bf45
                            name: myParam
                            type: INTEGER
                            description: My parameter
                            defaultValue: '10'
                    pagination:
                      after: MDE4NDUyNjYtNmQ2NC03N2M4LTlhZGYtNDQ4N2Q5NGQxNDU3
                      before: MDE4NDQyMWUtYTljYy03MTFiLWFmOTMtYmYwNTExZDRkODMz
                      totalResultSize: 10
        '400':
          description: Bad Request
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '500':
          description: Internal Server Error
          content: {}
components:
  schemas:
    ListUsageMetricEndpointProductResponseModel:
      required:
        - items
        - pagination
      type: object
      example:
        items:
          - id: f092246c-6b90-4106-bcca-304ccf06bf45
            sequenceAccountId: ec1479a2-6ba1-421f-a7de-0853a20d17a1
            name: Total length of sent messages.
            description: Total length of sent messages.
            metricType: GROUPED
            eventType: message_sent
            aggregationType: COUNT
            aggregationProperty: message_length
            groupingProperty: channel
            unit: bytes
            createdAt: '2022-06-28T16:47:00Z'
            deletedAt: '2022-06-28T16:47:00Z'
            propertyFilters:
              channels:
                - text
                - email
            caseSensitive: true
            propertiesToNegate:
              - channels
            parameters:
              - id: 2963e49a-c8e0-4673-89f5-7a805c0faf14
                usageMetricId: f092246c-6b90-4106-bcca-304ccf06bf45
                name: myParam
                type: INTEGER
                description: My parameter
                defaultValue: '10'
        pagination:
          after: MDE4NDUyNjYtNmQ2NC03N2M4LTlhZGYtNDQ4N2Q5NGQxNDU3
          before: MDE4NDQyMWUtYTljYy03MTFiLWFmOTMtYmYwNTExZDRkODMz
          totalResultSize: 10
      properties:
        items:
          type: array
          description: Usage metrics
          example:
            - id: f092246c-6b90-4106-bcca-304ccf06bf45
              sequenceAccountId: ec1479a2-6ba1-421f-a7de-0853a20d17a1
              name: Total length of sent messages.
              description: Total length of sent messages.
              metricType: GROUPED
              eventType: message_sent
              aggregationType: COUNT
              aggregationProperty: message_length
              groupingProperty: channel
              unit: bytes
              createdAt: '2022-06-28T16:47:00Z'
              deletedAt: '2022-06-28T16:47:00Z'
              propertyFilters:
                channels:
                  - text
                  - email
              caseSensitive: true
              propertiesToNegate:
                - channels
              parameters:
                - id: 2963e49a-c8e0-4673-89f5-7a805c0faf14
                  usageMetricId: f092246c-6b90-4106-bcca-304ccf06bf45
                  name: myParam
                  type: INTEGER
                  description: My parameter
                  defaultValue: '10'
          items:
            $ref: '#/components/schemas/UsageMetric'
        pagination:
          $ref: '#/components/schemas/PaginationMeta'
    UsageMetric:
      required:
        - aggregationType
        - eventType
        - id
        - metricType
        - name
        - parameters
        - propertyFilters
        - sequenceAccountId
      type: object
      example:
        id: f092246c-6b90-4106-bcca-304ccf06bf45
        sequenceAccountId: ec1479a2-6ba1-421f-a7de-0853a20d17a1
        name: Total length of sent messages.
        description: Total length of sent messages.
        metricType: GROUPED
        eventType: message_sent
        aggregationType: COUNT
        aggregationProperty: message_length
        groupingProperty: channel
        unit: bytes
        createdAt: '2022-06-28T16:47:00Z'
        deletedAt: '2022-06-28T16:47:00Z'
        propertyFilters:
          channels:
            - text
            - email
        caseSensitive: true
        propertiesToNegate:
          - channels
        parameters:
          - id: 2963e49a-c8e0-4673-89f5-7a805c0faf14
            usageMetricId: f092246c-6b90-4106-bcca-304ccf06bf45
            name: myParam
            type: INTEGER
            description: My parameter
            defaultValue: '10'
      properties:
        id:
          type: string
          description: Unique ID
          example: f092246c-6b90-4106-bcca-304ccf06bf45
        sequenceAccountId:
          type: string
          description: Sequence Account ID
          example: ec1479a2-6ba1-421f-a7de-0853a20d17a1
        name:
          type: string
          description: Human-readable name for this metric, which should be unique
          example: Total length of sent messages.
        description:
          type: string
          description: Description for this metric
          example: Total length of sent messages.
        metricType:
          $ref: '#/components/schemas/MetricType'
          description: Type of metric (simple or grouped)
        eventType:
          type: string
          description: The `eventType` of the Usage Event to be aggregated
          example: message_sent
        aggregationType:
          $ref: '#/components/schemas/AggregationType'
          description: Type of aggregation to perform
        aggregationProperty:
          type: string
          description: Property within the event to aggregate
          example: message_length
        groupingProperty:
          type: string
          description: Property within the event to group results by
          example: channel
        unit:
          type: string
          description: Human-readable unit of the aggregated metric, eg. API calls)
          example: bytes
        createdAt:
          type: string
          description: Created at
          example: '2022-06-28T16:47:00Z'
        deletedAt:
          type: string
          description: Created at
          example: '2022-06-28T16:47:00Z'
        propertyFilters:
          type: object
          additionalProperties: {}
        caseSensitive:
          type: boolean
          example: true
        propertiesToNegate:
          type: array
          example:
            - channels
          items:
            type: string
        parameters:
          type: array
          description: Required parameters
          example:
            - id: 2963e49a-c8e0-4673-89f5-7a805c0faf14
              usageMetricId: f092246c-6b90-4106-bcca-304ccf06bf45
              name: myParam
              type: INTEGER
              description: My parameter
              defaultValue: '10'
          items:
            $ref: '#/components/schemas/CustomMetricParameter'
    PaginationMeta:
      type: object
      description: Results pagination
      example:
        after: MDE4NDUyNjYtNmQ2NC03N2M4LTlhZGYtNDQ4N2Q5NGQxNDU3
        before: MDE4NDQyMWUtYTljYy03MTFiLWFmOTMtYmYwNTExZDRkODMz
        totalResultSize: 10
      properties:
        after:
          type: string
          description: Cursor for the page after this (if it exists)
          example: MDE4NDUyNjYtNmQ2NC03N2M4LTlhZGYtNDQ4N2Q5NGQxNDU3
        before:
          type: string
          description: Cursor for the page before this (if it exists)
          example: MDE4NDQyMWUtYTljYy03MTFiLWFmOTMtYmYwNTExZDRkODMz
        totalResultSize:
          type: integer
          description: Total number of entries across all pages
          format: int64
          example: 10
    MetricType:
      type: string
      example: GROUPED
      enum:
        - SIMPLE
        - GROUPED
    AggregationType:
      type: string
      example: COUNT
      enum:
        - COUNT
        - UNIQUE
        - SUM
        - CUSTOM
    CustomMetricParameter:
      required:
        - defaultValue
        - description
        - id
        - name
        - type
        - usageMetricId
      type: object
      example:
        id: 2963e49a-c8e0-4673-89f5-7a805c0faf14
        usageMetricId: f092246c-6b90-4106-bcca-304ccf06bf45
        name: myParam
        type: INTEGER
        description: My parameter
        defaultValue: '10'
      properties:
        id:
          type: string
          example: 2963e49a-c8e0-4673-89f5-7a805c0faf14
        usageMetricId:
          type: string
          example: f092246c-6b90-4106-bcca-304ccf06bf45
        name:
          type: string
          example: myParam
        type:
          $ref: '#/components/schemas/CustomParameterType'
        description:
          type: string
          example: My parameter
        defaultValue:
          type: string
          example: '10'
    CustomParameterType:
      type: string
      example: INTEGER
      enum:
        - INTEGER
        - POSITIVE_INTEGER
        - NUMBER
        - POSITIVE_NUMBER

````