Safety

5 endpoints

GET/api/safety/modeauth required

Get current send mode

Returns the current send mode settings (test or production) for the authenticated user's organization.

Responses
200Current send mode settings.
FieldTypeRequiredDescription
modestringrequired("test" | "production")
require2faThresholdnumberrequired
testListMaxSizenumberrequired
401Unauthorized
500Internal server error
PUT/api/safety/modeauth required

Update send mode

Switches the organization's send mode between test and production. Switching to production requires the admin role.

Request Bodyrequired
FieldTypeRequiredDescription
modestringrequired("test" | "production")
Responses
200Updated send mode settings.
FieldTypeRequiredDescription
modestringrequired("test" | "production")
require2faThresholdnumberrequired
testListMaxSizenumberrequired
400Invalid mode or malformed request body
401Unauthorized
403Only admins can enable production mode
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