Skip to content

Blueprints

Blueprints define the structure of your content. Think of a blueprint as a schema — it specifies which fields a resource has, what type of data each field stores, and how the resource behaves.

Blueprint types

TypeInstancesEditableUse case
ResourceMultipleYesBlog posts, products, team members
Singular resourceOneYesSite settings, homepage content, contact info
Read-only resourceMultipleNo (via admin)Form submissions, comments, user feedback

Resource

The standard type. Create, edit, publish, and delete multiple instances through the admin panel or the API.

Singular resource

Only one instance exists. In the admin panel, it appears as a single form (no list view). The API returns the resource directly instead of a paginated list.

Read-only resource

Instances can be created via the API (e.g. form submissions) but cannot be edited or published through the admin panel. They appear in a read-only list.

Blueprint fields

Each blueprint has an ordered list of fields. Fields define the shape of the attributes object in API responses.

Field types reference

TypeAPI keyAPI valueExample
Texttextstring"Getting started with Diggama"
Rich textrich-textstring (HTML)"<p>Hello <strong>world</strong></p>"
Slugslugstring"getting-started"
Emailemailstring"[email protected]"
Numbernumbernumber42
Moneymoneynumber29.99
Booleanbooleanbooleantrue
Datedatestring (YYYY-MM-DD)"2026-02-07"
Date and timedatetimestring (ISO 8601)"2026-02-07T14:30:00"
Durationdurationstring"01:30:00"
Imageimagestring (URL)"https://cdn.diggama.com/img/photo.jpg"
Filefilestring (URL)"https://cdn.diggama.com/files/doc.pdf"
Linklinkstring (URL)"https://example.com"
Colorcolorstring (HEX)"#8931da"
Choiceenumstring"featured"
Multi-choicemulti-enumarray["news", "featured"]
Referencereferencestring (resource ID)"gKqv6dx6pBk9"
Referencesreferencesarray (resource IDs)["gKqv6dx6pBk9", "xR4mN2v"]
Useruserstring (user ID)"kP3nQ8w"
Addressaddressobject{"street": "1 rue de la Paix", "city": "Paris"}

Example API response

A blueprint blog-posts with fields: title (Text), slug (Slug), content (Rich text), cover (Image), featured (Boolean), category (Choice), author (Reference).

json
{
  "id": "gKqv6dx6pBk9",
  "type": "resource",
  "published_at": "2026-02-01T12:00:00+00:00",
  "created_at": "2026-01-28T09:15:00+00:00",
  "updated_at": "2026-02-01T12:00:00+00:00",
  "attributes": {
    "title": "Getting started with Diggama",
    "slug": "getting-started",
    "content": "<p>Welcome to your new headless CMS.</p>",
    "cover": "https://cdn.diggama.com/images/cover.jpg",
    "featured": true,
    "category": "tutorial",
    "author": "xR4mN2vBwQy7"
  },
  "relationships": {
    "blueprint": {
      "data": { "id": "blog-posts", "type": "blueprint" }
    }
  }
}

Variants

Blueprints can define variants for multilingual content. Each variant stores its own copy of the resource attributes.

When a blueprint has variants, pass the variant query parameter to any API endpoint:

GET /v2/resources/blog-posts?variant=fr

If omitted, the blueprint's default variant is used. The API response format stays the same — you get the attributes for the requested variant.

Diggama Documentation