Project tokens

Project tokens are used to fetch and query content from the Content API. They differ from API keys in that they can not be used to manage your projects, they are read-only tokens used to fetch published content.

Project tokens are associated with environments. Each token can be associated with a single environment, however, each environment can have many tokens. For example, you may have separate tokens for your development, staging, and production environments.

For additional security, tokens can be restricted by IP address, custom headers, or a secret. Tokens allow access from anywhere by default.


get

List tokens

Lists all project tokens

Required attributes

None

Optional attributes

None
Request
get
/api/projects/:projectId/tokens
Response

get

Retrieve a token

Fetches a single token based on the provided token ID

Required attributes

projectId
string
Your project ID
tokenId
string
Your token ID

Optional attributes

None
Request
get
/api/projects/:projectId/tokens/:tokenId
Response

get

Retrieve logs for a token

Retrieves logs associated with a project token. These logs provide information on where the request to your content comes from and contains information on the requestor such as user agent, geo location information, and the query used along with the token.

Required attributes

projectId
string
Your projectId
tokenId
string
Your token ID

Optional attributes

None
Request
get
/api/projects/:projectId/tokens/:tokenId
Response

post

Create a token

Creates a new project token

Required attributes

projectId
string
Your projectId
title
string
Name for your token

Optional attributes

description
string
Description for your token
disabled
boolean
Disable token from being used
environment
string
The ID of the environment to associate with the token
Request
post
/api/projects/:projectId/tokens
Response

patch

Update a token

Update attributes for an existing project token

Required attributes

projectId
string
Your projectId
tokenId
string
Your token ID

Optional attributes

title
string
Name for your token
description
string
Description for your token
disabled
boolean
Disable token from being used
environment
string
The ID of the environment to associate with the token
ipRestrictionsEnabled
boolean
Enable or disable IP restrictions on the token
ipValues
string[]
An array of IPv4 and / or IPv6 addresses
secretKeyEnabled
boolean
Enable or disable secret key for token
secretKey
string
12+ character secret key to associate with the token
Request
patch
/api/projects/:projectid/tokens/:tokenId
Response

delete

Delete a token

Delete's a project token

Required attributes

projectId
string
Your projectId
tokenId
string
Your token ID

Optional attributes

None
Request
delete
/api/projects/:projectId/tokens/:tokenId
Response
Last modified 7/6/2024, 5:26:15 PM