Skip to content

Create resources

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

Create a resource

POST /v2/resources/{blueprint}

Request body

FieldTypeRequiredDescription
attributesobjectYesKey-value pairs matching the blueprint fields
published_atstringNoISO 8601 date to publish the resource. Omit or set to null for draft

Example

bash
curl "https://api.diggama.com/v2/resources/posts" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "attributes": {
      "title": "My new post",
      "slug": "my-new-post",
      "content": "<p>Hello world</p>"
    },
    "published_at": "2026-02-01T12:00:00Z"
  }'

Response — 201 Created

json
{
  "data": {
    "id": "xR4mN2vBwQy7",
    "type": "resource",
    "published_at": "2026-02-01T12:00:00+00:00",
    "created_at": "2026-02-01T12:00:00+00:00",
    "updated_at": "2026-02-01T12:00:00+00:00",
    "attributes": {
      "title": "My new post",
      "slug": "my-new-post",
      "content": "<p>Hello world</p>"
    },
    "relationships": {
      "blueprint": {
        "data": { "id": "posts", "type": "blueprint" }
      }
    }
  }
}

Validation

Field values are validated against the blueprint field types. For example, an email field must contain a valid email address, a number field must be numeric, etc. A 422 Unprocessable Entity response is returned if validation fails.

For bulk creation, see Bulk operations.

Diggama Documentation