Skip to content

The email inbox of an SVM, its webhook and its Telegram bot

Resource, request and plan limits are listed on Limits.

Download OpenAPI specification · Version 0.1.0

Show the inbox of an SVM

GET
/svms/{ref}/inbox

Returns whether the inbox accepts mail, its address, sender rule and webhook; the inbox is off by default and rejects mail at SMTP until it is on.

Authorization

apiKey
headerAuthorizationBearer <token>

An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.

Path Parameters

ref*string

The SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.

Length1 <= length

Query Parameters

project?string

The project id or name, default when omitted; an unknown project answers 404 project_not_found.

Response Body

The inbox of one SVM.

application/json
  1. response

The inbox of one SVM.

address*string

The address of the inbox: <SVM id>@<SVM domain>; a +tag after the id is accepted and stored with the message.

allowed_senders*array<>|

The sender rule: null accepts every sender, [] accepts none, and a list accepts exactly those SMTP envelope addresses, trimmed and lowercased, with no domain wildcards.

enabled*boolean

Whether the inbox accepts mail; an inbox that is off rejects mail at SMTP and wakes nothing.

telegram*

The Telegram bot of an SVM; its token lives in the vault and is never part of an answer.

webhook_url*|

The HTTPS URL that receives a signed POST per message.

Example Request
curl -X GET 'https://api.slashinfra.com/svms/build-1/inbox'
Example Response
{  "address": "6f1c0f0e8a@slashinfra.dev",  "allowed_senders": [    "ada@example.com"  ],  "enabled": true,  "telegram": {    "allowed_users": [      "123456789"    ],    "bot_username": "build_1_bot",    "connected": true,    "pair_code": "k3m9q2x7",    "pair_expires_ms": 1767229200000  },  "webhook_url": "https://example.com/slashinfra"}

Enable or disable the inbox of an SVM, and set its webhook and sender rule

PUT
/svms/{ref}/inbox

Turns the inbox on or off, sets or removes the webhook and sets the sender rule; a new or changed webhook URL returns a new secret once, and disabling keeps the webhook and rule. Turning it on needs a plan with inbox_allowed, and the sender rule applies to new mail only; see email.

Authorization

apiKey
headerAuthorizationBearer <token>

An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.

Path Parameters

ref*string

The SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.

Length1 <= length

Query Parameters

project?string

The project id or name, default when omitted; an unknown project answers 404 project_not_found.

Request Body

  1. body
allowed_senders?array<>|

The sender rule: null accepts every sender, [] accepts none, and a list accepts exactly those SMTP envelope addresses; omit it to keep the current rule.

enabled*boolean

Whether the inbox accepts mail; turning it on needs a plan with inbox_allowed.

webhook_url?|

The HTTPS URL of the webhook.

Response Body

The inbox of one SVM, with a webhook secret when one was set or rotated.

application/json
  1. response

The inbox of one SVM, with a webhook secret when one was set or rotated.

address*string

The address of the inbox: <SVM id>@<SVM domain>; a +tag after the id is accepted and stored with the message.

allowed_senders*array<>|

The sender rule: null accepts every sender, [] accepts none, and a list accepts exactly those SMTP envelope addresses, trimmed and lowercased, with no domain wildcards.

enabled*boolean

Whether the inbox accepts mail; an inbox that is off rejects mail at SMTP and wakes nothing.

telegram*

The Telegram bot of an SVM; its token lives in the vault and is never part of an answer.

webhook_secret?string

The new webhook secret, shown once; it signs X-Slashinfra-Signature on every webhook POST.

webhook_url*|

The HTTPS URL that receives a signed POST per message.

Example Request
curl -X PUT 'https://api.slashinfra.com/svms/build-1/inbox' \  -H 'Content-Type: application/json' \  -d '{  "enabled": true}'
Example Response
{  "address": "6f1c0f0e8a@slashinfra.dev",  "allowed_senders": [    "ada@example.com"  ],  "enabled": true,  "telegram": {    "allowed_users": [      "123456789"    ],    "bot_username": "build_1_bot",    "connected": true,    "pair_code": "k3m9q2x7",    "pair_expires_ms": 1767229200000  },  "webhook_secret": "whsec_4Qm8nT2vX7kL9pR1sW6yB3cF5hJ0aD8eG2iK4mN6oP",  "webhook_url": "https://example.com/slashinfra"}

Disconnect the Telegram bot of an SVM

DELETE
/svms/{ref}/inbox/telegram

Removes the webhook, the bot token and its injection rule; the SVM keeps its other inbox settings and its messages.

Authorization

apiKey
headerAuthorizationBearer <token>

An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.

Path Parameters

ref*string

The SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.

Length1 <= length

Query Parameters

project?string

The project id or name, default when omitted; an unknown project answers 404 project_not_found.

Response Body

The bot is disconnected, with no body.

response?stringtext/plain

The bot is disconnected, with no body.

Example Request
curl -X DELETE 'https://api.slashinfra.com/svms/build-1/inbox/telegram'
Example Response
"string"

Connect a Telegram bot to the inbox of an SVM

PUT
/svms/{ref}/inbox/telegram

Checks the bot token with getMe, stores it in the vault as an internal secret that secrets does not list, and registers the webhook and the injection rule to api.telegram.org. The user then pairs with the returned code; the inbox must be enabled and the plan must allow inboxes.

