Inbox
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
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
apiKeyAuthorizationBearer <token>An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.
Path Parameters
ref*stringThe SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.
1 <= lengthQuery Parameters
project?stringThe project id or name, default when omitted; an unknown project answers 404 project_not_found.
Response Body
The inbox of one SVM.
application/json- response
The inbox of one SVM.
address*stringThe 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*booleanWhether 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.
curl -X GET 'https://api.slashinfra.com/svms/build-1/inbox'{ "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
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
apiKeyAuthorizationBearer <token>An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.
Path Parameters
ref*stringThe SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.
1 <= lengthQuery Parameters
project?stringThe project id or name, default when omitted; an unknown project answers 404 project_not_found.
Request Body
- 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*booleanWhether 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- response
The inbox of one SVM, with a webhook secret when one was set or rotated.
address*stringThe 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*booleanWhether 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?stringThe 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.
curl -X PUT 'https://api.slashinfra.com/svms/build-1/inbox' \ -H 'Content-Type: application/json' \ -d '{ "enabled": true}'{ "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
Removes the webhook, the bot token and its injection rule; the SVM keeps its other inbox settings and its messages.
Authorization
apiKeyAuthorizationBearer <token>An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.
Path Parameters
ref*stringThe SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.
1 <= lengthQuery Parameters
project?stringThe 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/plainThe bot is disconnected, with no body.
curl -X DELETE 'https://api.slashinfra.com/svms/build-1/inbox/telegram'"string"Connect a Telegram bot to the inbox of an SVM
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
apiKeyAuthorizationBearer <token>An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.
Path Parameters
ref*stringThe SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.
1 <= lengthQuery Parameters
project?stringThe project id or name, default when omitted; an unknown project answers 404 project_not_found.
Request Body
- body
bot_token*stringThe 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- response
The connected bot and the pairing code that a user sends to it.
bot_username*stringThe username of the bot.
pair_code*stringThe single-use pairing code: the user sends /start <pair_code> to the bot within ten minutes.
curl -X PUT 'https://api.slashinfra.com/svms/build-1/inbox/telegram' \ -H 'Content-Type: application/json' \ -d '{ "bot_token": "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"}'{ "bot_username": "build_1_bot", "pair_code": "k3m9q2x7"}Make a new Telegram pairing code
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
apiKeyAuthorizationBearer <token>An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.
Path Parameters
ref*stringThe SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.
1 <= lengthQuery Parameters
project?stringThe 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- response
A new pairing code and its expiry.
expires_ms*integerWhen the code expires, in milliseconds since the Unix epoch.
pair_code*stringThe new single-use code.
curl -X POST 'https://api.slashinfra.com/svms/build-1/inbox/telegram/pair'{ "expires_ms": 1767229200000, "pair_code": "k3m9q2x7"}Set the Telegram users who may send to the inbox
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
apiKeyAuthorizationBearer <token>An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.
Path Parameters
ref*stringThe SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.
1 <= lengthQuery Parameters
project?stringThe project id or name, default when omitted; an unknown project answers 404 project_not_found.
Request Body
- 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- 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*booleanWhether 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.
curl -X PUT 'https://api.slashinfra.com/svms/build-1/inbox/telegram/users' \ -H 'Content-Type: application/json' \ -d '{ "allowed_users": [ "123456789" ]}'{ "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
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
apiKeyAuthorizationBearer <token>An API key (si_ and 43 base64url characters), sent as Authorization: Bearer si_...; see Using the API.
Path Parameters
ref*stringThe SVM id, or its name in the organization of the key: ten symbols of 0123456789abcdefghjkmnpqrstvwxyz is an id, any other reference is a name.
1 <= lengthQuery Parameters
project?stringThe 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- response
The inbox of one SVM, with a webhook secret when one was set or rotated.
address*stringThe 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*booleanWhether 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?stringThe 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.
curl -X POST 'https://api.slashinfra.com/svms/build-1/inbox/webhook/rotate'{ "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"}curl -X GET 'https://api.slashinfra.com/svms/build-1/inbox'{
"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"
}curl -X PUT 'https://api.slashinfra.com/svms/build-1/inbox' \
-H 'Content-Type: application/json' \
-d '{
"enabled": true
}'{
"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"
}curl -X DELETE 'https://api.slashinfra.com/svms/build-1/inbox/telegram'"string"curl -X PUT 'https://api.slashinfra.com/svms/build-1/inbox/telegram' \
-H 'Content-Type: application/json' \
-d '{
"bot_token": "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"
}'{
"bot_username": "build_1_bot",
"pair_code": "k3m9q2x7"
}curl -X POST 'https://api.slashinfra.com/svms/build-1/inbox/telegram/pair'{
"expires_ms": 1767229200000,
"pair_code": "k3m9q2x7"
}curl -X PUT 'https://api.slashinfra.com/svms/build-1/inbox/telegram/users' \
-H 'Content-Type: application/json' \
-d '{
"allowed_users": [
"123456789"
]
}'{
"allowed_users": [
"123456789"
],
"bot_username": "build_1_bot",
"connected": true,
"pair_code": "k3m9q2x7",
"pair_expires_ms": 1767229200000
}curl -X POST 'https://api.slashinfra.com/svms/build-1/inbox/webhook/rotate'{
"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"
}