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

# Bulk Create Object Records

Create multiple records for a requested object in a single API call. This API is useful when you need to insert multiple records efficiently, reducing the number of API calls required.

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication, [click here](https://app.superleap.com/settings/apiAccess) to generate one
</ParamField>

<ParamField header="Content-Type" type="string" default="application/json" required>
  application/json
</ParamField>

### Path Parameters

<ParamField path="object_slug" type="string" required>
  The slug identifier for the object type you want to create records for (e.g., "lead", "user", "opportunity", "communication")
</ParamField>

### Body

<ParamField body="name" type="string">
  Name or title of the record
</ParamField>

<ParamField body="email" type="string">
  Email address associated with the record
</ParamField>

<ParamField body="phone" type="string">
  Phone number associated with the record
</ParamField>

<ParamField body="status" type="string">
  Initial status of the record
</ParamField>

<ParamField body="owner" type="string">
  ID of the user who should own this record
</ParamField>

<ParamField body="external_id" type="string">
  External reference ID for integration purposes
</ParamField>

### Example

#### Request

```bash theme={null}
curl --location 'https://app.superleap.dev/api/v1/org/objects/lead/record/bulk_create' \
--data-raw '[
    {
        "name": "test-8",
        "email":"test@gmail.com"
    },
    {
        "name": "test-9",
        "email":"test1@gmail.com"
    }
]'
```

#### Response 200 OK

```json theme={null}
{
    "success": true,
    "data": {
        "message": "records added successfully"
    }
}
```

#### Request with Multiple Fields

```bash theme={null}
curl --location 'localhost:8001/api/v1/org/objects/lead/record/bulk_create' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ***********' \
--data '[
    {
        "name": "John Smith",
        "email": "john.smith@example.com",
        "phone": "+1-555-123-4567",
        "status": "new",
        "external_id": "EXT-001",
        
    },
    {
        "name": "Jane Doe",
        "email": "jane.doe@example.com",
        "phone": "+1-555-987-6543",
        "status": "qualified",
        "external_id": "EXT-002",
        
    }
]'
```

#### Response 200 OK

```json theme={null}
{
    "success": true,
    "data": {
        "message": "records added successfully"
    }
}
```

#### Request for Failure Scenario

This example demonstrates how the API handles validation errors when the input data is not in the correct format

```bash theme={null}
curl --location 'https://app.superleap.dev/api/v1/org/objects/lead/record/bulk_create' \
--data-raw '[
    {
        "name": "test-8",
        "email":"test .sok@gmail.com"
    },
    {
        "name": "test-9",
        "email":"test1@gmail.com"
    }
]'
```

#### Response 400 Bad Request

```json theme={null}
{
    "success": false,
    "data": {
        "message": "Failed to create records",
        "status_code": 400,
        "error_code": "VALIDATION_FAILED",
        "validation_errors": [
            {
                "object_slug": "lead",
                "field": "email",
                "message": "invalid email format: test .sok@gmail.com",
                "error_code": "PARSE_INVALID_FORMAT",
                "record_index": 1,
                "meta_data": null
            }
        ],
        "meta_data": "validation failed :"
    }
}
```
