Auth API (1.0)

Download OpenAPI specification:Download

Use the Auth API to manage tokens for secure access to IONOS Cloud APIs (Auth API, Cloud API, Reseller API, Activity Log API, and others).

tokens

Everything about tokens

Create new tokens

Users can generate new tokens (JWT or JSON Web Token). By default, new tokens are linked to the user’s contract. Users with multiple contracts must provide the contract number, for which the token is generated, in the X-Contract-Number header; otherwise, an error response is returned.

To access this endpoint, 'Basic Authentication' or 'Token Authentication' tokens with valid credentials must be encapsulated in the header, by users with one or with multiple contracts.

Note:

From March 15, 2024, users with 2-Factor Authentication enabled must generate new tokens using 2FA-secured tokens through DCD in the Token Manager. Tokens generated this way will not automatically inherit the 2FA-secured property.

The response will contain a newly-generated token for accessing any IONOS Cloud APIs (Auth API, Cloud API, Reseller API, Activity Log API, and others). The token can be used to access the APIs without providing the contract number in the `X-Contract-Number` header, by users with one or with multiple contracts. However, a valid contract number must be provided in the `X-Contract-Number` header to access the Auth API. By default, generated access tokens will expire after one year (subject to change).
Authorizations:
BasicAuthenticationTokenAuthentication
query Parameters
ttl
integer <int32> [ 60 .. 31536000 ]
Default: 31536000

The maximum time that the access token will be valid for use within the application in seconds.

header Parameters
X-Contract-Number
integer <int32>

Users with multiple contracts must provide the contract number, for which the token is generated.

Responses

Response samples

Content type
application/json
{
  • "token": "string"
}

List all tokens

List the details of all tokens, generated by the user. To access this endpoint, 'Basic Authentication' or 'Token Authentication' tokens with valid credentials must be encapsulated in the header. Users with multiple contracts must also provide a valid contract number in the X-Contract-Number header.

Authorizations:
BasicAuthenticationTokenAuthentication
header Parameters
X-Contract-Number
integer <int32>

Users with multiple contracts must provide the contract number, for which the token is generated.

Responses

Response samples

Content type
application/json
{
  • "tokens": [
    ]
}

Delete tokens by criteria

Delete one or multiple tokens by the required criteria parameter values: ALL, EXPIRED and CURRENT. With parameter values ALL and EXPIRED, 'Basic Authentication' or 'Token Authentication' tokens with valid credentials must be encapsulated in the header.

Note:

From March 15, 2024, users with 2-Factor Authentication must use 2FA-secured tokens to delete existing tokens. Token deletion can only be performed through DCD in the Token Manager.
With value CURRENT, only the 'Token Authentication' with valid credentials is required. Users with multiple contracts must also provide a valid contract number in the X-Contract-Number header.

Authorizations:
BasicAuthenticationTokenAuthentication
query Parameters
criteria
required
string

Delete tokens by criteria EXPIRED, ALL, or CURRENT. The tokens are deleted for the specified contract.

header Parameters
X-Contract-Number
integer <int32>

Users with multiple contracts must provide the contract number, for which the token is generated.

Responses

Response samples

Content type
application/json
{
  • "success": true
}

Get tokens by Key ID

Retrieve the details for a token by the Key ID (tokenId). To access this endpoint, 'Basic Authentication' or 'Token Authentication' tokens with valid credentials must be encapsulated in the header. Users with multiple contracts must also provide a valid contract number in the X-Contract-Number header.

Authorizations:
BasicAuthenticationTokenAuthentication
path Parameters
tokenId
required
string

The Key ID of the token (can be retrieved from the header section of the token).

header Parameters
X-Contract-Number
integer <int32>

Users with multiple contracts must provide the contract number, for which the token is generated.

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "href": "string",
  • "createdDate": "string",
  • "expirationDate": "string"
}

Delete tokens

Delete a token by Key ID (tokenId). To access the endpoint, 'Basic Authentication' or 'Token Authentication' tokens with valid credentials must be encapsulated in the header.

Note:

From March 15, 2024, users with 2-Factor Authentication must use 2FA-secured tokens to delete existing tokens. Token deletion can only be performed through DCD in the Token Manager.

Users with multiple contracts must also provide a valid contract number in the `X-Contract-Number` header.
Authorizations:
BasicAuthenticationTokenAuthentication
path Parameters
tokenId
required
string

The Key ID of the token (can be retrieved from the header section of the token).

header Parameters
X-Contract-Number
integer <int32>

Users with multiple contracts must provide the contract number, for which the token is generated.

Responses

Response samples

Content type
application/json
{
  • "success": true
}