---
title: "Discover span attribute keys for a project."
method: GET
path: "/api/traces/span-attribute-keys/"
tags: ["api"]
---

# Discover span attribute keys for a project.

`GET /api/traces/span-attribute-keys/`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/api/traces/span-attribute-keys/`
- Auth: one of:
  - API key in header `X-Api-Key`
  - API key in header `X-Secret-Key`

Cursor mode walks retained project data newest-first in bounded pages;
exact ``q`` lookup remains available for direct key discovery.
``discovery_mode=eval_mapping`` includes JSON-only keys that eval mapping
can resolve but attribute filters cannot query. The default ``filter``
mode retains the narrower filterable-key contract.
The no-page-size form is retained for older clients.

GET /api/traces/span-attribute-keys/?project_id=<uuid>&page_size=10

## Query parameters

- `project_id` string, uuid
- `workspace_scope` boolean
- `discovery_mode` 'filter' | 'eval_mapping'
- `q` string
- `page_size` integer
- `cursor` string

## Response `200`

OK

- SpanAttributeKeysResponse
  - `result` SpanAttributeKey[], required
    - `key` string, required
    - `type` 'string' | 'number' | 'boolean' | 'array' | 'map' | 'json', required
    - `count` integer, required
    - `count_exact` boolean
    - `types` string[]
  - `total_count` integer
  - `query_complete` boolean, required
  - `query_status` 'complete' | 'sampled' | 'degraded', required
  - `query_error_code` 'sample_limit' | 'read_budget_exceeded' | 'query_failed'
  - `query_window_start` string, date-time, required
  - `query_window_end` string, date-time, required
  - `query_window_mode` 'frozen_snapshot'
  - `query_count` integer
  - `has_more` boolean
  - `next_cursor` string, nullable
  - `browse_mode` 'recent_suggestions'
  - `browse_status` 'continuation' | 'exhausted' | 'limit_reached'
  - `browse_limit` integer
  - `lookup_mode` 'exact'
  - `exact_match` boolean

## Other responses

- `400`: Bad Request
- `404`: Not Found
- `500`: Internal Server Error
- `503`: Service Unavailable
- `default`: Default error response

---

[API](https://skmtc.dev/futureagi/apis/future-agi-management-api.md) · [All operations](https://skmtc.dev/futureagi/apis/future-agi-management-api/llms.txt) · [OpenAPI document](https://skmtc.dev/futureagi/apis/future-agi-management-api/revisions/c8684118e142?raw)
