Skip to content
AI Inbx
Esc
↑↓navigate↵open⌘Jpreview

Create a sandbox

Creates a sandbox workspace with no account and no members, and returns an API key for it with full scope; the secret is in api_key.key exactly once. Needs no credential. The workspace comes with its provided domain, <slug>.aiinbx.app, and runs every operation of the API except those that need a person or a live workspace. Give it a name and the slug follows it; without one it is named for you. To hand it to a person, create a claim link (POST /claim-links). Nobody claims it and it is deleted 14 days after its last API call. Limited to 10 an hour per IP address, an IPv6 /64 counting as one address: more fail with 429 too_many_requests and a Retry-After header. When the limit cannot be checked, the request fails with 503 unavailable and a Retry-After header.

POST/sandboxes
Request body
application/json
namestring

The workspace's name; its slug and provided domain follow it. Left out, a name is made up.

min length 1 · max length 120
Responses
201

The sandbox was created; save its key now.

workspaceobjectrequired

A workspace: the account that owns everything else.

Show properties
idstringrequired
namestringrequired
slugstringrequired

The handle in console URLs. It follows the name; the provided domain keeps the slug the workspace was created with.

rolestring | nullrequired

What the caller may do here: the role of the person a token acts for. Null for an API key, which acts with its creator's current rights: admin-only operations answer 403 once the creator is no longer an admin or has left. In a workspace nobody is a member of yet, made with POST /sandboxes, a key acts as its admin; once a person claims it, its keys become that person's and act with their rights, an owner's from the claim on.

Show properties
Any of:
string
string
null
null
trackingobjectrequired

What a domain added from now on starts with.

Show properties
opensbooleanrequired
clicksbooleanrequired
thread_across_addressesbooleanrequired

Whether an email without reply headers that arrives outside spaces can join any matching conversation outside spaces. Off, the default, it joins only a conversation the address it arrived at already took part in: sent in, received in, or was the Reply-To of. An email with reply headers always joins the conversation it answers. Turn it on when several of your addresses write to the same contacts in the same conversations.

sandboxbooleanrequired

Whether the workspace is a sandbox: the whole API, with no mail delivered, none arriving from outside and nothing billed. POST /workspace/go-live makes it live.

going_livebooleanrequired

Whether the workspace is going live right now. Until it is live it answers reads and refuses every change with 409 going_live.

inboxesobject[] | nullrequired

The inboxes the caller is held to here, when it was connected as an inbox: it reads their mail and sends as them, and nothing else. Null for a connection to the whole workspace, and for an API key.

Show properties
Any of:
object[]
Array of object
idstringrequired
matches ^[a-z]+_[0-9a-f]{32}$
addressstringrequired

The address it reads and sends as.

namestring | nullrequired

The name its mail goes out under, when one was given.

Show properties
Any of:
string
string
null
null
space_idstring | nullrequired

Which space a resource is in. Null is the workspace itself — what every resource of a workspace that has no spaces says.

Show properties
Any of:
string
string
null
null
null
null
created_atstring<date-time>required
matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
domainobject | nullrequired

Its provided domain, <slug>.aiinbx.app. Null when it could not be made at once; it is made shortly after.

Show properties
Any of:
object
idstringrequired
matches ^[a-z]+_[0-9a-f]{32}$
namestringrequired
regionstringrequired

Where the domain's mail is handled today. A domain carried over from the previous aiinbx reports us-east-1 until its records verify here, then the region chosen for it.

Allowed:eu-central-1us-east-1
space_idstring | nullrequired

Which space a resource is in. Null is the workspace itself — what every resource of a workspace that has no spaces says.

Show properties
Any of:
string
string
null
null
parent_idstring | nullrequired

The wildcard this subdomain is filed under, when it is one.

Show properties
Any of:
string
string
null
null
providedbooleanrequired

Whether this is the domain the workspace was given — <slug>.aiinbx.app. Verified through our own zone, so it has no records and cannot be deleted.

