Skip to main content
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));
{
  "source_key": "<string>",
  "options": {
    "value": "<string>",
    "label": "<string>"
  }
}

Get Provider Options

Use this endpoint when an imports template column exposes options_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 stores
  • label: 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

source_key
string
required
Provider key declared by a template column’s options_source.Supported keys currently include:
  • countries
  • logistics_tocs
  • fuels

Headers

x-api-key
string
required
Your API key for authentication.
x-organization-id
string
required
Your organization UUID.

Response

source_key
string
The provider key that was resolved.
options
array[object]
List of resolved option objects.

Examples

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}"

Successful response

{
  "source_key": "countries",
  "options": [
    {
      "value": "es",
      "label": "Spain"
    },
    {
      "value": "fr",
      "label": "France"
    },
    {
      "value": "pt",
      "label": "Portugal"
    }
  ]
}

Typical Usage In The Imports Flow

  1. Call GET /v2/imports/templates/{template_id}.
  2. Inspect each column.
  3. If a category column has inline options, render those directly.
  4. If a category column has options_source, call GET /v2/imports/options/{source_key}.
  5. Render the returned value / label pairs in the UI.
For example:
  • country may use options_source="countries"
  • fuel may use options_source="fuels" for canonical logistics recharge fuel names
  • toc may use options_source="logistics_tocs"

Common Errors

404 Not Found

Cause: Unknown source_key
{
  "detail": "Options source 'unknown' not found",
  "code": "IMPORT_OPTIONS_SOURCE_NOT_FOUND"
}
Solution: Make sure the template actually uses that options_source key.