Skip to main content
POST
/
access-tokens
/
tokens
Create a System Access Token
curl --request POST \
  --url https://api-dev.narrative.io/access-tokens/tokens \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "My Token",
  "permissions": [
    {
      "access": "read",
      "resource": "datasets"
    },
    {
      "access": "write",
      "resource": "datasets"
    },
    {
      "access": "read",
      "resource": "subscriptions"
    },
    {
      "access": "write",
      "resource": "subscriptions"
    }
  ],
  "expires_at": "2023-10-31T11:19:13.400498Z"
}
'
{
  "id": "546c65d6-e589-4d3c-b1fe-7e61711cc418",
  "name": "My Token",
  "permissions": [
    {
      "access": "read",
      "resource": "datasets"
    },
    {
      "access": "write",
      "resource": "datasets"
    },
    {
      "access": "read",
      "resource": "subscriptions"
    },
    {
      "access": "write",
      "resource": "subscriptions"
    }
  ],
  "expires_at": "2023-10-31T11:19:13.400498Z",
  "access_token": "ldg8uuGibVJNHI9s+dcdIQ=="
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required

The name of the token

permissions
object[]

The requested permissions

expires_at

The requested token expiration timestamp

Response

OK

id
string<uuid>
required

The id of the token

name
string
required

The name of the token

permissions
object[]
required

The permissions granted to the token

expires_at
string<date-time>
required

The token expiration timestamp

access_token
string
required

The access token