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
| Ability | Description | Typical use case |
|---|---|---|
| View | List and view published resources | Production website fetching content |
| Preview | List and view all resources, including unpublished drafts | Staging/preview environment |
| Create | Create new resources | Form submissions, user-generated content |
| Update | Modify existing resources | Programmatic content updates, CMS integrations |
| Delete | Remove resources | Content lifecycle automation |
| Publish | Publish and unpublish resources | Scheduled publishing, editorial workflows |
| Analytics: View | Access analytics data via the API | Custom dashboards, reporting tools |
Permissions are scoped per blueprint. A token with
viewonblog-postscannot access resources fromproducts.
Creating a token
- Open your project in the Diggama dashboard
- Go to Settings > Tokens
- Click Create token
- Name your token (e.g. "Production website")
- Select the blueprints and abilities
- 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
| Status | Description |
|---|---|
401 Unauthorized | Missing or invalid token |
403 Forbidden | Token does not have the required ability for this action or blueprint |
json
{
"message": "Unauthenticated."
}