Skip to content

Generate an API key

Request

expires_in_days is optional — omit it and the key defaults to a 90-day lifetime (API_KEY_DEFAULT_TTL_DAYS).

name is optional too — a label to help you recognise the key in the list.

Security
HTTPBearer
Bodyapplication/jsonrequired
expires_in_daysinteger or null(Expires In Days)
Any of:

Key lifetime in days. Defaults to API_KEY_DEFAULT_TTL_DAYS (90).

[ 1 .. 365 ]
integer
namestring or null(Name)
Any of:

Optional label to recognise this key in the list.

<= 100 characters
string
curl -i -X POST \
  https://docs.vanda-analytics.com/_mock/apis/auth/vanda-msvc-auth/auth/api-keys \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "expires_in_days": 90,
    "name": "string"
  }'

Responses

Successful Response

Bodyapplication/json
idinteger(Id)required
api_keystring(Api Key)required

Shown once. It cannot be recovered later.

namestring or null(Name)
Any of:
string
expires_atstring, (date-time)(Expires At)required
created_atstring, (date-time)(Created At)required
Response
{ "id": 0, "api_key": "string", "name": "string", "expires_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z" }