Create a sub account API token.
POST/v1/api-tokens/sub-account
Creates a new API token for a sub account. Must be run with an API token of the owner account. Once created, you can view the details for this new token in Manage tokens > API tokens, when you are logged in to the relevant sub account.
Note: To activate Prometheus API over our Metrics account contact Logz.io's support team. Please ensure to change the region in the URL to match your account's region.
Request
- application/json
Body
required
Default value: string
The name provided in the request for a new API token for the sub account
Logz.io sub account ID.
Responses
- 200
- 400
- 401
- 403
- 404
successful operation
- application/json
- Schema
- Example (from schema)
Schema
ID of the newly created API token for the sub account
The name of the newly created API token for the sub account. Uses the name provided in the request.
The API token
The time at which the new sub account API token was created
{
"id": 7386,
"name": "newTokenTest999",
"token": "c498fbc3-a3ac-4676-ad09-689854b5cbbd\"",
"createdAt": 1621858311
}
Bad Request
- application/json
- Schema
- Example (from schema)
Schema
Bad Request. The request cannot be completed. Errors may include malformed request syntax, invalid request message parameters, and so on.
{
"message": "Bad Request. There was an issue with the request syntax from the client. Received integer instead of expected string parameter"
}
Unauthorized
- application/json
- Schema
- Example (from schema)
Schema
Unauthorized. Attempted to create an API token for a sub account with insufficient or missing credentials for the main or owner account. Please contact our Support team for access to this API feature via help@logz.io.
{
"message": "Unauthorized. There was a problem with the authorization provided in the request."
}
Forbidden
- application/json
- Schema
- Example (from schema)
Schema
Forbidden. Attempted to create an API token for a sub account with an invalid owner account token. This operation requires a valid API token for the owner account.
{
"message": "Forbidden. Attempted to create an API token for a sub account using an illegal owner account token."
}
Not Found
- application/json
- Schema
- Example (from schema)
Schema
Not Found. Could not find the sub account associated with this request or the relevant owner account for the sub account.
{
"message": "Not Found. Could not find the sub account associated with this request."
}