> ## 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 triples

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

Batch create triples.

**Required scope:** `write`

### Request body

`BatchCreateTriplesRequest`

<ParamField body="triples" type="CreateTripleRequest[]" required />

### Response

`BatchCreateTriplesResponse`

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

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

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

<ResponseField name="triples" type="TripleResponse[]" required>
  <Expandable title="TripleResponse">
    <ResponseField name="confidence" type="number (float)" required />

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

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

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

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

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

    <ResponseField name="valid_from" type="string" />

    <ResponseField name="valid_to" type="string" />
  </Expandable>
</ResponseField>

### 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/triples/batch' \
    --header 'X-API-Key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "triples": [
      {
        "confidence": 1,
        "object_id": "string",
        "predicate": "string",
        "subject_id": "string",
        "valid_from": "string",
        "valid_to": "string"
      }
    ]
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "created": 1,
    "errors": [
      "string"
    ],
    "failed": 1,
    "triples": [
      {
        "confidence": 1,
        "object": "string",
        "object_name": "string",
        "predicate": "string",
        "subject": "string",
        "subject_name": "string",
        "valid_from": "string",
        "valid_to": "string"
      }
    ]
  }
  ```
</ResponseExample>
