A new version of the API (v4) is available here: developers.linode.com.

user.getapikey()

Authenticates a Linode Manager user against their username, password, and two-factor token (when enabled), and then returns a new API key, which can be used until it expires. The number of active keys is limited to 20. Batch requests will be rejected if they include this API action.

Parameters

  • username - string (required)
  • password - string (required)
  • token - string (optional) Required when two-factor authentication is enabled. Emergency scratch codes are not permitted.
  • expires - numeric (optional) Number of hours the key will remain valid, between 0 and 8760. 0 means no expiration. Defaults to 168.
  • label - string (optional) An optional label for this key.

Example Response

{
   "ERRORARRAY":[],
   "ACTION":"user.getAPIKey",
   "DATA":{
      "USERNAME":"chris",
      "API_KEY":"aNW3ydF53LpVftU9s50e0reFEwy0piwGhwaLKAj4okRZ"
   }
}

Errors

AUTHFAIL, NEEDTOKEN, PASSWORDEXPIRED, KEYLIMIT, TOTPEXPIRED, NOACCESS