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

# Create entries in batch

> Create up to 200 entries in one request. Each item is validated on its own: valid items are
created, invalid ones are reported in `failed` by their position in `entries`. The response is
`200` whenever the request itself is valid, even if every item failed.

Batch creation behaves like a data import: no new-entry notifications, webhooks or integrations
(e.g. Google Sheets, Notion, Slack) are triggered for these entries.

**Required scope:** `entry:write`.




## OpenAPI

````yaml /api-reference/openapi.yaml post /api/v1/forms/{form_token}/entries/batch
openapi: 3.0.1
info:
  title: FormHug API V1
  version: v1
  description: >
    FormHug public REST API. All request/response keys are snake_case.


    Successful response:


    ```json

    {
      "data": { ... }
    }

    ```


    Paginated response:


    ```json

    {
      "data": [ ... ],
      "pagination": {
        "total": 123,
        "next_cursor": "NQ=="
      }
    }

    ```


    Error response:


    ```json

    {
      "error": "Human-readable message",
      "code": "password_required",
      "error_details": [
        { "attribute": "field_name", "message": "specific error" }
      ]
    }

    ```


    `code` is a machine-readable reason, present only where a client may need to
    branch

    on it (see `CodedErrorEnvelope`). `error_details` appears on validation
    failures and

    lists each offending attribute.
servers:
  - url: https://formhug.ai
security: []
tags:
  - name: Forms
    description: Form CRUD
  - name: Attachments
    description: >-
      2-step upload for form-element images (theme, rich-text, or field-element
      images). Prepare returns an `upload_id`; consume it in a theme update,
      attachment_commitments, or the form `fields` payload depending on purpose.
  - name: Entries
    description: Entries collected by a form owned by the current user
  - name: Folders
    description: Folder CRUD
  - name: Participated Forms
    description: Forms the current user has submitted to (does not own)
  - name: Published Form Entries
    description: Submit entries to a published form
  - name: Published Forms
    description: Read a published form's public structure for filling
  - name: Linked Form Options
    description: >-
      Discover candidate entries (and their `entry_token`s) for a `linked_form`
      field while filling a published form
  - name: Entry Attachments
    description: >-
      2-step upload for `attachment` field submissions. Prepare returns an
      `upload_id`; submit it under the attachment field in `field_values` when
      creating the entry.
  - name: Me
    description: Current authenticated user
  - name: Webhooks
    description: Webhook integrations attached to a form
  - name: Form Themes
    description: Read and update a form's visual theme
  - name: Form Settings
    description: >-
      Per-form settings — submission flow, availability, access control,
      presentation
  - name: Field Rules
    description: >-
      Read and replace a form's conditional field-display and post-submission
      redirect rules.
  - name: Form Folder
    description: Per-user folder placement for a shared form
  - name: OAuth
    description: OAuth 2.0 PKCE token issuance and revocation
  - name: Public Queries
    description: Public query pages that let visitors look up entries by chosen fields
paths:
  /api/v1/forms/{form_token}/entries/batch:
    parameters:
      - name: form_token
        in: path
        description: Form token
        required: true
        schema:
          type: string
    post:
      tags:
        - Entries
      summary: Create entries in batch
      description: >
        Create up to 200 entries in one request. Each item is validated on its
        own: valid items are

        created, invalid ones are reported in `failed` by their position in
        `entries`. The response is

        `200` whenever the request itself is valid, even if every item failed.


        Batch creation behaves like a data import: no new-entry notifications,
        webhooks or integrations

        (e.g. Google Sheets, Notion, Slack) are triggered for these entries.


        **Required scope:** `entry:write`.
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EntryBatchCreateRequest'
      responses:
        '200':
          description: Processed
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                properties:
                  data:
                    $ref: '#/components/schemas/EntryBatchCreateResult'
        '402':
          description: Entry quota exhausted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '403':
          description: Collaborator role lacks permission to create entries
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '404':
          description: Form not accessible to the current user
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
        '422':
          description: Request body invalid (empty or more than 200 entries)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorEnvelope'
      security:
        - PersonalAccessToken:
            - entry:write
components:
  schemas:
    EntryBatchCreateRequest:
      type: object
      required:
        - entries
      properties:
        entries:
          type: array
          minItems: 1
          maxItems: 200
          items:
            type: object
            required:
              - field_values
            properties:
              field_values:
                type: object
                description: Same shape as `field_values` of a single entry create.
                example:
                  field_1: Jane Doe
    EntryBatchCreateResult:
      type: object
      required:
        - succeeded
        - failed
      properties:
        succeeded:
          type: array
          items:
            type: object
            required:
              - index
              - serial_number
            properties:
              index:
                type: integer
                description: Position of the item in the request `entries`
                example: 0
              serial_number:
                type: integer
                description: Serial number of the created entry
                example: 101
        failed:
          type: array
          items:
            type: object
            required:
              - index
              - code
              - error_details
            properties:
              index:
                type: integer
                example: 1
              code:
                type: string
                enum:
                  - validation_failed
                description: Why the item was not created; see `error_details`.
              error_details:
                type: array
                items:
                  $ref: '#/components/schemas/ErrorDetail'
    ErrorEnvelope:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message
    ValidationErrorEnvelope:
      type: object
      required:
        - error
        - error_details
      description: >-
        Returned on model validation failures. error_details lists per-field
        errors.
      properties:
        error:
          type: string
          example: Name can't be blank
        error_details:
          type: array
          items:
            type: object
            required:
              - attribute
              - message
            properties:
              attribute:
                type: string
                example: name
              message:
                type: string
                example: can't be blank
    ErrorDetail:
      type: object
      required:
        - attribute
        - message
      properties:
        attribute:
          type: string
          example: field_values.field_1
        message:
          type: string
          example: can't be blank
  securitySchemes:
    PersonalAccessToken:
      type: http
      scheme: bearer
      bearerFormat: PAT
      description: >
        Personal Access Token prefixed with `fh_`. Sent as `Authorization:
        Bearer fh_xxx`.

        The scope required by each endpoint is listed in that endpoint's
        description.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.