Skip to content

Authentication

All API requests require a project token passed as a Bearer token in the Authorization header.

Project tokens

Project tokens are created in the Diggama dashboard under Project settings > Tokens. Each token is scoped to specific blueprints and abilities, so you can create tokens with minimal permissions for each use case.

Abilities

AbilityDescriptionTypical use case
ViewList and view published resourcesProduction website fetching content
PreviewList and view all resources, including unpublished draftsStaging/preview environment
CreateCreate new resourcesForm submissions, user-generated content
UpdateModify existing resourcesProgrammatic content updates, CMS integrations
DeleteRemove resourcesContent lifecycle automation
PublishPublish and unpublish resourcesScheduled publishing, editorial workflows
Analytics: ViewAccess analytics data via the APICustom dashboards, reporting tools

Permissions are scoped per blueprint. A token with view on blog-posts cannot access resources from products.

Creating a token

  1. Open your project in the Diggama dashboard
  2. Go to Settings > Tokens
  3. Click Create token
  4. Name your token (e.g. "Production website")
  5. Select the blueprints and abilities
  6. Copy the token — it will only be shown once

Making authenticated requests

Pass the token as a Bearer token in the Authorization header:

bash
curl "https://api.diggama.com/v2/resources/blog-posts" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {token}"

JavaScript

javascript
const response = await fetch('https://api.diggama.com/v2/resources/blog-posts', {
  headers: {
    'Accept': 'application/json',
    'Authorization': `Bearer ${token}`
  }
});

Error responses

StatusDescription
401 UnauthorizedMissing or invalid token
403 ForbiddenToken does not have the required ability for this action or blueprint
json
{
  "message": "Unauthenticated."
}

Diggama Documentation