Create Token
Create an API Token from a valid Yext API Key and provided parameters.
Request Body schema: application/json
api_key required | string A valid Yext API key for an app with the Secure Token Live Api permission enabled. |
expires_in required | integer The number of minutes the Api Token will be valid for. Per Yext requirements, an Api Token must be valid for at least an hour but for no longer than a day. As such, expires_in can take values within the range of [60, 1440]. |
auth_identifier required | string A freeform string identifying the user for whom the token is being created. |
fixed_query_params required | object Optional JSON object specifying a set of query parameters and subsequent values that should be applied to the URL of any request that uses the token as an Api Key. If these parameters are present in the original request, they will be replaced with the values contained in this field. |
signing_algorithm required | string The encryption algorithm used to sign the token. Options include:
|
Responses
Request samples
- Payload
{- "api_key": "oin3rqnka321ojas",
- "expires_in": 60,
- "auth_identifier": "John Doe",
- "fixed_query_params": { },
- "signing_algorithm": "HS256"
}
Response samples
- 201
- 401
{- "body": {
- "id": "628fdc25-af40-4daa-80a0-712962034e9c",
- "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiIyNTQ3OTQxIiwiZXhwIj\n oxNjA4NzY0MDM2LCJqdGkiOiI3ZGRhYmE3Ny01MDE2LTQ1ZmQtYTZlYS0yZmExMDFkY\n zQyN2QiLCJpYXQiOjE2MDg3NjA0MzYsImlzcyI6IllleHQiLCJzdWIiOiI5MDM5NCIs\n ImZxcCI6e30sInJlcXVlc3RlciI6eyJidXNpbmVzc0lkIjoyNTQ3OTQxLCJhcHBJZCI\n 6OTAzOTQsInJlYWRFbmRwb2ludEdyb3VwSWQiOlsxLDMsOCwxMywxNSwxNywyMywyNi\n wyN10sIndyaXRlRW5kcG9pbnRHcm91cElkIjpbMSwzLDgsMTMsMTUsMTcsMjMsMjYsM\n jddLCJjdXN0b21GaWVsZEJlaGF2aW9yIjp7InR5cGUiOjB9LCJza2lwc1F1b3RhQ2hl\n Y2siOmZhbHNlLCJ1c2VDYXNlIjoiRVhURVJOQUwifX0.3eOnrDxrd5x1Xz9f2G86HG4\n Jph9VoI6URUpOEdvhZIQ"
}, - "statusCode": 201
}