Skip to main content
GET
/
v1
/
agents
/
{agent_id}
/
labels
List Labels
curl --request GET \
  --url https://api.getbluejay.ai/v1/agents/{agent_id}/labels \
  --header 'X-API-Key: <x-api-key>'
[
  {
    "agent_id": 123,
    "label_text": "<string>",
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "created_at": "2023-11-07T05:31:56Z",
    "prompt_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "knowledge_base_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "color": "<string>"
  }
]
Integration Prompt for AI Agents
# Bluejay — Testing & Monitoring Platform for Conversational AI Agents

You are a senior backend engineer integrating the Bluejay API. Think step-by-step: first understand the endpoint, then plan the integration, then implement with minimal changes.

## List Labels — GET /v1/agents/{agent_id}/labels

> **What this endpoint does:** list all free-standing labels for an agent; filter by substring with q.

**Endpoint:** GET `https://api.getbluejay.ai/v1/agents/{agent_id}/labels`
**Auth:** `X-API-Key` header

### Required Parameters
| Name | Type | Description |
|------|------|-------------|
| agent_id | integer |  |
| X-API-Key | string | API key required to authenticate requests. |

Review the full parameter list at https://docs.getbluejay.ai/api-reference/endpoint/list-labels and include any optional parameters (e.g., `q`) that serve your integration's use case and align with Bluejay's testing and monitoring capabilities.

### Example
**Simple GET:**
```python
import requests

def list_labels(agent_id: int, api_key: str) -> dict:
    url = f"https://api.getbluejay.ai/v1/agents/{agent_id}/labels"
    headers = {"X-API-Key": api_key}
    response = requests.get(url, headers=headers)
    response.raise_for_status()
    return response.json()
```

### Constraints
- Minimal changes — only add/change files needed for this integration.
- Match existing codebase patterns (naming, file structure, error handling).
- Include error handling for 422: Validation Error.

### Integration Checklist
Before writing code, verify:
1. Which module/service owns this API domain in the codebase?
2. What HTTP client and error-handling patterns does the project use?
3. Are there existing types/interfaces to extend?

Then implement the integration, export it, and confirm it compiles/passes lint.
List all free-standing labels for an agent; filter by substring with q.

Headers

X-API-Key
string
required

API key required to authenticate requests.

Path Parameters

agent_id
integer
required

Query Parameters

q
string | null

Response

Successful Response

agent_id
integer
required
label_text
string
required
id
string<uuid> | null
created_at
string<date-time> | null
prompt_id
string<uuid> | null
knowledge_base_id
string<uuid> | null
color
string | null