Skip to navigation

Generate an API token

Call this endpoint twice to generate an API token.

  1. Request a 2FA token. Send your username, password, and method: token. A two-factor authentication (2FA) token is emailed to the address on your account.
  2. Exchange the 2FA token for an API token. Send the same credentials again and add the twofa_token from the email. The response contains your API token.
  3. Use the API token. Send it as the value of the x-api-key header on every authenticated request.

Select a request body variant below to see the fields for step 1 or step 2.

Request

This endpoint expects an object.
twofa_token_requestobjectRequired

Step 1: request a 2FA token. Omit twofa_token on this call. The 2FA token is emailed to the address on your account.

OR
api_token_requestobjectRequired

Step 2: exchange the emailed 2FA token for an API token. Send the same credentials as step 1 and add twofa_token.

Response

Successful operation
twofa_token_responseobject
Step 1 response. Confirms that a 2FA token was emailed.
OR
api_token_responseobject

Step 2 response. Contains the API token to send in the x-api-key header.

Errors

400
Bad Request Error