> ## Documentation Index
> Fetch the complete documentation index at: https://developer.dittowords.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create project blocks

> Creates one or more blocks in a Ditto project. New blocks are appended to the end of the project. Each block can optionally specify a developer ID — a block's developer ID only needs to be unique within its own project, so two different projects may reuse the same block developer ID.



## OpenAPI

````yaml openapi.json post /projectBlocks
openapi: 3.0.0
info:
  version: 1.0.0
  title: Ditto API
  description: Programmatically read and write data in your Ditto workspace.
servers:
  - url: https://api.dittowords.com/v2
security: []
paths:
  /projectBlocks:
    post:
      tags:
        - Project Blocks
      summary: Create project blocks
      description: >-
        Creates one or more blocks in a Ditto project. New blocks are appended
        to the end of the project. Each block can optionally specify a developer
        ID — a block's developer ID only needs to be unique within its own
        project, so two different projects may reuse the same block developer
        ID.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                projectId:
                  type: string
                  description: Developer ID of the project the new blocks will be added to
                blocks:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        description: >-
                          The name of the new block. If omitted, an
                          auto-numbered name is used (e.g. 'Block 1').
                      developerId:
                        type: string
                        description: >-
                          Optional preconfigured developer ID for the block.
                          Must be unique within the project (blocks in different
                          projects may reuse the same developer ID). If omitted,
                          one is generated automatically from the name.
                  minItems: 1
                  description: Array of new blocks to create
              required:
                - projectId
                - blocks
              example:
                projectId: my-project
                blocks:
                  - name: Hero Section
                  - developerId: custom-block-id
                    name: Footer
      responses:
        '200':
          description: Returns the developer IDs of the created blocks, in request order
          content:
            application/json:
              schema:
                type: object
                properties:
                  developerIds:
                    type: array
                    items:
                      type: string
                    description: >-
                      Array of developer IDs for the created blocks, in request
                      order
                required:
                  - developerIds
                example:
                  developerIds:
                    - hero-section
                    - custom-block-id
        '400':
          description: >-
            Returned when the request body fails validation. Common causes
            include: the project id not matching any project in the workspace.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message describing the validation failure
                required:
                  - message
              example:
                message: Project with ID my-project not found
        '409':
          description: Returned when a supplied developer ID already exists in the project
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message describing the conflict
                required:
                  - message
              example:
                message: Block developer ID header already exists in project my-project
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````