> ## 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 spans

> Count orchestration execution spans



## OpenAPI

````yaml https://api.getcargo.io/openapi.json post /orchestration/spans/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/spans/count:
    post:
      tags:
        - Orchestration - Spans
      summary: Count spans
      description: Count orchestration execution spans
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                workflowUuid:
                  title: Workflow UUID
                  description: >-
                    When set, restrict spans 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})$
                userUuid:
                  title: User UUID
                  description: User identifier to filter by.
                  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})$
                batchUuid:
                  title: Batch UUID
                  description: Batch identifier to filter by.
                  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})$
                runUuid:
                  title: Run UUID
                  description: Run identifier to filter by.
                  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})$
                recordId:
                  title: Record ID
                  description: Record ID to filter by.
                  type: string
                recordTitle:
                  title: Record title
                  description: Record title to filter by (SQL ilike).
                  type: string
                recordTitleOrId:
                  title: Record ID or title
                  description: >-
                    Match record id or record title (each SQL ilike); same
                    pattern as run list.
                  type: string
                parentRunUuid:
                  title: Parent run UUID
                  description: Parent run identifier to filter by.
                  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})$
                parentNodeUuid:
                  title: Parent node UUID
                  description: Filter by parent node UUID on the run.
                  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})$
                parentAgentUuid:
                  title: Parent agent UUID
                  description: >-
                    When set, restrict spans to rows whose parent agent matches
                    this UUID.
                  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})$
                nodeUuid:
                  title: Node UUID
                  description: Node identifier to filter by.
                  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})$
                nodeKind:
                  title: Node kind
                  description: Filter by node kind (native, connector, tool, agent).
                  type: string
                  enum:
                    - native
                    - connector
                    - tool
                    - agent
                nodeSlug:
                  title: Node slug
                  description: Filter by workflow node slug (exact match).
                  type: string
                nodeIntegrationSlug:
                  title: Node integration slug
                  description: Filter by connector integration slug (exact match).
                  type: string
                nodeConnectorUuid:
                  title: Node connector UUID
                  description: Filter by connector UUID.
                  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})$
                nodeActionSlug:
                  title: Node action slug
                  description: Filter by node action slug (exact match).
                  type: string
                nodeToolUuid:
                  title: Node tool UUID
                  description: Filter by tool node UUID.
                  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})$
                nodeAgentUuid:
                  title: Node agent UUID
                  description: Filter by agent node UUID.
                  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})$
                nodeReleaseUuid:
                  title: Node release UUID
                  description: Filter by release UUID referenced on the node.
                  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})$
                executionTitle:
                  title: Execution title
                  description: Filter by execution title (SQL ilike).
                  type: string
                executionStatuses:
                  title: Execution statuses
                  description: Execution statuses to include.
                  type: array
                  items:
                    type: string
                    enum:
                      - pending
                      - success
                      - error
                executionStartedAfter:
                  type: string
                  title: Execution started after
                  description: >-
                    Include spans whose execution started after this timestamp
                    (ISO string). Required.
                executionStartedBefore:
                  title: Execution started before
                  description: >-
                    Include spans whose execution started on or before this
                    timestamp (ISO string).
                  type: string
              required:
                - executionStartedAfter
              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 spans 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

````