# POST /v1/deployments/interview

> Build a deployment by talking to Bash: describe the job, answer its questions, receive a draft version.

In [Deployments API](https://vestra.ai/developers/reference/api/deployments.md): How your Bash is set up, in versions: apply a whole vestra.yaml, promote, roll back, and the interview that drafts the file.

Send `Authorization: Bearer vk_test_...` on every call.

Build a deployment by talking to Bash: describe the job, answer its questions, receive a draft version.

Your API key, scope `setup` or `all`. On the card: [`init`](https://vestra.ai/developers/init.md). Every call here is a checked sample.

## Request

Headers:

- `Idempotency-Key` (`string`): Send the same key to retry this call safely for 24 hours.

Body:

- `name` (`string`, required): The name of the new deployment the interview makes, 1 to 120 characters. It is always new: a taken name gets a numbered slug, and a taken `slug` is refused with 409 `slug_taken`. Limits: 1 to 120 characters. Example: `Trip rescue`.
- `slug` (`string`): Its name in URLs and refs. Absent: made from `name`. Example: `trip-rescue`.
- `job` (`string`, required): What Bash should do for your users, in your own words, 20 to 4,000 characters. Bash asks what it needs, then drafts the file. Limits: 20 to 4000 characters. Example: `Help Tripnest travellers fix broken trips: rebook, refund, find a hotel.`.

## Answers 202

- `object` (`"deployment_interview"`): Always `deployment_interview`.
- `deployment` (`object`): The deployment the interview drafts.
  - `id` (`string`): The deployment's id. Example: `dep_8f2k`.
  - `object` (`"deployment"`): Always `deployment`.
  - `name` (`string`): Its name, as people read it.
  - `slug` (`string`): Its name in URLs and refs: send it where a route takes `{deployment_id}`. Example: `trip-rescue`.
  - `description` (`string`): What it is for; empty when none was given.
  - `base` (`"bash"`): What it is built on: always `bash`.
  - `status` (`"active" | "archived"`): `active`, or `archived` (put away: no new conversation or version reaches it).
  - `draft_version` (`integer`): The version test keys run. A new save moves it there; a promote with a test key moves it to the version named, older ones included.
  - `live_version` (`integer | null`): The version live keys run; null until one is promoted.
  - `created_at` (`string`): When it was made, as an ISO 8601 date and time in UTC.
  - `updated_at` (`string`): When it last changed, as an ISO 8601 date and time in UTC.
- `conversation_id` (`string`): The interview's conversation: follow its events for Bash's questions, and answer with POST /v1/conversations/{conversation_id}/messages.

## Code

**TypeScript**

```ts
const draft = vestra.init({ describe: 'Help Tripnest travellers fix broken trips.' });
await draft.started;
```

**Python**

```python
draft = vestra.init("Help Tripnest travellers fix broken trips.")
started = draft.started
```

**CLI**

```bash
vestra init "Help Tripnest travellers fix broken trips." --answers answers.txt
```

**HTTP**

```bash
# Describe the job. The interview runs as a conversation, so its questions arrive like any other reply.
curl "$VESTRA_BASE_URL/v1/deployments/interview" \
  -H "Authorization: Bearer $VESTRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Trip rescue", "slug": "trip-rescue", "job": "Help Tripnest travellers fix broken trips: cancellations, delays, missed connections. Look bookings up with get_booking." }'

# Answer its questions. Follow the conversation the response names, and reply in it.
curl -N "$VESTRA_BASE_URL/v1/conversations/conv_iv7/events" \
  -H "Authorization: Bearer $VESTRA_API_KEY"

curl "$VESTRA_BASE_URL/v1/conversations/conv_iv7/messages" \
  -H "Authorization: Bearer $VESTRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "message": "Ask first before paying a fare difference." }'

# Save the draft to your repo. When the interview ends, download the draft as vestra.yaml, starter tests
# included.
curl "$VESTRA_BASE_URL/v1/deployments/trip-rescue?format=yaml" \
  -H "Authorization: Bearer $VESTRA_API_KEY" \
  -o vestra.yaml

# Read the closing words. The draft version (the deployment's draft_version) has them in its interview field:
# what it set up, the tools your code must answer, the spending cap per task, the tests, and the next steps.
curl "$VESTRA_BASE_URL/v1/deployments/trip-rescue/versions/2" \
  -H "Authorization: Bearer $VESTRA_API_KEY"
```

**MCP**

```json
{
  "method": "tools/call",
  "params": {
    "name": "init",
    "arguments": {
      "describe": "Help Tripnest travellers fix broken trips: cancellations, delays, missed connections. Look bookings up with get_booking.",
      "for": "customers"
    }
  }
}
```
