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

# Inbound deployments

> Kupe App phone-number mappings become inbound deployments with availability windows.

Kupe App inbound was a **mapping row**: agent (or workflow) + `phone_number_id` + optional webhook URL.

Kupe inbound is a **deployment**: agent + telephony account + name + status + **availability window**. Calls outside the window are not connected. Requires `feature_inbound`. See [Inbound](https://docs.kupe.in/guides/inbound.md).

## Create

Kupe App `POST /api/v1/phone/mapping` body (`AgentPhoneMappingCreate`): `agent_id` **xor** `workflow_id`, `phone_number_id`, optional `webhook_url`, `config_source`, `user_id`.

Kupe Hub `POST /v1/inbound` requires `org_id`, `project_id`, `agent_id`, `telephony_account_id`, `name`. Optional `status` (`draft` | `active` | `paused`) and `availability`.

There is **no** `workflow_id`. Kupe App `POST /api/v1/phone/mapping/workflow` has no replacement.

```bash Kupe App theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST https://api.kupe.in/api/v1/phone/mapping \
  -H "x-api-key: YOUR_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "UUID",
    "phone_number_id": "UUID"
  }'
```

```bash Kupe Hub theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST https://x.kupe.in/v1/inbound \
  -H "Authorization: Bearer sk-kupe-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "org_id":"org_...","project_id":"prj_...",
    "agent_id":"agt_...","telephony_account_id":"tel_...",
    "name":"Collections DID","status":"active",
    "availability":{
      "always": false,
      "timezone": "Asia/Kolkata",
      "days_of_week": [1, 2, 3, 4, 5],
      "start": "09:00",
      "end": "18:00",
      "after_hours_message": "Call back during business hours."
    }
  }'
```

```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
from kupe import Kupe

client = Kupe()
me = client.me()
dep = client.inbound.create(
    org_id=me.org_id,
    project_id=me.project_id,
    agent_id="agt_...",
    telephony_account_id="tel_...",
    name="Collections DID",
    status="active",
    availability={"always": True, "timezone": "Asia/Kolkata"},
)
```

`availability.always: true` (default) ignores days and hours. `days_of_week` is `0=Sun … 6=Sat`. Kupe App mappings had **no** hours window — that is new.

## List / patch / delete

| Kupe App | Kupe Hub |
| - | - |
| `GET /api/v1/phone/mapping` | `GET /v1/orgs/{org_id}/projects/{project_id}/inbound` |
| `GET .../mapping/agent/{agent_id}` | List inbound and filter `agent_id` |
| `GET .../mapping/{phone_number_id}` | Match `telephony_account_id` / `from_number` on the deployment |
| `PUT .../mapping/{mapping_id}` | `PATCH /v1/inbound/{deployment_id}` |
| `DELETE .../mapping/{mapping_id}` | `DELETE /v1/inbound/{deployment_id}` |
| `GET /v1/inbound/{deployment_id}` | New |

Kupe-managed Plivo numbers get Answer / Hangup URLs attached on [purchase](https://docs.kupe.in/guides/phones.md). You do not pass `webhook_url` on the deployment.


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