Get Provider Options
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v2/imports/options/{source_key}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v2/imports/options/{source_key}"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.dcycle.io/v2/imports/options/{source_key} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"source_key": "<string>",
"options": {
"value": "<string>",
"label": "<string>"
}
}Get Provider Options
Resolve an imports options_source key into selectable value/label pairs
GET
/
v2
/
imports
/
options
/
{source_key}
Get Provider Options
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v2/imports/options/{source_key}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v2/imports/options/{source_key}"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.dcycle.io/v2/imports/options/{source_key} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"source_key": "<string>",
"options": {
"value": "<string>",
"label": "<string>"
}
}Get Provider Options
Use this endpoint when an imports template column exposesoptions_source instead of inline options.
It resolves backend-managed provider keys such as countries, logistics_tocs, and fuels
into a simple list of selectable values:
value: the canonical value the backend validates and storeslabel: the display label a client can show in dropdowns or selectors
This endpoint is especially useful for the Imports Mapping and Review steps, where a client needs to populate
category dropdowns without hardcoding reference data.
Request
Path Parameters
string
required
Provider key declared by a template column’s
options_source.Supported keys are defined by the template metadata. Common examples include:countrieslogistics_tocsfuels
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faResponse
string
The provider key that was resolved.
array[object]
Example
Fetch country options
curl -X GET "https://api.dcycle.io/v2/imports/options/countries" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}"
import os
import requests
response = requests.get(
"https://api.dcycle.io/v2/imports/options/countries",
headers={
"x-api-key": os.environ["DCYCLE_API_KEY"],
"x-organization-id": os.environ["DCYCLE_ORG_ID"],
},
timeout=30,
)
payload = response.json()
for option in payload["options"][:5]:
print(option["value"], option["label"])
const axios = require('axios');
axios.get('https://api.dcycle.io/v2/imports/options/countries', {
headers: {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID,
},
}).then((response) => {
response.data.options.slice(0, 5).forEach((option) => {
console.log(option.value, option.label);
});
});
Successful Response
{
"source_key": "countries",
"options": [
{
"value": "es",
"label": "Spain"
},
{
"value": "fr",
"label": "France"
},
{
"value": "pt",
"label": "Portugal"
}
]
}
Typical Usage In The Imports Flow
- Call
GET /v2/imports/templates/{template_id}. - Inspect each column.
- If a category column has inline
options, render those directly. - If a category column has
options_source, callGET /v2/imports/options/{source_key}. - Render the returned
value/labelpairs in the UI.
countrymay useoptions_source="countries"fuelmay useoptions_source="fuels"for canonical logistics recharge fuel namestocmay useoptions_source="logistics_tocs"
Common Errors
401 Unauthorized
Cause: Missing or invalid API key{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}
403 Forbidden
Cause: The authenticated user is not a member of the organization{"detail": "Logged User is not Member of Organization", "code": "LOGGED_USER_NOT_MEMBER"}
404 Not Found
Cause: Unknownsource_key
{
"detail": "Options source 'unknown' not found",
"code": "IMPORT_OPTIONS_SOURCE_NOT_FOUND"
}
options_source key.
Related Endpoints
Get Template
Get the template that defines available options sources
Create Import Session
Start a new import session
Suggest Mapping
Auto-map columns using AI
Imports Overview
Learn about the Imports API
Was this page helpful?