---
title: "Batch create resources"
method: POST
path: "/v1/{resource}/batch"
tags: ["Batch"]
---

# Batch create resources

`POST /v1/{resource}/batch`

## Request

- Base URL: `https://api.frihet.io`
- URL: `https://api.frihet.io/v1/{resource}/batch`
- Auth: API key in header `X-API-Key`

Create multiple resources in a single request. The request body must be
an array of items (max 50). Each item is validated independently.
Returns 201 if all succeed, 207 if partially successful, 400 if all fail.

## Path parameters

- `resource` 'invoices' | 'expenses' | 'clients' | 'vendors' | 'products' | 'quotes', required

## Request body

- object[]

## Response `201`

All items created successfully

- BatchResponse
  - `data` object[]
    - `index` integer: Index of the item in the original request array
    - `success` boolean
    - `data` object: Created resource (only when success is true)
    - `error` string: Error message (only when success is false)
    - `details` object[]: Validation error details (only on validation failure)
  - `summary` object
    - `total` integer: Total items in request
    - `succeeded` integer: Number of successfully created items
    - `failed` integer: Number of failed items
  - `meta` object
    - `requestId` string
    - `timestamp` string, date-time

## Other responses

- `207`: Partial success (some items failed validation)
- `400`: Bad request - invalid parameters or request body
- `401`: Authentication required or invalid API key
- `429`: Rate limit exceeded (100 requests per minute)
- `500`: Internal server error

---

[API](https://skmtc.dev/frihet/apis/frihet-api.md) · [All operations](https://skmtc.dev/frihet/apis/frihet-api/llms.txt) · [OpenAPI document](https://skmtc.dev/frihet/apis/frihet-api/revisions/3dd37f6a72d1?raw)
