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

Add a connection (secrets answered once)

POST
/admin/workspaces/{id}/connections
curl --request POST \
--url http://localhost:3000/admin/workspaces/example/connections \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "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 } }'
id
required

Workspace id (ws_…) or slug.

Any of:
string
/^ws_[A-Za-z0-9-]{1,64}$/

Workspace id (ws_…) or slug.

Media typeapplication/json
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

Created.

Media typeapplication/json
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

{
"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: not_found

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.