21.2 Refresh an Authentication Token

PUT https://localhost:7007/auth/token

Refresh a valid access token.

Request

Request Header

  • Accept: application/json; charset=UTF-8
  • Content-Type: application/json

Table 21-2 Request Body Parameters

Parameter Type Description Required
token string Access token value Yes
createSession boolean Flag to determine if a session needs to be created Optional. Set it to true if you want to run queries against the graph server (PGX).
sessionId string To reuse an existing session when connecting to the graph server Optional. Set it to an existing session ID if you want to reuse that session.

Sample Request Body

{
    "token": "<token>",
    "createSession": true,
    "sessionId": "<session-id>"
}

Response

  • 201 Created
  • Content-Type: application/json

Sample Response Body

{
    "access_token": "<token>"
    "token_type": "bearer",
    "expires_in": 3600
}

cURL Example

curl --location --request PUT 'https://localhost:7007/auth/token' \
--header 'Content-Type: application/json' \
--data '{
    "token": "<token_value>",
    "createSession": true,
    "sessionId": "<session-id>"
}'