# Create or update records (upsert)

> 🔐 **Required role:** `RECD_C`
📖 **Data dictionary:** [Records and custom record types](/reference/data-dictionary/custom-record)

**Create or update records (upsert)**
Records are created if they don't exist, or updated if matched by systemRef.
**Partial Success Behavior:**
- Each record is processed independently
- Successful records are persisted even if others fail
- Check
`summary.failed`
 and individual
`records[].status`
 for failures
- Failed records include error details in
`records[].error`

**Read-only and hidden custom fields:** values sent for them are ignored and the stored values are kept.
**Limits:** Maximum 100 records per request.
**Business Applications:**
- Bulk record import
- Entity synchronization

Endpoint: POST /api/v1/records
Version: 1.0.0
Security: BearerAuth, CfAccessClientId, CfAccessClientSecret

## Security:

  - `BearerAuth` (unknown)
    http bearer JWT

  - `CfAccessClientId` (unknown)
    apiKey in header CF-Access-Client-Id

  - `CfAccessClientSecret` (unknown)
    apiKey in header CF-Access-Client-Secret

## Request fields (application/json):

  - `records` (array, required)
    Records

  - `records.type` (string)
    Type

  - `records.systemRef` (object | null)
    Systemref

  - `records.attributes` (object)
    Attributes

## Response 200:

  - `200` (unknown)
    Records processed successfully

## Response 200 fields (application/json):

  - `data` (object)

  - `data.summary` (object, required)
    Summary

  - `data.records` (array, required)
    Records

  - `data.records.type` (string, required)
    Type

  - `data.records.systemRef` (object | null)
    Systemref

  - `data.records.status` (string, required)
    Status

  - `data.records.aiwynId` (integer | null)
    Aiwynid

  - `data.records.error` (object | null)
    Error

  - `error` (object | null)

  - `meta` (object)

  - `meta.success` (boolean)

  - `meta.message` (string)

  - `meta.timestamp` (string)

  - `meta.version` (string)

## Response 400:

  - `400` (unknown)
    Invalid request data

## Response 401:

  - `401` (unknown)
    Unauthorized - Invalid or missing authentication token

## Response 403:

  - `403` (unknown)
    Forbidden - Insufficient permissions (requires RECD_C)

## Response 500:

  - `500` (unknown)
    Internal server error

