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

# Batch create entities

> Batch create entities. **Required scope:** write

Batch create entities.

**Required scope:** `write`

### Request body

`BatchCreateEntitiesRequest`

<ParamField body="entities" type="CreateEntityRequest[]" required />

### Response

`BatchCreateEntitiesResponse`

<ResponseField name="created" type="integer" required />

<ResponseField name="entities" type="EntityResponse[]" required>
  <Expandable title="EntityResponse">
    <ResponseField name="confidence" type="number (float)" required>
      Confidence score
    </ResponseField>

    <ResponseField name="created_at" type="string">
      Creation timestamp (RFC3339)
    </ResponseField>

    <ResponseField name="entity_type" type="string" required>
      Entity type
    </ResponseField>

    <ResponseField name="has_embedding" type="boolean" required>
      Whether entity has an embedding vector
    </ResponseField>

    <ResponseField name="id" type="string" required>
      Unique entity ID
    </ResponseField>

    <ResponseField name="name" type="string" required>
      Entity name
    </ResponseField>

    <ResponseField name="properties" type="object" required>
      Entity properties
    </ResponseField>

    <ResponseField name="updated_at" type="string">
      Last update timestamp (RFC3339)
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="errors" type="string[]" required />

<ResponseField name="failed" type="integer" required />

### Status codes

| Code  | Meaning                                            |
| ----- | -------------------------------------------------- |
| `200` | Per-item results; failures reported individually   |
| `400` | Batch exceeds max\_batch\_size                     |
| `401` | Unauthorized — missing or invalid credentials      |
| `403` | Forbidden — the key/token lacks the required scope |
| `429` | Rate limited — see Retry-After / X-RateLimit-Reset |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.nsr.stateset.com/api/v1/entities/batch' \
    --header 'X-API-Key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "entities": [
      {
        "entity_type": "string",
        "name": "string",
        "properties": {}
      }
    ]
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "created": 1,
    "entities": [
      {
        "confidence": 1,
        "created_at": "string",
        "entity_type": "string",
        "has_embedding": true,
        "id": "string",
        "name": "string",
        "properties": {},
        "updated_at": "string"
      }
    ],
    "errors": [
      "string"
    ],
    "failed": 1
  }
  ```
</ResponseExample>
