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

# Demo requests

> Answer a rep's demo environment request with the demo your app built.

A rep's **Prep demo**, in **Calls → Prep a demo**, sends the [`demo.requested`](https://docs.custral.com/dev/webhooks/events/demo-requested) webhook to your app. These two routes are how your app answers. Both need an API key of the same workspace with the **`demos:manage`** scope, and both find the request inside that key's workspace only.

## Retrieve a request

`GET /v1/demo-requests/{id}` returns where one request stands.

```bash theme={null}
curl "https://api.custral.com/v1/demo-requests/dreq_3Ab9xK2mQ7" \
  -H "Authorization: Bearer $CUSTRAL_API_KEY"
```

```json Demo request theme={null}
{
  "id": "dreq_3Ab9xK2mQ7",
  "revision": 2,
  "status": "ready",
  "url": "https://demo.acme.example/s/one-time-sign-in-token",
  "message": null,
  "requestedAt": "2026-12-01T10:00:00.000Z",
  "answeredAt": "2026-12-01T10:01:12.000Z"
}
```

`status` is `waiting` until your app answers, then `ready` or `failed`.

## Send back the demo

`POST /v1/demo-requests/{id}/environment` with `{status: "ready", url}` once the demo is built, or `{status: "failed", message}` when it can't be. `url` must be `https://`. Answering again replaces the earlier answer.

```bash theme={null}
curl -X POST "https://api.custral.com/v1/demo-requests/dreq_3Ab9xK2mQ7/environment" \
  -H "Authorization: Bearer $CUSTRAL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status": "ready", "url": "https://demo.acme.example/s/one-time-sign-in-token"}'
```

In the SDK: `custral.demoRequests.retrieve(id)` and `custral.demoRequests.setEnvironment(id, params)`. Over MCP: `get_demo_request` and `set_demo_environment`.

| Error | When |
| - | - |
| `demo_request_not_found` | No request with that id in the key's workspace |
| `demo_environment_url_invalid` | `status` is `ready` and `url` is missing or not `https://` |
| `insufficient_scope` | The key lacks `demos:manage` |


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