Create API Key
Generate a new API key for authentication.
POST
/api-keysRequest Body
namestringRequiredThe name of the API key for identification.
scopestringThe scope of the API key. Can be ‘full’ or ‘sending’ (default: ‘full’).
sending_domain_idintegerThe ID of the sending domain to restrict this key to (default: null).
{
"object": "api_key",
"id": 1234567890,
"name": "My API Key",
"scope": "sending",
"sending_domain_id": 1234567890,
"last_used_at": null,
"created_at": "2021-01-01T00:00:00Z",
"updated_at": "2021-01-01T00:00:00Z",
"key": "em_live_51RxCWJ...vS00p61e0qRE"
} {
"error": {
"code": 400,
"message": "Bad Request"
}
} {
"error": {
"code": 409,
"message": "API key already exists"
},
"existing": {
"object": "api_key",
"id": 1234567890,
"name": "My API Key"
}
} Get API Key
Retrieve information about a specific API key in your Emailit account.
GET
/api-keys/{id}Path Parameters
idstringRequiredThe ID of the API key to retrieve.
{
"object": "api_key",
"id": 1234567890,
"name": "My API Key",
"scope": "sending",
"sending_domain_id": 1234567890,
"last_used_at": "2021-01-01T12:00:00Z",
"created_at": "2021-01-01T00:00:00Z",
"updated_at": "2021-01-01T00:00:00Z"
} {
"error": {
"code": 404,
"message": "API key not found"
}
} List API Keys
Get all API keys in your account.
GET
/api-keysQuery Parameters
pageintegerPage number for pagination (minimum: 1).
limitintegerNumber of API keys to return (minimum: 1, maximum: 100).
{
"data": [
{
"id": 1234567890,
"name": "My API Key",
"scope": "sending",
"sending_domain_id": 1234567890,
"last_used_at": "2021-01-01T12:00:00Z",
"created_at": "2021-01-01T00:00:00Z",
"updated_at": "2021-01-01T00:00:00Z"
},
{
"id": 1234567891,
"name": "Another API Key",
"scope": "full",
"sending_domain_id": null,
"last_used_at": null,
"created_at": "2021-01-02T00:00:00Z",
"updated_at": "2021-01-02T00:00:00Z"
}
],
"next_page_url": "https://api.emailit.com/v2/api-keys?page=2&limit=10",
"previous_page_url": null
} Update API Key
Update the name of an existing API key in your Emailit account.
POST
/api-keys/{id}Path Parameters
idstringRequiredThe ID of the API key to update.
Request Body
namestringRequiredThe new name for the API key.
{
"object": "api_key",
"id": 1234567890,
"name": "Updated API Key Name",
"scope": "sending",
"sending_domain_id": 1234567890,
"last_used_at": "2021-01-01T12:00:00Z",
"created_at": "2021-01-01T00:00:00Z",
"updated_at": "2021-01-01T12:00:00Z"
} {
"error": {
"code": 400,
"message": "Bad Request"
}
} {
"error": {
"code": 404,
"message": "API key not found"
}
} {
"error": {
"code": 409,
"message": "API key name already exists"
}
} Delete API Key
Revoke and delete an API key from your Emailit account.
DELETE
/api-keys/{id}Path Parameters
idstringRequiredThe ID of the API key to delete.
{
"object": "api_key",
"id": 1234567890,
"name": "My API Key",
"deleted": true
} {
"error": {
"code": 404,
"message": "API key not found"
}
}