# Add the booking contact

> Makes a person the trip's booking contact (the one who books and pays; they need not travel), as the contact panel's Invite does: finds or creates their traveler account, makes them the booking's holder and stores the contact details you send.

`POST /v1/trips/{tripId}/contact`

Makes a person the trip's booking contact (the one who books and pays; they need not travel), as the contact panel's Invite does: finds or creates their traveler account, makes them the booking's holder and stores the contact details you send. If the trip is already `reservada` they are emailed their app access; otherwise they are told when it gets there. 409 `contact_exists` if the trip has a contact — change it with PATCH. Undo with DELETE /trips/{tripId}/contact.

**Permissions:** `travelers:write` · **Kind:** write · **Cost:** 1 unit · MCP tool [`add_trip_contact`](https://api.bymundi.com/docs/mcp/tools/add_trip_contact.md)

Undo with [Remove the booking contact](https://api.bymundi.com/docs/reference/travelers.contact.remove.md).

## Path parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `tripId` | uuid | yes |  |

## Body

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string \| null |  |  |
| `email` | email | yes | The contact's email — their app access goes here. max 200 chars |
| `phone` | string \| null |  |  |
| `address` | object \| null |  |  |
| `address.line1` | string \| null | yes |  |
| `address.line2` | string \| null | yes |  |
| `address.postalCode` | string \| null | yes |  |
| `address.city` | string \| null | yes |  |
| `address.region` | string \| null | yes |  |
| `address.country` | string \| null | yes |  |
| `docType` | "dni" \| "nie" \| "passport" \| "other" \| null |  |  |
| `docNumber` | string \| null |  |  |
| `docCountry` | string \| null |  |  |
| `taxId` | string \| null |  |  |

## Response `201`

| Field | Type | Required | Description |
|---|---|---|---|
| `object` | "trip_contact" | yes |  |
| `tripId` | uuid | yes |  |
| `name` | string \| null | yes |  |
| `email` | string \| null | yes |  |
| `phone` | string \| null | yes |  |
| `address` | object \| null | yes |  |
| `address.line1` | string \| null | yes |  |
| `address.line2` | string \| null | yes |  |
| `address.postalCode` | string \| null | yes |  |
| `address.city` | string \| null | yes |  |
| `address.region` | string \| null | yes |  |
| `address.country` | string \| null | yes |  |
| `docType` | "dni" \| "nie" \| "passport" \| "other" \| null | yes |  |
| `docNumber` | string \| null | yes |  |
| `docCountry` | string \| null | yes |  |
| `taxId` | string \| null | yes |  |
| `account` | object | yes |  |
| `account.userId` | uuid | yes |  |
| `account.email` | string \| null | yes |  |
| `account.name` | string \| null | yes |  |
| `access` | "invited" \| "queued" \| "failed" \| "no_email" \| "not_yet" \| null | yes |  |
| `accessOpenedAt` | string \| null | yes |  |

## Errors

Errors are [problem details](https://api.bymundi.com/docs/guides/errors.md). Besides the refusals described above, any call like this one can return:

- [`invalid_request`](https://api.bymundi.com/problems/invalid_request.md) — Invalid request
- [`unauthorized`](https://api.bymundi.com/problems/unauthorized.md) — Missing or invalid API key
- [`insufficient_scope`](https://api.bymundi.com/problems/insufficient_scope.md) — Missing permission
- [`rate_limited`](https://api.bymundi.com/problems/rate_limited.md) — Rate limit reached
- [`not_found`](https://api.bymundi.com/problems/not_found.md) — Not found
- [`idempotency_key_reused`](https://api.bymundi.com/problems/idempotency_key_reused.md) — Idempotency-Key reused
- [`request_in_progress`](https://api.bymundi.com/problems/request_in_progress.md) — Request in progress

## Examples

#### curl

```bash
curl -X POST https://api.bymundi.com/v1/trips/$TRIP_ID/contact \
  -H "Authorization: Bearer $BYMUNDI_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"email":"string"}'
```

#### JavaScript

```javascript
const res = await fetch(`https://api.bymundi.com/v1/trips/${tripId}/contact`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.BYMUNDI_KEY}`,
    "Content-Type": "application/json",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: JSON.stringify({"email":"string"}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();
```

#### Python

```python
import os, uuid, requests

res = requests.post(
    f"https://api.bymundi.com/v1/trips/{tripId}/contact",
    headers={"Authorization": f"Bearer {os.environ['BYMUNDI_KEY']}", "Idempotency-Key": str(uuid.uuid4())},
    json={"email":"string"},
)
res.raise_for_status()
data = res.json()
```
