API Keys
Create and manage API Keys
Retrieve a list of API keys
GET /api-keys
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Number of items to return. |
after | string | no | Return items after this cursor. |
before | string | no | Return items before this cursor. |
Example
curl -X GET "$SESAMESEND_URL/api-keys" \
-H "Authorization: Bearer $OPENSEND_API_KEY"Responses
| Status | Description |
|---|---|
200 | OK |
{
"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
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | The API key name. |
permission | "full_access" | "sending_access" | no | The 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_id | string | no | Restrict 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
| Status | Description |
|---|---|
201 | OK |
{
"id": "string",
"token": "string"
}Update an existing API key
PATCH /api-keys/{api_key_id}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
api_key_id | string | yes | The API key ID. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | The 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
| Status | Description |
|---|---|
200 | OK |
{
"object": "api_key",
"id": "string"
}Remove an existing API key
DELETE /api-keys/{api_key_id}
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
api_key_id | string | yes | The API key ID. |
Example
curl -X DELETE "$SESAMESEND_URL/api-keys/<api_key_id>" \
-H "Authorization: Bearer $OPENSEND_API_KEY"Responses
| Status | Description |
|---|---|
200 | OK |
{
"object": "api_key",
"id": "string",
"deleted": true
}