Skip to content
This site documents the main branch, which may hold changes not yet released. Latest release: v0.3.0 (changelog).

Create a workspace and its connections

POST
/admin/workspaces
curl --request POST \
--url http://localhost:3000/admin/workspaces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "slug": "example", "description": "example", "ephemeral": false, "idleTtlSeconds": 1, "retention": 1, "maxMessages": 1, "rateLimit": { "limit": 1, "windowSeconds": 1, "burst": 1 }, "simulation": { "rates": { "delivered": 100 }, "rules": [], "latency": { "minMs": 0, "maxMs": 0 }, "openRate": 0, "clickRate": 0 }, "metadata": { "additionalProperty": "example" }, "connections": [ { "kind": "resend", "name": "example", "retention": 1, "rateLimit": { "limit": 1, "windowSeconds": 1, "burst": 1 }, "simulation": { "rates": { "additionalProperty": 1 }, "rules": [ { "match": "example", "status": "delivered", "delayMs": 1, "smtpCode": 1 } ], "latency": { "minMs": 1, "maxMs": 1 }, "openRate": 1, "clickRate": 1 } } ], "templates": [ { "externalId": 1, "name": "example", "subject": "example", "html": "example", "text": "example", "sender": { "email": "example", "name": "example" } } ] }'

Secrets (connection keys, SMTP passwords, workspace key) are answered once.

Media typeapplication/json
object
name
required
string
>= 1 characters <= 80 characters
slug
string
/^[a-z0-9][a-z0-9-]{1,62}$/
description
string
<= 500 characters
ephemeral
boolean
idleTtlSeconds
integer
>= 60 <= 2592000
retention
number | string
maxMessages
integer
> 0 <= 9007199254740991
rateLimit
Any of:
object
limit
required
integer
> 0 <= 9007199254740991
windowSeconds
integer
default: 1 > 0 <= 9007199254740991
burst
integer
> 0 <= 9007199254740991
simulation
object
rates
object
key
additional properties
number
<= 100
rules
Array<object>
default: <= 50 items
object
match
required
string
>= 1 characters
status
string
Allowed values: delivered deferred soft_bounce hard_bounce complained failed invalid
delayMs
integer
<= 600000
smtpCode
integer
>= 400 <= 599
latency
object
minMs
required
integer
<= 600000
maxMs
required
integer
<= 600000
openRate
number
0 <= 100
clickRate
number
0 <= 100
metadata
object
key
additional properties
string
<= 256 characters
connections
Array<object>
<= 20 items
One of:
object
kind
required
string
Allowed value: resend
name
required
string
>= 1 characters <= 80 characters
retention
number | string
rateLimit
Any of:
object
limit
required
integer
> 0 <= 9007199254740991
windowSeconds
integer
default: 1 > 0 <= 9007199254740991
burst
integer
> 0 <= 9007199254740991
simulation
object
rates
object
key
additional properties
number
<= 100
rules
Array<object>
<= 50 items
object
match
required
string
>= 1 characters
status
string
Allowed values: delivered deferred soft_bounce hard_bounce complained failed invalid
delayMs
integer
<= 600000
smtpCode
integer
>= 400 <= 599
latency
object
minMs
required
integer
<= 600000
maxMs
required
integer
<= 600000
openRate
number
<= 100
clickRate
number
<= 100
templates
Array<object>
<= 500 items
object
externalId
integer
> 0 <= 2147483647
name
required
string
>= 1 characters <= 200 characters
subject
required
string
<= 998 characters
html
Any of:
string
<= 1000000 characters
text
Any of:
string
<= 1000000 characters
sender
Any of:
Any of:
string

Created.

