Skip to Content
sesameSend

API Keys

Create and manage API Keys

Retrieve a list of API keys

GET /api-keys

Query parameters

NameTypeRequiredDescription
limitintegernoNumber of items to return.
afterstringnoReturn items after this cursor.
beforestringnoReturn items before this cursor.

Example

curl -X GET "$SESAMESEND_URL/api-keys" \
  -H "Authorization: Bearer $OPENSEND_API_KEY"

Responses

StatusDescription
200OK
{
  "object": "list",
  "has_more": false,
  "data": [
    {
      "id": "string",
      "name": "string",
      "created_at": "2023-10-06 23:47:56.678+00",
      "last_used_at": "2023-10-06 23:47:56.678+00"
    }
  ]
}

Create a new API key

POST /api-keys

Body

FieldTypeRequiredDescription
namestringyesThe API key name.
permission"full_access" | "sending_access"noThe API key can have full access to the sesameSend API or be only restricted to send emails. * full_access - Can create, delete, get, and update any resource. * sending_access - Can only send emails.
domain_idstringnoRestrict an API key to send emails only from a specific domain. Only used when the permission is sending_access.

Example

curl -X POST "$SESAMESEND_URL/api-keys" \
  -H "Authorization: Bearer $OPENSEND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string"
}'

Responses

StatusDescription
201OK
{
  "id": "string",
  "token": "string"
}

Update an existing API key

PATCH /api-keys/{api_key_id}

Path parameters

NameTypeRequiredDescription
api_key_idstringyesThe API key ID.

Body

FieldTypeRequiredDescription
namestringyesThe API key name.

Example

curl -X PATCH "$SESAMESEND_URL/api-keys/<api_key_id>" \
  -H "Authorization: Bearer $OPENSEND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string"
}'

Responses

StatusDescription
200OK
{
  "object": "api_key",
  "id": "string"
}

Remove an existing API key

DELETE /api-keys/{api_key_id}

Path parameters

NameTypeRequiredDescription
api_key_idstringyesThe API key ID.

Example

curl -X DELETE "$SESAMESEND_URL/api-keys/<api_key_id>" \
  -H "Authorization: Bearer $OPENSEND_API_KEY"

Responses

StatusDescription
200OK
{
  "object": "api_key",
  "id": "string",
  "deleted": true
}