Docs
Email ›

Enable sandbox email

PUT/v1/sandboxes/{id}/email

Turns mail on for the sandbox. From then on a message sent to any name at its domain is taken, kept, and told to the account's webhooks as email.received, whether the sandbox is running, stopped or archived. Each message taken is charged to the account. Asked again it changes nothing.

RequestTypeScript
  1. import { Agental } from "agental-sdk";
  2. const agental = new Agental();
  3. const sandbox = await agental.sandboxes.get("sbx_2a9a47e50daec64a");
  4. await sandbox.email.enable();
Answer200 OK · SandboxEmail
  1. {
  2. "enabled": boolean,
  3. "enabledAt": string | null,
  4. "domain": string | null,
  5. }

Mail is on.

Path

idrequired
string
e.g. "sbx_0123456789abcdef"

Headers

Authorizationrequired
Bearer key
An API key that may make this call.

Returns

200 Mail is on.

SandboxEmail3 fields
enabled
boolean
Whether mail is on for the sandbox.
More Off, nothing sent to it is taken and nothing is charged for it. It is off until PUT /v1/sandboxes/{id}/email turns it on.
enabledAt
stringnull
Since when it is on.
More Null while it is off.
domain
stringnull
What every address of the sandbox ends in.
More Any name before the @ reaches it, and the message says which was used. It is the sandbox's for as long as the sandbox is there and is never given to another. Null where no mail is offered: GET /v1/policy says so as email.

Errors and other answers

404 Not found.
501mail_not_configured this deployment offers no mail. GET /v1/policy says so as email.

Every error answers { "error": { "code", "message" } }; a key without the action a call needs answers 403 key_action_forbidden, naming it.