Skip to main content

createPersonalAccessToken

Create a Personal Access Token (PAT) for the currently authenticated user.

note

In order to use the API, you must already be authenticated. This means you either already have a personal access token created from the Point One Navigation webapp or you're executing this operation from the GraphQL playground.

This mutation is most useful for automating creation of a new PATs when an existing one is nearing expiry.

createPersonalAccessToken(
name: String!
description: String
role: TokenRole
expiryInDays: Int! = 365
): String!

Arguments

createPersonalAccessToken.name ● String! non-null scalar common

createPersonalAccessToken.description ● String scalar common

createPersonalAccessToken.role ● TokenRole enum personal-access-tokens

createPersonalAccessToken.expiryInDays ● Int! non-null scalar common

Type

String scalar common

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Code Samples

curl -X POST https://graphql.pointonenav.com/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"query": "mutation CreatePersonalAccessToken($name: String!, $role: TokenRole, $expiryInDays: Int!) { createPersonalAccessToken(name: $name, role: $role, expiryInDays: $expiryInDays) }",
"variables": {
"name": "My API Token",
"role": "ROLE_READ_WRITE",
"expiryInDays": 365
}
}'