Skip to main content
POST
← Files Open the session that imports a file, for a template, without sending the file again. 201 Created when it creates the session, 200 OK when it reuses one that was open for this file and template. Sending another sheet_name or header_row than the open session’s replaces it, with what had been done in it, and answers 201. It always answers a session or an error, never a list of tabs in place of a session: a workbook with several tabs and no sheet_name is 422 SHEET_REQUIRED, with the tabs in error_params.sheets.
Beta. Part of the Import API, in beta. The contract may still change before general availability.

Request

Path Parameters

string
required
The file’s id: an uploaded spreadsheet (csv, xlsx, xls) of the organization in x-organization-id.

Headers

string
required
Your API key.
string
required
The organization that owns the file.

Body

Unknown fields are rejected.
string
required
The import template.
string
The tab to import. Required for a workbook with several tabs. See Get a File’s Sheets.
integer
The 0-based row with the column names. Without it, the one detected.
string
The facility, for templates that ask for one. Without it, the one the file was uploaded with.
string
upstream or downstream, for templates that ask for one. Without it, the one the file was uploaded with.
Templates that ask for other context take the fields of POST /v2/imports/sessions: block_id, lca_distribution_name, weight_type, product_weight, target_organization_id, measurement_campaign_id, lca_id, target_block_id and negative_purchases.

Response

The session, as POST /v2/imports/sessions answers it. import_id is what the importer’s next routes take (mapping, validate, submit). A context field the template requires and nobody sent does not stop the session: it is asked for at submit.

Errors

Errors are problem details. 404 NOT_FOUND, 422 SHEET_REQUIRED, 422 FILE_NOT_IMPORTABLE (an unknown template, a file that is not an uploaded spreadsheet or has no rows), 403 IMPORT_TEMPLATE_NOT_IN_PLAN, 400 IMPORT_FILE_TOO_LARGE, 503 IMPORT_HEAVY_OPERATION_BUSY, 422 REQUEST_VALIDATION_FAILED, the importer’s own errors about the context it was sent, and 429 beyond the rate limits.

Get a File's Sheets

The tabs of a workbook

Upload a File (v2)

Upload one file in one call