← ImportsRetrieve the metadata for a backend import template, including its column definitions, validation rules, and required context fields. Templates define the expected structure of an import file.
Templates are static configuration — not organization-specific. Any authenticated caller can fetch any template.
Request
Headers
string
required
Your API key for authenticationExample:sk_live_1234567890abcdef
Path Parameters
string
required
Template identifierExamples:logistics_requests, purchases, wastes, invoices_electricity, transport_routesThere is no endpoint that lists the available identifiers. For the social ones — own_workforce,
own_workforce_trainings and own_workforce_accidents_absenteeisms — see
Own Workforce Import Templates.
Response
string
Template identifier
string | null
Human-readable description of the template
array[object]
Column definitions for this template
Show Column Object
string
Internal column key (used in mapping)
string
Human-readable label
string
Data type: string, number, date, category, boolean
boolean
Whether this column must be mapped
array[string]
Alternative names recognized during auto-mapping (e.g. ["peso", "weight_kg"])
array[string] | null
Fixed list of allowed values for category columns
string | null
Dynamic option provider key (e.g. fuel_types, countries). Use Get Options Source to resolve values.
object | null
Narrows the options of a category column per row by the value of another column of that row: column names that column and allowed maps each of its values to the option values valid for it (an empty list: none, leave the cell blank). A row whose column value is not a key of allowed may take any option. For example, the fuel_type column of business_travels is filtered by transport_type (train allows diesel, do_not_know, electric_not_renewable and electric_renewable).
any
Default value applied when the cell is empty
array[object]
Validation rules applied to this column (e.g. {rule: "range", params: {min: 0}})
boolean
true when this column may take its values from the same source column as another column that also allows it. For example, in facility consumption imports one CUPS column can both identify the facility (facility_id) and fill cups_code.
array[string]
Context fields that must be provided at session creation (e.g. ["facility_id"] for wastes)
array[string]
Context fields that can be provided at submit time
array[string]
Columns included in the submitted output
object
Global default values applied across all columns
Example
curl -X GET "https://api.dcycle.io/v2/imports/templates/logistics_requests" \ -H "x-api-key: ${DCYCLE_API_KEY}"
import requestsimport osheaders = {"x-api-key": os.getenv("DCYCLE_API_KEY")}response = requests.get( "https://api.dcycle.io/v2/imports/templates/logistics_requests", headers=headers,)template = response.json()print(f"Template: {template['template_id']}")print(f"Columns ({len(template['columns'])}):")for col in template["columns"]: req = " (required)" if col["required"] else "" print(f" {col['key']} [{col['type']}]{req} — {col['label']}")