Skip to main content
POST
/
v1
/
generate-digital-humans
Generate Digital Humans
curl --request POST \
  --url https://api.getbluejay.ai/v1/generate-digital-humans \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <x-api-key>' \
  --data '
{
  "agent_id": "<string>",
  "simulation_id": "<string>",
  "prompt_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "knowledge_base_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "goal_adherence": [
    {
      "goal": "<string>",
      "num_calls": 123
    }
  ],
  "workflow_adherence": {},
  "workflow_adherence_v2": {},
  "replay_transcript": [
    {
      "transcript": "<string>",
      "success_criteria": "<string>",
      "mode": "smart"
    }
  ],
  "customer_personas": [
    {
      "name": "<string>",
      "description": "<string>",
      "goal": "<string>",
      "num_calls": 123
    }
  ],
  "load_testing": 0,
  "red_teaming": 0,
  "traits": [
    {
      "trait_name": "<string>",
      "trait_data_type": "BOOLEAN",
      "value": "<unknown>",
      "is_sip_header": false
    }
  ],
  "num_runs": 1
}
'
{
  "digital_humans": [
    "<unknown>"
  ],
  "status": "200",
  "success": true,
  "test_scenarios": [
    "<unknown>"
  ],
  "warning": "<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.

## Generate Digital Humans — POST /v1/generate-digital-humans

> **What this endpoint does:** Given an agent this endpoint generates digital humans to test that agent based on varying simulation types.

**Endpoint:** POST `https://api.getbluejay.ai/v1/generate-digital-humans`
**Auth:** `X-API-Key` header
**Content-Type:** application/json

### Required Parameters
| Name | Type | Description |
|------|------|-------------|
| X-API-Key | string | API key required to authenticate requests. |
| agent_id | string | ID of the agent to be used to generate the digital humans |

Review the full parameter list at https://docs.getbluejay.ai/api-reference/endpoint/generate-digital-humans and include any optional parameters (e.g., `simulation_id`, `prompt_id`, `knowledge_base_id`, `goal_adherence`, `workflow_adherence`, `workflow_adherence_v2`) that serve your integration's use case and align with Bluejay's testing and monitoring capabilities.

### Request Body (required fields)
```json
{
  "agent_id": "string"
}
```

Refer to the full schema at https://docs.getbluejay.ai/api-reference/endpoint/generate-digital-humans. Include optional fields that serve the goal of setting up for testing and monitoring on Bluejay.

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

def generate_digital_humans(payload: dict, api_key: str) -> dict:
    url = "https://api.getbluejay.ai/v1/generate-digital-humans"
    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 400: Request or generation constraint violation; 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.
Given the simulation ID and generation options, this endpoint creates digital humans from scenarios. Payload shape and validation rules (including workflow-based generation) are documented in the OpenAPI schema on this page. For graph-based paths, see Create workflow and the Workflows cookbook. The generate request does not accept allow_silence_tool or silence_tool_instructions; those are set when you create or update a digital human explicitly. Generated or returned digital_human objects in responses may still include those fields at model defaults (allow_silence_tool false, silence_tool_instructions "default"). Whether the silence tool runs in voice simulations is determined by the execution layer that reads stored test-case data, not by this API alone.

Headers

X-API-Key
string
required

API key required to authenticate requests.

Body

application/json

Pydantic model for digital humans (simulation type) request

agent_id
string
required

ID of the agent to be used to generate the digital humans

simulation_id
string | null

Optionally attach the digital humans to a simulation

prompt_id
string<uuid> | null

Prompt UUID associated with the simulation

knowledge_base_id
string<uuid> | null

Knowledge base UUID associated with the simulation

goal_adherence
GoalAdherence · object[] | null

List of goal adherence scenarios

workflow_adherence
Workflow Adherence · object

Dictionary of workflow IDs and their counts

workflow_adherence_v2
Workflow Adherence V2 · object

Dictionary of workflow_v2 IDs and their counts (uses new graph definition format)

replay_transcript
(Replay Transcript From Text · object | Replay Transcript From Conversation ID · object)[] | null

List of transcript replays to generate digital humans from

Replay transcript by providing the transcript text directly.

customer_personas
CustomerPersonaRequest · object[] | null
deprecated

List of customer personas to be used in the simulation

load_testing
integer | null
default:0

Number of load testing calls

red_teaming
integer | null
default:0

Number of red teaming calls

traits
Trait · object[] | null

List of traits to apply to all generated digital humans

num_runs
integer | null
default:1

Number of runs per digital human per simulation run (run count).

Required range: x >= 1

Response

Successful Response

digital_humans
any[]

List of digital humans created for the simulation

status
string
default:200

Status of the response

success
boolean
default:true

Whether the generation succeeded

test_scenarios
any[] | null

Scenario view of created digital humans (includes original_transcript and formatted_transcript for transcript replays)

warning
string | null

Warning message if the request was modified (e.g. truncated due to exceeding the max limit)