<!-- https://pricto.dev/docs/api/create-export · Spanish version: https://pricto.dev/docs/api/create-export.md -->

# Create a bulk export

`POST https://pricto.dev/v1/exports`

> **Planned.** Not available yet: today it answers `501 not_implemented`.

Exports offers, products or observations matching the filters as CSV, JSONL or Parquet. Returns a job; when `status` is `succeeded`, `files` contains signed download URLs valid for 24 hours. Planned; returns 501 for now.

| Credits | MCP |
|---|---|
| 1 per 10 rows | — |

## Parameters

| Parameter | In | Type | Description |
|---|---|---|---|
| `Idempotency-Key` | header | `string` |  |

## Body

| Field | Type | Description |
|---|---|---|
| `dataset` **required** | `string` | Valores / values: `offers`, `products`, `observations`. |
| `format` **required** | `string` | Valores / values: `csv`, `jsonl`, `parquet`. |
| `filters` | `object` |  |
| `filters.country` | `string` |  |
| `filters.retailer` | `string[]` |  |
| `filters.category` | `string` |  |
| `filters.from` | `string (date)` |  |
| `filters.to` | `string (date)` |  |
| `currency` | `string` |  |
| `lang` | `string` | Valores / values: `es`, `en`. |

## Response

`202` Export job accepted.

| Field | Type | Description |
|---|---|---|
| `data` | `Job` |  |
| `data.id` **required** | `string` |  |
| `data.status` **required** | `string` | Valores / values: `queued`, `running`, `succeeded`, `failed`. |
| `data.created_at` | `string (date-time)` |  |
| `data.finished_at` | `string (date-time) \| null` |  |
| `data.rows` | `integer \| null` |  |
| `data.files` | `object[]` |  |
| `data.files[].url` | `string (uri)` |  |
| `data.files[].bytes` | `integer` |  |
| `data.files[].expires_at` | `string (date-time)` |  |
| `data.error` | `object` |  |
| `meta` | `Meta` |  |

`meta` carries the cost, the source line to quote, the language, the currency and notices (see [Conventions](/docs/convenciones)).

## Errors

- [`not_implemented`](/docs/errores#not_implemented)

## Example

```bash
curl -X POST "https://pricto.dev/v1/exports" \
  -H "Authorization: Bearer sk_test_sandbox" \
  -H "Content-Type: application/json" \
  -d '{"dataset":"offers","format":"csv","filters":{"country":"CL"}}'
```
```python
import requests

API_KEY = "sk_test_sandbox"

r = requests.post(
    "https://pricto.dev/v1/exports",
    json={
        "dataset": "offers",
        "format": "csv",
        "filters": {
            "country": "CL",
        },
    },
    headers={"Authorization": f"Bearer {API_KEY}"},
)
print(r.status_code, r.json())
```
```js
const API_KEY = "sk_test_sandbox";

const res = await fetch("https://pricto.dev/v1/exports", {
  method: "POST",
  headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    "dataset": "offers",
    "format": "csv",
    "filters": {
      "country": "CL"
    }
  }),
});
console.log(res.status, await res.json());
```

```json
{
  "type": "https://pricto.dev/docs#not_implemented",
  "title": "Todavía no disponible",
  "status": 501,
  "code": "not_implemented",
  "detail": "Exports está planificado y todavía no está disponible.",
  "hint": "Para volúmenes grandes usa /offers con format=csv y paginación.",
  "request_id": "req_ba9b60c252c94a6cb5e3",
  "docs_url": "https://pricto.dev/docs#not_implemented"
}
```
