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

# Count traces

> Count orchestration traces matching the filter.



## OpenAPI

````yaml https://api.getcargo.io/openapi.json post /orchestration/traces/count
openapi: 3.1.0
info:
  title: Cargo API
  version: 1.0.0
  description: Cargo Platform API v1
servers:
  - url: https://api.getcargo.io/v1
    description: Cargo API
security:
  - bearerAuth: []
paths:
  /orchestration/traces/count:
    post:
      tags:
        - Orchestration - Traces
      summary: Count traces
      description: Count orchestration traces matching the filter.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workflowUuid:
                  title: Workflow UUID
                  description: >-
                    When set, restrict traces to this workflow. Omit to search
                    across workflows in the workspace.
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$
                statuses:
                  title: Statuses
                  description: >-
                    Filter traces by their derived status (`pending` if any span
                    anywhere in the trace is still pending, `error` if any of
                    the root run's spans has errored, otherwise `success`).
                  type: array
                  items:
                    type: string
                    enum:
                      - pending
                      - error
                      - success
                startedAfter:
                  type: string
                  title: Started after
                  description: >-
                    Include traces whose first execution started after this
                    timestamp (ISO string). Required.
                startedBefore:
                  title: Started before
                  description: >-
                    Include traces whose first execution started on or before
                    this timestamp (ISO string).
                  type: string
              required:
                - startedAfter
              additionalProperties: false
              title: Request body
              description: Request body schema.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: number
                    title: Count
                    description: Number of traces matching the filter.
                required:
                  - count
                additionalProperties: false
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '500':
          description: Internal server error
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````