Media typeapplication/json
object
workspace
required
object
id
required
string
/^ws_[A-Za-z0-9-]{1,64}$/
slug
required
string
/^[a-z0-9][a-z0-9-]{1,62}$/
name
required
string
description
required
string | null
ephemeral
required
boolean
idleTtlSeconds
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
expiresAt
required
Any of:
string format: date-time
/^(?:(?:\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|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/
lastActivityAt
required
string format: date-time
/^(?:(?:\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|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/
retentionSeconds
required
integer
>= -9007199254740991 <= 9007199254740991
maxMessages
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
rateLimit
required
Any of:
object
limit
required
integer
> 0 <= 9007199254740991
windowSeconds
required
integer
default: 1 > 0 <= 9007199254740991
burst
integer
> 0 <= 9007199254740991
simulation
required
object
rates
required
object
key
additional properties
number
<= 100
rules
required
Array<object>
default: <= 50 items
object
match
required
string
>= 1 characters
status
string
Allowed values: delivered deferred soft_bounce hard_bounce complained failed invalid
delayMs
integer
<= 600000
smtpCode
integer
>= 400 <= 599
latency
required
object
minMs
required
integer
<= 600000
maxMs
required
integer
<= 600000
openRate
required
number
0 <= 100
clickRate
required
number
0 <= 100
metadata
required
Any of:
object
key
additional properties
string
urls
required
object
ui
required
string
capture
required
string
mcp
required
string
createdAt
required
string format: date-time
/^(?:(?:\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|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/
workspaceKey
required
string
/^mskw_[A-Za-z0-9_-]{16,128}$/
connections
required
Array<object>
object
id
required
string
/^con_[A-Za-z0-9-]{1,64}$/
name
required
string
kind
required
string
Allowed values: resend brevo smtp
smtpUsername
required
string | null
keyPreview
required
string | null
retentionSeconds
required
Any of:
integer
>= -9007199254740991 <= 9007199254740991
rateLimit
required
Any of:
object
limit
required
integer
> 0 <= 9007199254740991
windowSeconds
required
integer
default: 1 > 0 <= 9007199254740991
burst
integer
> 0 <= 9007199254740991
simulation
required
Any of:
object
rates
object
key
additional properties
number
<= 100
rules
Array<object>
<= 50 items
object
match
required
string
>= 1 characters
status
string
Allowed values: delivered deferred soft_bounce hard_bounce complained failed invalid
delayMs
integer
<= 600000
smtpCode
integer
>= 400 <= 599
latency
object
minMs
required
integer
<= 600000
maxMs
required
integer
<= 600000
openRate
number
<= 100
clickRate
number
<= 100
disabledAt
required
Any of:
string format: date-time
/^(?:(?:\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|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/
createdAt
required
string format: date-time
/^(?:(?:\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|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$/
credentials
required
One of:
object
kind
required
string
Allowed value: resend
apiKey
required
string
/^msk_[A-Za-z0-9_-]{16,128}$/
baseUrl
required
string
envSnippet
required
string

Example

{
"workspace": {
"rateLimit": {
"windowSeconds": 1
},
"simulation": {
"rates": {
"delivered": 100
},
"rules": [],
"latency": {
"minMs": 0,
"maxMs": 0
},
"openRate": 0,
"clickRate": 0
}
},
"connections": [
{
"kind": "resend",
"rateLimit": {
"windowSeconds": 1
},
"simulation": {
"rules": [
{
"status": "delivered"
}
]
},
"credentials": {
"kind": "resend"
}
}
]
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

Error: validation_error

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

Error: unauthorized

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

WWW-Authenticate
required

Sent with every 401.

string
Allowed value: Bearer

Sent with every 401.

Error: forbidden

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

Error: conflict

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

Error: payload_too_large

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

Error: validation_error

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.

Error: internal_error

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: unauthorized forbidden validation_error not_found conflict idempotency_mismatch rate_limited payload_too_large chaos_injected wait_timeout internal_error
message
required
string
details
requestId
required
string

Example

{
"error": {
"code": "unauthorized"
}
}
X-Request-Id
required

Id of the request (req_…), also the id of its request log row.

string

Id of the request (req_…), also the id of its request log row.