# Batch Operations

> Solarium docs. All requests are `POST https://api.trysolarium.com/graphql/` with `Authorization: Bearer <api key>` and a JSON body `{"query": ..., "variables": ...}`. Every query and mutation takes an `organizationId` (find it with `myOrganizations`). Index of all pages: https://trysolarium.com/llms.txt

All batch mutations accept up to **500 items** per call. Failures are per-item — one bad record does not roll back the others. Each item runs in its own database savepoint.

For bulk transaction import, use `importBankStatement` (see [Bank Import](#bank-import)) which accepts an array of rows and creates LedgerEvents.

## Batch Create Accounts

Create up to 500 accounts in a single call.

### Arguments

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organizationId` | `UUID!` | Yes | Organization ID |
| `items` | `[AccountInput!]!` | Yes | Array of accounts. Each: name (String!), accountType (String!), classification (String!), subType (String), parentId (UUID) |

### Request

```graphql
mutation {
  batchCreateAccounts(
    organizationId: "a1b2c3d4-..."
    items: [
      { name: "Office Supplies", accountType: "expense", classification: "expense" },
      { name: "Travel", accountType: "expense", classification: "expense" },
      { name: "Software", accountType: "expense", classification: "expense" }
    ]
  ) {
    created
    errors { index error }
  }
}
```

### Response

```json
{
  "data": {
    "batchCreateAccounts": {
      "created": 3,
      "errors": []
    }
  }
}
```

## Batch Create Contacts

Create up to 500 contacts in a single call.

### Arguments

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `organizationId` | `UUID!` | Yes | Organization ID |
| `items` | `[ContactInput!]!` | Yes | Array of contacts. Each: contactType (String!), displayName (String!), email (String), phone (String) |

### Request

```graphql
mutation {
  batchCreateContacts(
    organizationId: "a1b2c3d4-..."
    items: [
      { contactType: "vendor", displayName: "Staples" },
      { contactType: "vendor", displayName: "Amazon" }
    ]
  ) {
    created
    errors { index error }
  }
}
```

### Response

```json
{
  "data": {
    "batchCreateContacts": {
      "created": 2,
      "errors": []
    }
  }
}
```
