Save an export column preset
AI agents: read /llms.txt; add .md to any page URL. This page as Markdown: /reference/data-exports/v1-data-export-presets-store.md. Index of every page and the rules for every call: /llms.txt. Guides and concepts in one file: /llms-full.txt. OpenAPI: /openapi.json.
POST/
Saves a named set of columns for one export type. By default it is a personal preset that only you see. The team owner can save it as the team default (is_team_default: true), which is shared with everyone and replaces the previous default for that type.
Presets can't be edited: delete one and save it again.
Business rules
nameis required, up to 120 characters, and not blank. Names don't have to be unique.typemust be one of the nine export types, andcolumnsa non-empty list of that type's column ids.- Saving a team default turns off
is_team_defaulton the type's previous default. That preset stays shared.
Path parameters
Your team slug, shown as Team ID next to your API key in Profile.
- Example
your-team
- Example
Request body
application/json, required.
Column ids for this type, in file order. Repeats are dropped. See the definitions operation.
- At least 1 item
Spaces at either end are removed.
- 1 to 120 characters
- One of:
"customer_list","sales_order_list","invoice_list","invoice_item_list","payment_list","purchase_order_list","tax_list","simple_product_list","variant_product_list"
- One of:
is_team_defaultbooleanTeam owner only. Shares the preset with the team as the default for this type.
- Default
false
- Default
Response
201Successful response.
Child fields (6)
Child fields (2)
columnsarray of stringsColumn ids, in file order. Send them as
columnswhen you create an export.schema_versionintegerVersion of the column list (1).
The preset id. Use it to delete the preset.
The team's default preset for this type. At most one per type.
- One of:
"customer_list","sales_order_list","invoice_list","invoice_item_list","payment_list","purchase_order_list","tax_list","simple_product_list","variant_product_list"
- One of:
Your user id (a hash id) for a personal preset; null for a shared team preset.
Errors
401The API key is missing or wrong (
unauthenticated).403You are not the team owner and sent
is_team_default: true.- When
- You are not the team owner and sent
is_team_default: true(team_default_forbidden, "Only the team owner can set a team default."). - Fix
- Save it as a personal preset, or ask the team owner.
404Not found.
page_not_found: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's.code: null, with a message that starts "No query results for": there is no record with that id.422The request was refused and changed nothing.
validation_failedlists what to fix inerror.fields; other codes name a business rule, explained inerror.message. A few checks answer with only{"message": "..."}. An operation that calls another service (a payment provider, a carrier, an accounting app) can answerconnect_timeout("Please retry again") when that service does not answer in time: the change may or may not have happened there, so read the record back before you retry.- When
nameis missing, blank, not a string or over 120 characters;typeis missing or not a string; oris_team_defaultis not a boolean (invalid_export_request, "Enter a valid preset name, export type and default setting.").- Fix
- Send a
nameof 1 to 120 characters, atype, andis_team_defaultastrueorfalseor not at all. - When
columnsis missing or not a list (invalid_export_request, "The selected export columns are invalid.").- Fix
- Send
columnsas a list of column ids. - When
typeis not one of the nine export types (invalid_export_request, "Unsupported export type.").- Fix
- Use a type the definitions operation lists.
- When
- A column id is not one of this type's columns, or is not a string (
invalid_export_request, "The selected export columns are invalid."), orcolumnsis empty ("Select at least one export column."). - Fix
- Use column ids the definitions operation lists for this type.
Notes
- Each refusal names the first problem only. The checks run in the order of the errors above: name, type and default setting;
columnsis a list;typeis known; the column ids; and only then the team owner check. - These 422 answers have no
error.fields: the problem is inerror.message, for example{"status": 422, "success": false, "error": {"code": "invalid_export_request", "message": "Unsupported export type."}}.
Related
- GETList export column presets
/v1/ api/ store/ {team_slug}/ data_export/ presets - GETList export types and their columns
/v1/ api/ store/ {team_slug}/ data_export/ definitions
