# POST /opportunities/bulk-create

**Resource:** [Opportunities](./opportunities.md)  
**Scopes:** `opportunities:write`  
**Write operation:** yes

Create up to 100 opportunities in a single request. Built for historical migrations and bulk data loads. Top-level pipeline_id/stage_id act as defaults inherited by each record unless overridden. Set skip_automations: true (strongly recommended for imports) to suppress deal_created triggers across all records. Returns a created array and an errors array so partial successes can be recovered from without duplicating work on retry. Legacy alias: POST /deals/bulk-create.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `records` | body | object[] | yes | Array of opportunity objects (max 100). Each requires name plus any optional fields (contact_id, customer_id, pipeline_id, stage_id, status, value, notes, tags, metadata, etc.). |
| `pipeline_id` | body | uuid | no | Default pipeline UUID applied to every record unless the record sets its own. |
| `stage_id` | body | uuid | no | Default stage UUID applied to every record unless the record sets its own. |
| `skip_automations` | body | boolean | no | Set true to suppress deal_created triggers across all records. Strongly recommended for historical imports. |

## Request example

```bash
curl -X POST \
  "https://api.trustpager.com/functions/v1/api/v1/opportunities/bulk-create" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "pipeline_id": "pipe-uuid",
    "stage_id": "stage-uuid",
    "skip_automations": true,
    "records": [
      { "name": "Opportunity A", "contact_id": "contact-uuid-1", "value": 1500 },
      { "name": "Opportunity B", "contact_id": "contact-uuid-2", "value": 2000 }
    ]
  }'
```

## Response example

```json
{
  "data": {
    "created": [
      { "index": 0, "id": "opp-uuid-1", "name": "Opportunity A", ... },
      { "index": 1, "id": "opp-uuid-2", "name": "Opportunity B", ... }
    ],
    "errors": [],
    "created_count": 2,
    "error_count": 0
  },
  "meta": { "credits_remaining": 9480 }
}
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`