Endpoint:
POST https://api.mailjet.com/v1/REST/tokens
You can create a token to authenticate requests and manage permissions for different operations
| Name | Type | Description |
|---|---|---|
Name | string | Required. A unique identifier for the token. |
Permissions | array of strings | List of permissions assigned to the token. See full list of permissions. |
ExpiresInDays | integer | Number of days until it expires. Default: 365 days. |
ExpiresAt | Date RFC3339 | Date at which the token expires |
Example Request
curl -X POST -H "Authorization: Basic bWFpbGpldDpyb2Nrcw==" https://api.mailjet.com/v1/rest/tokens -d '{
"Name": "marketing team",
"Permissions": [
"read_template_marketing",
"create-template_marketing",
"update_template_marketing"
],
"ExpiresAt": "2024-01-25T17:42:46.705583Z"
}'Status code: 201
| Name | Type | Description |
|---|---|---|
ID | integer | The ID of the token. |
Name | string | Required. A unique identifier for the token. |
Permissions | array of strings | List of permissions assigned to the token. See full list of permissions. |
AccessToken | string | The token value to use for authentication |
ExpiresAt | Date RFC3339 | Date at which the token expires |
CreatedAt | Date RFC3339 | Date on which the token was created |
UpdatedAt | Date RFC3339 | Date on which the token was last updated |
{
"Count": 1,
"Total": 1,
"Data": [
{
"ID": 46,
"UserID": 2,
"OrganisationID": 2,
"AccessToken": "612d5125131d406081abb9cd2afdc4e3",
"Name": "marketing team",
"Permissions": [
"read_template_marketing",
"create-template_marketing",
"update_template_marketing"
],
"CreatedAt": "2024-05-23T08:45:29.186711Z",
"UpdatedAt": "2024-05-23T08:45:29.186711Z"
}
]
}