Authorization

apiKey
headerAuthorizationBearer <token>

An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.

Path Parameters

ref*string

The SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.

Length1 <= length

Query Parameters

project?string

The project id or name, default when omitted; an unknown project answers 404 project_not_found.

Request Body

  1. body
bot_token*string

The bot token from BotFather, checked with getMe and then stored in the vault; answers never include it.

Response Body

The connected bot and the pairing code that a user sends to it.

application/json
  1. response

The connected bot and the pairing code that a user sends to it.

bot_username*string

The username of the bot.

pair_code*string

The single-use pairing code: the user sends /start <pair_code> to the bot within ten minutes.

Example Request
curl -X PUT 'https://api.slashinfra.com/svms/build-1/inbox/telegram' \  -H 'Content-Type: application/json' \  -d '{  "bot_token": "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"}'
Example Response
{  "bot_username": "build_1_bot",  "pair_code": "k3m9q2x7"}

Make a new Telegram pairing code

POST
/svms/{ref}/inbox/telegram/pair

Replaces the live pairing code with a new single-use one, valid for ten minutes. A user sends /start <pair_code> to the bot, joins the allowed users and gets paired as the answer.

Authorization

apiKey
headerAuthorizationBearer <token>

An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.

Path Parameters

ref*string

The SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.

Length1 <= length

Query Parameters

project?string

The project id or name, default when omitted; an unknown project answers 404 project_not_found.

Response Body

A new pairing code and its expiry.

application/json
  1. response

A new pairing code and its expiry.

expires_ms*integer

When the code expires, in milliseconds since the Unix epoch.

pair_code*string

The new single-use code.

Example Request
curl -X POST 'https://api.slashinfra.com/svms/build-1/inbox/telegram/pair'
Example Response
{  "expires_ms": 1767229200000,  "pair_code": "k3m9q2x7"}

Set the Telegram users who may send to the inbox

PUT
/svms/{ref}/inbox/telegram/users

Replaces the list of numeric Telegram user ids whose messages reach the inbox. An empty list accepts none; a paired user is added by /start <pair_code>.

Authorization

apiKey
headerAuthorizationBearer <token>

An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.

Path Parameters

ref*string

The SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.

Length1 <= length

Query Parameters

project?string

The project id or name, default when omitted; an unknown project answers 404 project_not_found.

Request Body

  1. body
allowed_users*array<>

Response Body

The Telegram bot of an SVM; its token lives in the vault and is never part of an answer.

application/json
  1. response

The Telegram bot of an SVM; its token lives in the vault and is never part of an answer.

allowed_users*array<>

The numeric Telegram user ids whose messages reach the inbox; it is empty until the first pair.

bot_username*|

The username of the bot.

connected*boolean

Whether a Telegram bot is connected.

pair_code*|

The single-use pairing code, valid for ten minutes.

pair_expires_ms*|

When the pairing code expires, in milliseconds since the Unix epoch.

Example Request
curl -X PUT 'https://api.slashinfra.com/svms/build-1/inbox/telegram/users' \  -H 'Content-Type: application/json' \  -d '{  "allowed_users": [    "123456789"  ]}'
Example Response
{  "allowed_users": [    "123456789"  ],  "bot_username": "build_1_bot",  "connected": true,  "pair_code": "k3m9q2x7",  "pair_expires_ms": 1767229200000}

Rotate the webhook secret of an SVM inbox

POST
/svms/{ref}/inbox/webhook/rotate

Makes a new secret, returned once, and the old secret stops verifying X-Slashinfra-Signature on every later POST; a webhook must be set first.

Authorization

apiKey
headerAuthorizationBearer <token>

An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.

Path Parameters

ref*string

The SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.

Length1 <= length

Query Parameters

project?string

The project id or name, default when omitted; an unknown project answers 404 project_not_found.

Response Body

The inbox of one SVM, with a webhook secret when one was set or rotated.

application/json
  1. response

The inbox of one SVM, with a webhook secret when one was set or rotated.

address*string

The address of the inbox: <SVM id>@<SVM domain>; a +tag after the id is accepted and stored with the message.

allowed_senders*array<>|

The sender rule: null accepts every sender, [] accepts none, and a list accepts exactly those SMTP envelope addresses, trimmed and lowercased, with no domain wildcards.

enabled*boolean

Whether the inbox accepts mail; an inbox that is off rejects mail at SMTP and wakes nothing.

telegram*

The Telegram bot of an SVM; its token lives in the vault and is never part of an answer.

webhook_secret?string

The new webhook secret, shown once; it signs X-Slashinfra-Signature on every webhook POST.

webhook_url*|

The HTTPS URL that receives a signed POST per message.

Example Request
curl -X POST 'https://api.slashinfra.com/svms/build-1/inbox/webhook/rotate'
Example Response
{  "address": "6f1c0f0e8a@slashinfra.dev",  "allowed_senders": [    "ada@example.com"  ],  "enabled": true,  "telegram": {    "allowed_users": [      "123456789"    ],    "bot_username": "build_1_bot",    "connected": true,    "pair_code": "k3m9q2x7",    "pair_expires_ms": 1767229200000  },  "webhook_secret": "whsec_4Qm8nT2vX7kL9pR1sW6yB3cF5hJ0aD8eG2iK4mN6oP",  "webhook_url": "https://example.com/slashinfra"}