Safety

5 endpoints

GET/api/safety/modeauth required

Get the send mode for a surface

Send mode is layered org → project → use case. With `useCaseId` (or `projectSlug` + `useCaseSlug`) returns the use case's mode — its own, or its project's default when it follows it. With `projectSlug` or `projectId` alone returns the project default. With neither, returns the org default: the mode new projects start in. `orgScope=1` reports the org mode for surfaces that send without a use case.

Responses
200The mode a send from this surface would use, and where it comes from.
FieldTypeRequiredDescription
modestringrequired("test" | "production")
sourcestringrequired("use_case" | "project" | "org")
scopedbooleanrequired
orgDefaultstringrequired("test" | "production")
projectDefaultanyrequired
projectanyrequired
useCaseanyrequired
useCasesDifferingnumberoptional
require2faThresholdnumberrequired
testListMaxSizenumberrequired
401Unauthorized
500Internal server error
PUT/api/safety/modeauth required

Update a send mode

With `useCaseId`, sets that use case's own mode (`mode: null` makes it follow its project default). With `projectId`, sets the project default; `applyToUseCases` also makes every use case in the project follow it. With neither, sets the org default for new projects. Project and org writes need `safety.configure`; landing on production needs `send.production`.

Request Bodyrequired
FieldTypeRequiredDescription
modeanyrequired
useCaseIdstring (uuid)optional
projectIdstring (uuid)optional
applyToUseCasesbooleanoptional
Responses
200The mode the target now resolves to.
FieldTypeRequiredDescription
modestringrequired("test" | "production")
sourcestringrequired("use_case" | "project" | "org")
orgDefaultstringrequired("test" | "production")
projectDefaultstringoptional("test" | "production")
useCasesResetnumberoptional
400Invalid body: bad mode, both useCaseId and projectId, or null outside a use case
401Unauthorized
403Missing safety.configure (project/org) or send.production (going live)
404Use case or project not found in this organization
409Refused: the provider holds pending scheduled campaigns
500Internal server error
GET/api/safety/test-listsauth required

List test email lists

Returns all test email lists for the organization. Requires safety.configure permission.

Responses
200All test email lists.
FieldTypeRequiredDescription
listsobject[]required
401Unauthorized
500Internal server error
POST/api/safety/test-listsauth required

Create a test email list

Creates a new test email list with a name and optional email addresses. Requires safety.configure permission.

Request Bodyrequired
FieldTypeRequiredDescription
namestringrequired
emailsstring[]optional
Responses
201The newly created test list.
FieldTypeRequiredDescription
listobjectrequired
400Missing or invalid list name
401Unauthorized
500Internal server error
DELETE/api/safety/test-listsauth required

Delete a test email list

Deletes a test email list by ID. Requires safety.configure permission.

Parameters
NameInTypeRequiredDescription
idquerystringrequiredThe ID of the test list to delete.
Responses
200Deletion confirmed.
FieldTypeRequiredDescription
deletedbooleanrequired
400Missing list ID
401Unauthorized
500Internal server error