Skip to main content
POST
/
v1
/
agents
/
{agent_id}
/
prompts
/
versions
/
{version}
/
labels
Add Prompt Version Labels Agent Scoped
curl --request POST \
  --url https://api.getbluejay.ai/v1/agents/{agent_id}/prompts/versions/{version}/labels \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <x-api-key>' \
  --data '
{
  "labels": [
    "<string>"
  ],
  "override_label": false
}
'
{
  "labels": [
    "<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.

## Add Prompt Version Labels — POST /v1/agents/{agent_id}/prompts/versions/{version}/labels

**Endpoint:** POST `https://api.getbluejay.ai/v1/agents/{agent_id}/prompts/versions/{version}/labels`
**Auth:** `X-API-Key` header
**Content-Type:** application/json

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

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

### Request Body
```json
{
  "labels": [
    "string"
  ],
  "override_label": true
}
```

### Example
**POST with body:**
```python
import requests

def add_prompt_version_labels(agent_id: int, version: int, payload: dict, api_key: str) -> dict:
    url = f"https://api.getbluejay.ai/v1/agents/{agent_id}/prompts/versions/{version}/labels"
    headers = {"X-API-Key": api_key}
    response = requests.post(url, headers=headers, json=payload)
    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.
Adds labels to a specific prompt version.

Headers

X-API-Key
string
required

API key required to authenticate requests.

Path Parameters

agent_id
integer
required
version
integer
required

Body

application/json

request body for add/remove label operations.

labels: list of labels to add or remove. empty/null means no-op for add, and clear-all for remove (callers decide the semantics). override_label: when true, adding an existing label moves its association to the requested resource; when false, conflicts return 409.

labels
string[] | null
override_label
boolean | null
default:false

Response

Successful Response

response wrapper for just a list of labels.

labels
string[]