---
title: "Create a connection"
method: POST
path: "/v1/connections"
tags: ["Connections"]
---

# Create a connection

`POST /v1/connections`

## Request

- Base URL: `https://www.chatrail.dev`
- URL: `https://www.chatrail.dev/v1/connections`
- Auth: HTTP bearer

Returns `callback_token` **exactly once**. It cannot be retrieved again; store it when you receive it. On the Team plan, add `proxy` to link this number through its own HTTP proxy instead of ChatRail's address: `server` is an IP address and port (not a hostname, and a public address), with an optional `username` and `password` that are stored encrypted and never returned. Use a fixed address, ideally in the same country as the number.

## Request body

- object
  - `slug` string, required
  - `name` string
  - `proxy` object
    - `server` string, required

## Response `201`

Created, with the one-time callback token.

## Other responses

- `400`: The request is not valid, such as a proxy that is a hostname or a private address.
- `402`: The plan has no room for another number, or does not include proxies.
- `409`: That slug is taken.
- `422`: The WhatsApp engine cannot use a proxy.

---

[API](https://skmtc.dev/chatrail/apis/chatrail-api.md) · [All operations](https://skmtc.dev/chatrail/apis/chatrail-api/llms.txt) · [OpenAPI document](https://skmtc.dev/chatrail/apis/chatrail-api/revisions/acc5b88c6f59?raw)
