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

# Simulation Reference

> Statuses, error codes, and settings for simulations.

## Call statuses

The API returns the status value in capitals, for example `NO_CONNECTION`.

### Final statuses

| Status | Value | Meaning |
| - | - | - |
| Completed | `COMPLETED` | The call ran and was scored. Pass or fail shows separately. |
| No Connection | NO\_CONNECTION | Bluejay could not reach your agent. |
| No Answer | `NO_ANSWER` | Bluejay reached the line, but nobody engaged. |
| Call Dropped | CALL\_DROPPED | The call started, then the line dropped. Bluejay scores the transcript up to the drop. |
| Out of Funds | OUT\_OF\_FUNDS | Your Bluejay balance ran out. |
| System Error | SYSTEM\_ERROR | A Bluejay service failed. |
| Custom Error | CUSTOM\_ERROR | The transcript matched the custom error prompt in the simulation settings. |
| Cancelled | `CANCELLED` | You stopped the call before it ran or before anything was recorded. |

### In-progress statuses

| Status | Value | Meaning |
| - | - | - |
| Initializing | `INITIALIZING` | Bluejay is preparing the call. |
| Queued | `QUEUED` | The call waits to start. |
| Ready | `READY` | Bluejay loaded the test data. The call is ready to start. |
| Dispatched | `DISPATCHED` | Bluejay sent the call to a call worker. |
| Running | `RUNNING` | The conversation is in progress. |
| Evaluation Pending | CONVERSATION\_ENDED | The conversation ended and waits for scoring. |
| Evaluating | `EVALUATING` | Bluejay is running the metrics. |

You can cancel a call while its status is one of these:

* `INITIALIZING`
* `QUEUED`
* `READY`
* `DISPATCHED`

You can end a `RUNNING` call. If nothing was recorded when it ends, its status is `CANCELLED`.

## Error codes

Each failed call has an `error_code` and a message that say what went wrong. The codes are grouped by the call's status.

### No Connection

Usually a problem in your configuration or your provider plan. In a code, `<PROVIDER>` is the name of your voice platform. The Limits section of your platform page under **Integrations** lists its exact codes.

