---
title: "Create a destination"
method: POST
path: "/v1/destinations"
tags: ["destinations"]
---

# Create a destination

`POST /v1/destinations`

## Request

- Base URL: `https://postbag.dev`
- URL: `https://postbag.dev/v1/destinations`
- Auth: HTTP bearer

type is one of email, telegram, webhook, slack, discord; config shape depends on type. Call destinations_test after creating to verify it works.

## Request body

- union
  - object
    - `type` 'email', required
    - `name` string
    - `config` object, required
      - `to` string[], required
      - `cc` string[]
      - `subject_template` string
      - `from_name` string
  - object
    - `type` 'telegram', required
    - `name` string
    - `config` object, required
      - `bot_token` string, required
      - `chat_id` string, required
      - `template` string
  - object
    - `type` 'webhook', required
    - `name` string
    - `config` object, required
      - `url` string, uri, required
      - `secret` string
      - `headers` object
  - object
    - `type` 'slack', required
    - `name` string
    - `config` object, required
      - `url` string, uri, required
      - `template` string
  - object
    - `type` 'discord', required
    - `name` string
    - `config` object, required
      - `url` string, uri, required
      - `template` string

## Response `201`

created

- Destination
  - `id` string, required
  - `type` 'email' | 'telegram' | 'webhook' | 'slack' | 'discord', required
  - `name` string, required
  - `config` object, required
  - `health` 'unknown' | 'ok' | 'failing', required
  - `verified` boolean, required
  - `created_at` string, required

## Other responses

- `400`: Error
- `401`: Error
- `403`: Error
- `404`: Not found
- `409`: Error
- `422`: Error

---

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