Import / Export API · exports
A page of the rows an export with these options would write
GET /exports/{target}/preview
A page of the rows an export with these options would write, as JSON: every column the target can write, the columns this export writes, up to limit matching rows of cell text starting offset matching rows in, and whether more match after them.
Takes the same columns, rules, from/to and catalogId as POST /exports, so what the preview shows is what the file holds. A read: records no export.
Access
Requires imports:read.
How scopes come from roles: Scopes and roles. Getting a token: Authentication and app tokens.
AI agent tool
Agents call this as imports_preview_export (Imports: Preview export), in the imports toolset. It only reads.
Connecting an agent: AI agents.
Example
curl -X GET 'https://import.getmanifold.io/exports/inventory.item/preview?columns=sku%2Cname%2ClocationId%2Cquantity&rules=%5B%7B%22column%22%3A%22quantity%22%2C%22op%22%3A%22greater-than%22%2C%22value%22%3A%220%22%7D%5D&limit=25' \
-H "Authorization: Bearer $MANIFOLD_TOKEN"const response = await fetch("https://import.getmanifold.io/exports/inventory.item/preview?columns=sku%2Cname%2ClocationId%2Cquantity&rules=%5B%7B%22column%22%3A%22quantity%22%2C%22op%22%3A%22greater-than%22%2C%22value%22%3A%220%22%7D%5D&limit=25", {
method: "GET",
headers: { Authorization: `Bearer ${process.env.MANIFOLD_TOKEN}` },
});
if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`);
const answer = await response.json();{
"target": "inventory.item",
"columns": [
"sku",
"name",
"locationId",
"quantity"
],
"headers": [
"sku",
"name",
"locationId",
"quantity"
],
"offset": 0,
"rows": [
[
"MUG-SPECKLE",
"Speckled stoneware mug",
"loc_01a0f6b0-1100-7e51-8f62-7a8b9cadbec4",
"116"
],
[
"BOWL-SALT-L",
"Salt-glaze serving bowl, large",
"loc_01a0f6b0-1100-7e51-8f62-7a8b9cadbec4",
"40"
]
],
"hasMore": false
}The panel writes this call in other languages. It does not send it: Manifold's APIs do not take calls from a web
page on another site, so run the call from your own code or terminal. The whole API as OpenAPI: import-export.openapi.json. Base URL https://import.getmanifold.io.
Errors
Every refusal is a status and a JSON body whose _tag names it. A refused call changes nothing.
401
| Refusal | What it means | What to do |
|---|---|---|
Unauthorized reason | The token is missing, expired or not one Manifold issued. | Get a fresh token and send the call again. |
TokenAlreadyUsed tokenId | A single-use app token was already spent. | Mint a new token for this call. |
402
| Refusal | What it means | What to do |
|---|---|---|
SubscriptionRequired status | The organization's subscription has lapsed, so writes are refused. | An owner settles billing. Reads still work meanwhile. |
403
| Refusal | What it means | What to do |
|---|---|---|
TenantRequired userId | The token names no organization. | Choose the organization, then get a new token. |
ScopeRequired required | The token's roles do not grant the scope this call needs. | Ask an owner or admin for a role that grants it. |
409
| Refusal | What it means | What to do |
|---|---|---|
MirroredFromSource source | This area is fed by your source system until the organization goes live. | Make the change in the source system, or go live first. |
422
| Refusal | What it means | What to do |
|---|---|---|
InvalidExportOptions reason, column | The export names a column or filter the target does not have. | Use the target's own columns. |
503
| Refusal | What it means | What to do |
|---|---|---|
RequestLogUnavailable tokenId, reason | The service could not record the request, so it did nothing. | Try again shortly. |
How refusals work everywhere: Errors.