> For the complete documentation index, see [llms.txt](https://developer.abacum.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.abacum.ai/guides/import-api-guides/load-data.md).

# Load data

Send a file to an Import API dataset, and check the result.

Send one `.csv` or `.xlsx` file to `POST /public-api/load-data`. Abacum loads it into the dataset that matches the dataset code. You need a user with the Admin role, and a dataset set up for the Import API. See [Set up the Import API](/guides/import-api-guides/set-up-the-import-api.md).

## Request

Send the request as `multipart/form-data`.

| Field          | Required | Description                                                                                                                                                  |
| -------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `file`         | Yes      | The `.csv` or `.xlsx` file. Maximum 512 MB. See [File requirements](/guides/import-api-guides/file-requirements.md).                                         |
| `dataset_code` | Yes      | The code of the target dataset, from the dataset details sidebar.                                                                                            |
| `months`       | Yes      | The months that the file covers, in `YYYY-MM` format. Send at least one. Repeat the field for each month.                                                    |
| `override`     | No       | Set to `true` to replace the existing data for those months. Default `false`. See [Override and re-load](/guides/import-api-guides/override-and-re-load.md). |

```bash
curl -X POST https://api.abacum.io/public-api/load-data \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -F "file=@actuals_2026_q1.csv" \
  -F "dataset_code=YOUR_DATASET_CODE" \
  -F "months=2026-01" \
  -F "months=2026-02" \
  -F "months=2026-03" \
  -F "override=false"
```

To load several months from one file, list each month in `months`. If you have one file for each month, send one request for each month.

## What happens next

A successful call returns `200` with the body `{}`. Abacum then starts to process the file by itself. It uses the same pipeline as the native integrations: it applies the typing layer and sends the rows to the correct months.

{% hint style="info" %}
To check the status of a load, open the dataset in Abacum and go to the **Loads** tab. It shows the status of each month.
{% endhint %}

![The Loads tab of a dataset](https://2379578202-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCInB7hHJDdVbsWHHcmG6%2Fuploads%2FGiJMXIHs2FaiE8GfJFXf%2Fimport-api-loads-tab.gif?alt=media)

## Errors

| Status | Cause                                                                                                  | Message                                                                               |
| ------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------- |
| `400`  | A required field is missing                                                                            | `This field is required.`                                                             |
| `400`  | `months` is empty                                                                                      | `At least one month must be provided.`                                                |
| `400`  | A month is not in `YYYY-MM` format                                                                     | `Date has wrong format.`                                                              |
| `400`  | `override` is not a boolean                                                                            | `Must be a valid boolean.`                                                            |
| `400`  | The file is not `.csv` or `.xlsx`                                                                      | `Upload failed. File format must be .csv or .xlsx.`                                   |
| `400`  | The file is larger than 512 MB                                                                         | `Upload failed. File size must not exceed 512 MB.`                                    |
| `400`  | The Import API is not enabled for the organization                                                     | `API data loads are not enabled for this organization.`                               |
| `400`  | The dataset does not use the Import API connection                                                     | `Dataset is not configured for API data loads.`                                       |
| `400`  | A month in `months` already has data and `override` is `false`. Abacum loads none of the months.       | `A load with the same dates already exists. Please delete it before or replace data.` |
| `403`  | The user cannot load data into this dataset                                                            | `You do not have permission to load data into this dataset.`                          |
| `404`  | No dataset matches the code                                                                            | `Dataset with code '...' not found.`                                                  |
| `422`  | A load for the same period is already in progress. Wait for it to finish, then send the request again. | A load for the same period is already in progress.                                    |
| `429`  | More than 10 requests in one minute                                                                    | Wait for the number of seconds in the `Retry-After` header.                           |

## Reference

## Load data into a dataset

> Triggers an actuals load for an existing dataset configured with an Import API connector.\
> \
> \*\*Prerequisites:\*\*\
> \- The organization must have the Import API setting enabled.\
> \- The target dataset must already exist in Abacum and use a connector of Import API type.\
> \
> \*\*Months format:\*\* each month is specified as \`YYYY-MM\` (e.g. \`2026-02\`).\
> To load multiple months from a single aggregated file, include multiple \`months\` values.\
> For individual files per month, make one request per month.\
> \
> \*\*Rate limit:\*\* 10 requests per minute for the same user and URL. Above that, the API answers \`429\` with a \`Retry-After\` header.<br>

```json
{"openapi":"3.0.0","info":{"title":"Abacum public API","version":"1.0.0"},"tags":[{"name":"Datasets","description":"List datasets, read their raw or processed data, and load actuals into them with the Import API."}],"servers":[{"url":"https://api.abacum.io","description":"Prod environment"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An access token from the token endpoint, sent as `Authorization: Bearer <access_token>`. Use it to try an endpoint from this page. The token carries the permissions of its user, so use a user with the lowest role that fits the call."}},"schemas":{"ErrorMessage":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"DetailMessage":{"type":"object","required":["detail"],"properties":{"detail":{"type":"string"}}}},"responses":{"TooManyRequests10PerMinute":{"description":"Rate limit exceeded: 10 requests per minute for the same user and URL. Wait the number of seconds in the `Retry-After` header, then retry.","headers":{"Retry-After":{"description":"Seconds to wait before the next request.","schema":{"type":"integer"}},"X-Request-ID":{"$ref":"#/components/headers/XRequestID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetailMessage"}}}}},"headers":{"XRequestID":{"description":"Identifier of this request. Quote it when you contact support so they can find the exact request. A server-side client can set it by sending an `X-Request-ID` request header of 1 to 64 characters from `A-Za-z0-9_-`; any other value is replaced by a generated one. Browsers can read this header but cannot send their own. The value identifies a request for support, but it is not proof that only one request used it.","schema":{"type":"string"}}}},"paths":{"/public-api/load-data":{"post":{"summary":"Load data into a dataset","description":"Triggers an actuals load for an existing dataset configured with an Import API connector.\n\n**Prerequisites:**\n- The organization must have the Import API setting enabled.\n- The target dataset must already exist in Abacum and use a connector of Import API type.\n\n**Months format:** each month is specified as `YYYY-MM` (e.g. `2026-02`).\nTo load multiple months from a single aggregated file, include multiple `months` values.\nFor individual files per month, make one request per month.\n\n**Rate limit:** 10 requests per minute for the same user and URL. Above that, the API answers `429` with a `Retry-After` header.\n","operationId":"loadDatasetData","tags":["Datasets"],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file","dataset_code","months"],"properties":{"file":{"type":"string","format":"binary","description":"CSV or XLSX file to load. Maximum size is 512 MB."},"dataset_code":{"type":"string","description":"Code of the target dataset."},"months":{"type":"array","minItems":1,"items":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"description":"List of target periods in YYYY-MM format. Must contain at least one month."},"override":{"type":"boolean","default":false,"description":"If true, overwrites existing data for the specified months."}}}}}},"responses":{"200":{"description":"Load successfully queued. The body is an empty JSON object. The response carries no load ID.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Validation error. The body has one of two shapes, depending on where validation failed.\n\n**Request validation** returns an object that maps each invalid field (`file`, `dataset_code`, `months`,\n`override`) to a list of messages. A bad value inside `months` is reported per item, keyed by its\nposition: `{\"months\": {\"0\": [\"Date has wrong format. Use one of these formats instead: YYYY-MM.\"]}}`.\n\n| Trigger | Message |\n|---|---|\n| `file` field missing | `\"This field is required.\"` |\n| `dataset_code` field missing | `\"This field is required.\"` |\n| `months` field missing | `\"This field is required.\"` |\n| `months` is an empty list | `\"At least one month must be provided.\"` |\n| Month not in YYYY-MM format | `\"Date has wrong format.\"` |\n| `override` is not a boolean | `\"Must be a valid boolean.\"` |\n| File extension is not .csv or .xlsx | `\"Upload failed. File format must be .csv or .xlsx.\"` |\n| File size exceeds 512 MB | `\"Upload failed. File size must not exceed 512 MB.\"` |\n\n**Load checks** return `{\"error\": [\"<message>\"]}`. The message sits in a list.\n\n| Trigger | Message |\n|---|---|\n| Organization setting disabled | `\"API data loads are not enabled for this organization.\"` |\n| Dataset connector is not Import API | `\"Dataset is not configured for API data loads.\"` |\n","content":{"application/json":{"schema":{"anyOf":[{"type":"object","description":"Request validation error. Maps each invalid field to a list of messages.","additionalProperties":true},{"type":"object","description":"Load check error.","required":["error"],"properties":{"error":{"type":"array","items":{"type":"string"}}}}]}}}},"403":{"description":"One of three causes:\n\n- The bearer token is missing, invalid or expired. The response has an empty body.\n- The token's user is not an Admin or Super Admin. The body is `{\"detail\": \"You do not have permission to perform this action.\"}`.\n- The user cannot access this dataset. The body is `{\"error\": \"You do not have permission to load data into this dataset.\"}`.\n\nThe API answers `403` for a bad token, not `401`.\n","content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["detail"],"properties":{"detail":{"type":"string"}}},{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}}]}}}},"404":{"description":"Dataset with the given code not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"422":{"description":"A load for the requested period range is already in progress. Wait for it to finish before retrying.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"array","items":{"type":"string"}}}}}}},"429":{"$ref":"#/components/responses/TooManyRequests10PerMinute"},"500":{"description":"The dataset has no connector, so the load cannot start. The response has an empty body."}}}}}}
```
