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

# Locate a trace

To find a trace and then fetch its spans, see [Querying traces](https://docs.appsignal.com/api/v2/traces.md#locate-a-trace).

```yaml POST /api/v2/tracing/locator theme={null}
openapi: 3.1.0
info:
  title: AppSignal V2 API
  description: >-
    REST API for metrics, traces, logs, Kubernetes monitoring, and deployment
    tracking.
  license:
    name: ''
  version: 0.1.0
paths:
  /api/v2/tracing/locator:
    post:
      tags:
        - Tracing
      summary: Locate a trace
      operationId: locator
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LocatorQuery'
            example:
              site_ids:
                - abc123
              trace_id: 5baa0559ff2f4d35f3b2cd90d312bac3
        required: true
      responses:
        '200':
          description: >-
            The performance actions and error incidents the trace appears in;
            both lists are empty when it is not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TraceLocation'
              example:
                performance:
                  - site_id: abc123
                    namespace: web
                    action_name: POST /api/users
                errors:
                  - site_id: abc123
                    incident_number: 42
                    exception_name: RuntimeError
                    incident_digests:
                      - '1234567890'
        '400':
          description: Malformed request, or input the server cannot process.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
        '401':
          description: Missing or invalid authentication token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Route or resource not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: External query concurrency limit exceeded; retry shortly.
          headers:
            Retry-After:
              schema:
                type: integer
              description: Seconds to wait before retrying.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequestsResponse'
        '500':
          description: Unhandled server-side failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearer_auth: []
        - token_query: []
components:
  schemas:
    BadRequestResponse:
      type: object
      description: >-
        Standard body for HTTP 400 Bad Request responses. Branch on the stable
        `error` slug, display `message` as-is, and read per-error structured
        data from `details`.
      required:
        - error
        - message
      properties:
        error:
          type: string
          description: Stable, machine-readable slug identifying the specific error case.
        message:
          type: string
          description: Human-readable message. Safe to log or display to end users.
        details:
          description: >-
            Per-error structured payload. Shape varies by
            [`error`](Self::error).
    ErrorLocation:
      type: object
      description: Error incident where a trace appears.
      required:
        - site_id
        - incident_number
        - exception_name
        - incident_digests
      properties:
        site_id:
          type: string
          description: Site identifier.
        incident_number:
          type: integer
          format: int64
          description: Incident number that groups related errors.
        exception_name:
          type: string
          description: Name of the exception (e.g. `"RuntimeError"`).
        incident_digests:
          type: array
          items:
            type: string
          description: >-
            Digests from this trace that belong to this incident, matching the
            `appsignal.incident_digest` attribute on exception events.
    ErrorResponse:
      type: object
      description: Error body returned for 401, 404 and 500 responses.
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable error message.
    LocatorQuery:
      type: object
      description: The trace to locate and the sites to search.
      required:
        - site_ids
        - trace_id
      properties:
        site_ids:
          type: array
          items:
            type: string
          description: Sites to search across; the token must have access to all of them.
        trace_id:
          type: string
          description: The trace to locate.
    PerformanceLocation:
      type: object
      description: Performance action where a trace appears.
      required:
        - site_id
        - namespace
        - action_name
      properties:
        site_id:
          type: string
          description: Site identifier.
        namespace:
          type: string
          description: Namespace of the action (e.g. `"web"`).
        action_name:
          type: string
          description: Name of the action (e.g. `"POST /api/users"`).
    TooManyRequestsResponse:
      type: object
      description: Error body returned for 429 responses.
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable error message.
        suggestion:
          type:
            - string
            - 'null'
          description: >-
            A cheaper way to write the request's filter. Only the trace list

            endpoints set it, and only for a filter with a known indexed
            rewrite.
    TraceLocation:
      type: object
      description: Locations of a trace in performance and error contexts.
      required:
        - performance
        - errors
      properties:
        performance:
          type: array
          items:
            $ref: '#/components/schemas/PerformanceLocation'
          description: Performance actions where this trace appears.
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ErrorLocation'
          description: Error incidents where this trace appears.
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      description: '`Authorization: Bearer <token>`'
    token_query:
      type: apiKey
      in: query
      name: token
      description: >-
        Alternative to the Authorization header: pass the token as a
        `?token=<token>` query parameter.
```


## API Specification

The full API specification for this endpoint is available in the [documentation index](https://docs.appsignal.com/llms.txt).


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