Skip to content

Publishing

Resources in Diggama have a publication state. A resource is either a draft or published, controlled by the published_at field.

Draft vs published

Statepublished_atVisible with view abilityVisible with preview ability
DraftnullNoYes
PublishedISO 8601 dateYesYes

By default, list endpoints with a view token only return published resources. Use a preview token to include drafts (useful for staging environments and content previews).

Publishing on creation

Set published_at when creating a resource to publish it immediately:

json
{
  "attributes": { "title": "My post", "slug": "my-post" },
  "published_at": "2026-02-07T12:00:00Z"
}

Omit published_at or set it to null to create as a draft.

Publishing an existing resource

Use a PATCH request to publish or unpublish a single resource:

bash
# Publish
curl -X PATCH "https://api.diggama.com/v2/resources/posts/gKqv6dx6pBk9" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{ "published_at": "2026-02-07T12:00:00Z" }'

# Unpublish (revert to draft)
curl -X PATCH "https://api.diggama.com/v2/resources/posts/gKqv6dx6pBk9" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{ "published_at": null }'

Both operations require the publish ability on the token.

Bulk publish / unpublish

Publish or unpublish multiple resources at once using bulk operations:

bash
# Bulk publish
curl -X POST "https://api.diggama.com/v2/resources/posts/bulk-publish" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{ "ids": ["gKqv6dx6pBk9", "xR4mN2vBwQy7"] }'

Scheduled publishing

You can set published_at to a future date. The resource will be considered published from that moment — the API does not filter by future dates, so it will appear in results immediately. To implement scheduled publishing, handle the timing in your frontend or build pipeline.

Filtering by publication status

Use the published filter on list endpoints:

GET /v2/resources/posts?filter[published]=true
GET /v2/resources/posts?filter[published]=false

See Filtering & search for more filter options.

Diggama Documentation