verified_atstring<date-time> | nullrequired
Show properties
Any of:
string<date-time>
string<date-time>
null
null
dkim_missing_sincestring<date-time> | nullrequired

When the DKIM record of this verified domain, or of its wildcard, was found missing from DNS. The domain keeps sending meanwhile. Null while the record resolves.

Show properties
Any of:
string<date-time>
string<date-time>
null
null
stops_sending_atstring<date-time> | nullrequired

When the domain is lost if the DKIM record is not restored: 72 hours after dkim_missing_since. Then verified_at goes null and domain.lost is sent.

Show properties
Any of:
string<date-time>
string<date-time>
null
null
created_atstring<date-time>required
matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
trackingobjectrequired
Show properties
opensbooleanrequired
clicksbooleanrequired
recordsobject[]
Show properties
Array of object
purposestringrequired
Allowed:SPFDKIMDMARCRETURN_PATHINBOUND
typestringrequired
Allowed:MXTXTCNAME
namestringrequired
valuestringrequired
ttlintegerrequired
min 0 · max 9007199254740991
statestringrequired
Allowed:pendingverifiedmissing
last_checked_atstring<date-time> | nullrequired
Show properties
Any of:
string<date-time>
string<date-time>
null
null
null
null
api_keyobjectrequired

A newly issued key. The full key is returned only once.

Show properties
idstringrequired
matches ^[a-z]+_[0-9a-f]{32}$
namestringrequired
scopestringrequired
Allowed:fullsendingread
prefixstringrequired
last_used_atstring<date-time> | nullrequired
Show properties
Any of:
string<date-time>
string<date-time>
null
null
created_atstring<date-time>required
matches ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
keystringrequired
400

The request is invalid.

typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
415

The request body is not JSON.

typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
422

The request body failed validation (invalid_request, with issues naming each field), or names something the request cannot use, such as an attachment or a recipient the workspace does not have; code says which.

typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
429

Too many requests were made recently.

typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
500

An internal error occurred.

typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
503

The service is temporarily unavailable.

typestringrequired
titlestringrequired
statusintegerrequired
min -9007199254740991 · max 9007199254740991
detailstringrequired
codestringrequired
request_idstringrequired
issuesobject[]
Show properties
Array of object
pathstringrequired
messagestringrequired
Request
import AIInbx from "aiinbx"

const aiinbx = new AIInbx()

const response = await aiinbx.sandboxes.create({ name: "Acme support agent" })
Response
{
  "workspace": {
    "id": "string",
    "name": "string",
    "slug": "string",
    "role": "owner",
    "tracking": {
      "opens": true,
      "clicks": true
    },
    "thread_across_addresses": true,
    "sandbox": true,
    "going_live": true,
    "inboxes": [
      {
        "id": "string",
        "address": "string",
        "name": "string",
        "space_id": "string"
      }
    ],
    "created_at": "2019-08-24T14:15:22Z"
  },
  "domain": {
    "id": "string",
    "name": "string",
    "region": "eu-central-1",
    "space_id": "string",
    "parent_id": "string",
    "provided": true,
    "verified_at": "2019-08-24T14:15:22Z",
    "dkim_missing_since": "2019-08-24T14:15:22Z",
    "stops_sending_at": "2019-08-24T14:15:22Z",
    "created_at": "2019-08-24T14:15:22Z",
    "tracking": {
      "opens": true,
      "clicks": true
    },
    "records": [
      {
        "purpose": "SPF",
        "type": "MX",
        "name": "string",
        "value": "string",
        "ttl": 0,
        "state": "pending",
        "last_checked_at": "2019-08-24T14:15:22Z"
      }
    ]
  },
  "api_key": {
    "id": "string",
    "name": "string",
    "scope": "full",
    "prefix": "string",
    "last_used_at": "2019-08-24T14:15:22Z",
    "created_at": "2019-08-24T14:15:22Z",
    "key": "string"
  }
}