Name of API token
Whether this API token can access the Content Delivery API published content endpoint
Whether this API token can access the Content Delivery API draft content endpoint
Whether this API token can access the Content Management API
Role
const SiteClient = require('datocms-client').SiteClient;const client = new SiteClient('YOUR-API-TOKEN');const accessTokenId = '312';client.accessToken.update(accessTokenId, {name: 'Read-only API token',canAccessCda: true,canAccessCdaPreview: true,canAccessCma: true,role: '34'}).then((accessToken) => {console.log(accessToken);}).catch((error) => {console.error(error);});
> node example.js{"id": "312","name": "Read-only API token","token": "XXXXXXXXXXXXXXX","canAccessCda": true,"canAccessCdaPreview": true,"canAccessCma": true,"hardcodedType": "","role": "34"}