| Codes | Meaning | What to do |
| - | - | - |
| WEBSOCKET\_AUTH\_FAILED | Your WebSocket endpoint rejected the credentials that Bluejay has. | Update the username and password on the agent. |
| | Your provider rejected the API key that Bluejay has. | Update the key in the integration settings. |
| | The provider integration is not connected or not complete. | Connect the integration. |
| | Bluejay could not decrypt the stored credentials. | Connect the integration again. |
|  NO\_PIPECAT\_AGENT\_NAME | The agent ID, assistant ID, or agent name is empty. | Set it on the agent. |
| OUTBOUND\_TRIGGER\_FAILED | Your [outbound trigger webhook](#outbound-trigger-webhook) did not return a `2xx` status after 3 tries. | Check the URL and that your endpoint answers within 15 seconds. |
|   | The provider accepted the connection but did not start a session. Often temporary. | Run the call again. |
| LIVEKIT\_SESSION\_SETUP\_FAILED | Bluejay could not join your LiveKit room. Most often your token webhook rejected the request or returned a token that does not work. | Check the token webhook and its `Authorization` header on the agent. |
| BRIDGE\_PRE\_START\_FAILED | The WebSocket connection to your agent failed before the conversation started. | Check that your endpoint is running, then run the call again. |
| UNUSABLE\_CALLER\_ID INVALID\_PHONE\_NUMBER INVALID\_SIP\_DESTINATION SIP\_DIAL\_FAILED | The caller ID is not verified, the destination is not valid, or the SIP dial failed. | Check the number or SIP destination. |
| DYNAMIC\_ENDPOINT\_FAILED | Bluejay could not get a SIP endpoint from the dynamic SIP webhook of the agent. | Check that the webhook is reachable and returns an endpoint. |
| CUSTOMER\_CONCURRENCY\_LIMIT | Your provider's concurrent-call limit was reached. | Raise the limit or run fewer calls at once. |
| NO\_CONNECTION\_TYPE | The agent has no connection type. | Set a connection type. |

### No Answer

The problem is on your side: your agent or your line.

| Code | Meaning |
| - | - |
| `NO_ANSWER` | The phone rang and nobody answered. |
| CALL\_REJECTED | Your agent rejected the call (SIP 486 or 603). |
| AGENT\_HUNG\_UP\_BEFORE\_SPEECH | Your agent answered, then hung up before it spoke. |
| AGENT\_NO\_RESPONSE | Your agent connected, but did not reply when the Digital Human spoke. |
| INBOUND\_NO\_INCOMING\_CALL | Inbound Digital Humans only. Your agent did not call the Digital Human. |
| STEP\_NO\_ACTIVITY | A Customer Journeys step had no call or message before its deadline. |

Make sure your agent is online, accepts calls from the Bluejay caller ID, and routes Bluejay traffic correctly.

### Call Dropped

Usually a problem with your agent or your provider. Check your provider status page and your recent agent changes.

| Codes | Meaning |
| - | - |
| | Your provider agent reported an error during the call. |
| | Your provider agent did not start its turn. |
| | Bluejay lost the monitoring connection to your provider. |
|  BRIDGE\_DISCONNECTED | The audio bridge between Bluejay and your provider stopped. |

### Out of Funds

`INSUFFICIENT_BALANCE`: your balance reached zero. Add funds in **Settings** > **Billing**, then run the calls again.

### System Error

The problem is in Bluejay, not in your agent. Run the call again. If the error repeats, ask in the [Slack community](https://join.slack.com/t/bluejaycommunity/shared_invite/zt-442xk85k5-Qkbq65wVOxK~1FHU5OadEA).

| Code | Meaning |
| - | - |
| HYDRATION\_FAILED | Bluejay could not load the data to run the test. |
| EVAL\_HYDRATION\_FAILED | Bluejay could not load the data to score the call. |
| EVAL\_NO\_TRANSCRIPT | The transcript is missing or empty. |
| EVAL\_AUDIO\_CONVERSION\_FAILED | Bluejay could not convert the call audio. |
| EVAL\_PIPELINE\_FAILED | The scoring step failed. |
| EVAL\_QUEUE\_FAILED | Bluejay could not queue the call for scoring. |
| RECORDING\_URL\_FAILED | Bluejay could not make a link to the recording. |
| END\_SIGNAL\_TIMEOUT | The call did not stop when asked, so Bluejay ended it. |
| AGENT\_WORKER\_LOST | The Bluejay worker for the call stopped responding. |
| SIP\_TRUNK\_RECYCLED | A newer simulation reused the phone number, so Bluejay stopped this test. |
| DB\_WRITE\_FAILED | A Bluejay database write failed. |
| `UNKNOWN` | Bluejay has no specific code for the failure. |
| UNKNOWN\_LEGACY | The call ran before Bluejay recorded failure reasons. |

An email conversation can also show EMAIL\_SENDER\_MISMATCH without ending: your agent replied from an address that is not configured on it. The conversation stays open, and the code clears when a reply arrives from a configured address. Add the address to the agent's [reply-from addresses](/integrations/email.md#how-a-conversation-runs).

If the code is `EVAL_HYDRATION_FAILED`, `EVAL_PIPELINE_FAILED`, or `EVAL_QUEUE_FAILED`, you can retry only the scoring from the call panel.

### Cancelled

| Code | Meaning |
| - | - |
| USER\_CANCELLED | You cancelled the call, or ended it before anything was recorded. |
| STEP\_SKIPPED | In a Customer Journeys run, an earlier step ended as No Connection, No Answer, Call Dropped, Out of Funds, or System Error, so Bluejay cancelled this step. |

## Outbound trigger webhook

For an outbound agent, your system starts each conversation. When a run starts, Bluejay sends a POST to your **Outbound Trigger Webhook URL**, and your system then calls or messages the Digital Human.

By default, the body has `phone_number` and `sim_conversation_id`. To send other fields, set a body template with tokens such as `{{digital_human.phone_number}}`.

Return a `2xx` status from your webhook within 15 seconds. After 3 failed tries, the conversation ends with [`OUTBOUND_TRIGGER_FAILED`](#error-codes).

### Tokens and headers

Supported tokens include:

* `{{digital_human.id}}`
* `{{digital_human.name}}`
* `{{digital_human.phone_number}}`
* `{{digital_human.email}}`
* `{{digital_human.stable_email}}`
* `{{digital_human.intent}}`
* `{{sim_conversation_id}}`
* `{{simulation.id}}`
* `{{simulation.name}}`
* `{{agent.id}}`
* `{{agent.name}}`

Each request also has these headers:

* `X-Bluejay-Idempotency-Key` holds the conversation ID. Use it to ignore a repeated request.
* `X-Bluejay-Signature` holds the HMAC-SHA256 of the body, if the agent has a webhook signing key. [Verify it](/integrations/http-webhooks.md#verify-the-signature) before you place the call.

## Agent versions

An agent version is a numbered copy of the agent prompt. Save a new version before you change the prompt, so you can compare runs and go back.

Each new version gets the `latest` label. The first version also gets the `production` label, and it keeps it until you promote another version. A new simulation and a production evaluation use the `production` version unless you select another one.

## Workflow

A workflow is the multi-agent graph of a provider agent, for example a root agent that hands off to sub-agents. It comes from your provider. Use the **Workflow** tab of Agent Settings (**Squad** for a Vapi squad) to see and edit that graph, and to test each path through it with the [Workflow](/test/simulation-types/generate-from-workflow.md) simulation type.

**Pull** copies the graph from your provider into Bluejay. **Push** sends your Bluejay edits to the provider.

> [!WARNING]
>
> Push changes the agent in your provider account. If that version is live, real callers get the change. Pull replaces Bluejay edits that you did not push.

To import a graph from a document, attach the document in a **Bluejay AI** chat and ask for a workflow. After you approve the draft, Bluejay AI saves it to the agent. You can import only to an agent that has no workflow provider. An imported workflow has no provider to sync with, so it has no Pull or Push: to change it, edit it in Bluejay or import an updated document.

## Knowledge Bases

A Knowledge Base holds the facts your agent must know. Bluejay uses it to check that your agent states those facts correctly, and it can also generate Digital Humans that ask about them.

### Add documents

Connect a Knowledge Base to the agents that use it, and add the same files, text, and web pages your agent uses.

Bluejay uses a new document only after its status is **Ready**. If the status is **Failed**, add the document again.

![A Knowledge Base with URL, text, and PDF documents, all Ready](https://mintcdn.com/bluejay/eKcFBkjZX47pI8Ss/images/knowledge-base-documents.png?fit=max\&auto=format\&n=eKcFBkjZX47pI8Ss\&q=85\&s=7ff5b3547028adad406cc0ed415f0d9b)

### Supported file types

| Source | Supported types | Maximum size |
| - | - | - |
| File | PDF (`.pdf`) Text (`.txt`) Markdown (`.md`, `.markdown`) | 100 MB for each file |
| File | HTML (`.html`, `.htm`) | 10 MB for each file |
| Text | Typed or pasted text | 1 MB. For more, upload a file. |
| URL | One web page | None |

### How Bluejay uses a Knowledge Base

| Feature | Use |
| - | - |
| Success evaluation | When a success criterion depends on facts, the judge searches the Knowledge Bases of the agent. |
| Hallucination check | If you add the Hallucination metric from the **Library** tab on the **Metrics** page, Bluejay checks the agent's answers against its Knowledge Bases. |
| Custom metrics | If a metric has settings.use\_knowledge\_base set to `true`, the judge can search the Knowledge Base. |
| Simulations | The [Knowledge Base](/test/simulation-types/knowledge-base.md) simulation type makes Digital Humans across the topics in a Knowledge Base. |

## Related

* [Create a Simulation](/test/simulations/create.md)
* [Digital Human Reference](/test/simulations/digital-humans.md)
* [Simulation API](/api-reference/endpoint/create-simulation.md)


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