Create API Key

Warning: This API has been deprecated. Please contact us to move to the latest Authentication system and transition to using Service Accounts.

POST /api-keys/

Instantiates a JWT token for a machine/service account, which must be securely persisted and passed in the request headers as a bearer token. The token is subject to policy engine controls, but can not approve policy control executions.

Required Permissions

ApiKeys:Create

Parameters

Request body

Request body fieldsRequired/OptionalDescriptionType

name

Required

A name for the API Key

String

scopes

Required

This field will soon be deprecated. Please pass "{}".

Pass an empty object: {}

Request example

Sample request

curl -X POST "/api-keys/" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <TOKEN>" \
-d '{"name": "Server Key 3"}'

Response

Response example

The response returns a token. Note Dfns does not persist the token you receive, so you must save it securely. You will not be able to get this token again from the Dfns API.

{
  "id": "api-cat-freddie-a150fe2ce0",
  "name": "My API Key",
  "orgId": "cu-purple-pip-1b417b958500",
  "status": "Active",
  "authorId": "ce-finch-march-5b59fcbb571b",
  "dateCreated": "2022-09-01T09:06:32.567Z",
  "token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJoL2FwaS5kZm5ZiIsImlzcyI6Imh0dHBzOi8vYXBpa2V5cy5kZm5zLnd0Zi8iLCJzdWIiOiJjdS1wdXJwbGUtcGlwLTFiNDE3Yjk1ODUwMCIsImh0dHBzOi8vY3VzdG9tL29yZ0lkIjoiY3UtcHVycGxlLXBpcC0xYjQxN2I5NTg1MDAiLCJwZXJtaXNzaW9ucyI6WyJmdWxsOmFkbWluIl0sInNjb3BlIjoiZnVsbDphZG1pbiIsImp0aSI6ImFwaS1jYXQtZnJlZGRpZS1hMTUwZmUyY2UwIiwiaWF0IjoxNjYyMDIzMTkyLCJleHAiOjE2NjIxMDk1OTJ9.XXXXXXXXXXXXXXXXXXXXXXXX"
}

Last updated