Skip to content

Update resources ​

Endpoints listed on this page require project tokens with the update ability. See Authentication for more details.

Full update (PUT) ​

PUT /v2/resources/{blueprint}/{id}

Replaces all attributes of the resource. All required fields must be provided (422 VALIDATION_ERROR otherwise). Fields you omit are removed.

On a blueprint with variants, PUT only replaces the subtree of the targeted variant (the variant query parameter, or the default variant). The other variants are left untouched.

Request body ​

FieldTypeRequiredDescription
attributesobjectYes*Complete set of attributes for the resource
published_atstring | nullNoISO 8601 date, or null to unpublish. Include to change the publication date. The update ability is enough

* As on create, you can also send the fields at the root of the body instead of inside attributes. reference fields accept the IDs the API returns; referenced resources must exist.

Example ​

bash
curl -X PUT "https://api.diggama.com/v2/resources/posts/gKqv6dx6pBk9" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "attributes": {
      "title": "Updated title",
      "slug": "my-first-post",
      "content": "<p>Updated content</p>"
    }
  }'

Partial update (PATCH) ​

PATCH /v2/resources/{blueprint}/{id}

Updates only the provided attributes. Fields not included in the request are left unchanged, and no field is required. The attributes field itself is optional: you can send only published_at if needed. The flat format (fields at the root of the body) is accepted too.

Example ​

bash
curl -X PATCH "https://api.diggama.com/v2/resources/posts/gKqv6dx6pBk9" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "attributes": {
      "title": "Just update the title"
    }
  }'

Response: 200 OK ​

Both PUT and PATCH return the updated resource:

json
{
  "data": {
    "id": "gKqv6dx6pBk9",
    "type": "resource",
    "published_at": "2026-01-15T10:30:00+00:00",
    "created_at": "2026-01-10T08:00:00+00:00",
    "updated_at": "2026-02-07T14:00:00+00:00",
    "attributes": {
      "title": "Just update the title",
      "slug": "my-first-post",
      "content": "<p>Hello world</p>"
    },
    "relationships": {
      "blueprint": {
        "data": { "id": "posts", "type": "blueprint" }
      }
    }
  }
}

An unknown or malformed ID returns 404 RESOURCE_NOT_FOUND; invalid values return 422 VALIDATION_ERROR.

For updating multiple resources at once, see Bulk operations.

Diggama Documentation