Skip to content

Blueprints API ​

Read the structure of your project's content types: which blueprints exist, what fields they hold, and what shape their values take.

Useful for generating types, validating payloads before you send them, or building tooling that adapts to a project it has not seen before.

List blueprints ​

GET /v2/blueprints

Returns the blueprints your token can read: those on which it holds view or preview. Others are omitted: a token scoped to blog-posts sees only blog-posts.

json
{
  "data": [
    {
      "id": "blog-posts",
      "type": "blueprint",
      "attributes": {
        "name": "Blog post",
        "slug": "blog-posts",
        "kind": "resource",
        "is_readonly": false,
        "is_singular": false,
        "record_title": "title",
        "variants": ["en", "fr"],
        "default_variant": "en",
        "fields_count": 6,
        "resources_count": 42
      }
    }
  ],
  "meta": { "total": 1 }
}
AttributeDescription
kindresource, singular_resource or readonly_resource (see Blueprints)
record_titleThe field used as the record's display title; absent when none is set
variantsVariant slugs; absent when the type is not multilingual
default_variantVariant used when a request has no variant parameter; absent when none is set
resources_countNumber of resources, drafts included

Get one blueprint ​

GET /v2/blueprints/{blueprint}

Adds the field list and a JSON Schema for the type's attributes object.

In fields, required is true when the field's validation rules include required. description and metadata are omitted when not set.

json
{
  "data": {
    "id": "blog-posts",
    "type": "blueprint",
    "attributes": { "…": "as above" },
    "fields": [
      { "slug": "title", "name": "Title", "type": "text", "required": true },
      { "slug": "category", "name": "Category", "type": "enum", "required": false,
        "metadata": { "options": ["news", "tutorial"] } }
    ],
    "schema": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "title": { "type": "string", "title": "Title" },
        "category": { "type": "string", "enum": ["news", "tutorial"], "title": "Category" }
      }
    }
  }
}

The schema mirrors the field types reference: number and money become number, date carries format: "date", a Choice field becomes an enum, and reference fields describe which type they point at.

Required fields are enforced by the Resources API: a create or PUT that omits one fails with 422 VALIDATION_ERROR. PATCH never requires a field.

Permissions ​

Both endpoints need view or preview on the blueprint. A token that can read a type's resources can read its schema; one that cannot doesn't see the blueprint in the list and gets 403 on a direct fetch.

StatusCodeCause
403FORBIDDENThe token holds neither view nor preview on that blueprint
404RESOURCE_NOT_FOUNDNo such blueprint in this project

Diggama Documentation