List Market Segments
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/vehicles/market_segments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/vehicles/market_segments"
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/v1/vehicles/market_segments \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"array": {}
}List Market Segments
The accepted values for a vehicle’s market segment, so you can validate before creating or updating a vehicle
GET
/
v1
/
vehicles
/
market_segments
List Market Segments
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/vehicles/market_segments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/vehicles/market_segments"
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/v1/vehicles/market_segments \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"array": {}
}← Vehicles API
List the values accepted for a vehicle’s market segment. The segment is what distinguishes a supermini from an executive car when the emission factor depends on vehicle class, so sending a value that is not in this list is rejected at write time.
Size and market segment are separate fields and separate lists — a vehicle can carry both, and neither constrains the other.
The path uses an underscore:
market_segments. Most routes in the Vehicles API separate words with hyphens (bulk-delete-by-filters), but this one does not.The hyphenated spelling does not 404 — it is captured by GET /v1/vehicles/{vehicle_id} and returns 422 complaining that market-segments is not a valid UUID. An error about a vehicle id is the signal that you spelled this path with a hyphen.A fixed list, not your data. The response is the enumeration itself — it does not depend on your organization, never paginates, and does not change unless the platform adds a segment. Fetch it once and cache it, or hardcode it from this page and use the endpoint as the check that your copy is still current.
Request
Headers
string
required
Your API key.
string
required
UUID of your organization.Format: UUID
The organization header is required even though the list is global. The endpoint takes no query parameters and the response is identical for every organization, but the router’s authentication dependency resolves an organization from this header before the handler runs. Omitting it returns
422, not 401.Response
Returns a flat array of strings, not an object wrapping one.array[string]
The nine accepted market segments:
mini · supermini · lower_medium · upper_medium · executive · luxury · sports · dual_purpose_4x4 · mpvExample
curl -X GET "https://api.dcycle.io/v1/vehicles/market_segments" \
-H "x-api-key: YOUR_API_KEY" \
-H "x-organization-id: YOUR_ORGANIZATION_ID"
import requests
segments = requests.get(
"https://api.dcycle.io/v1/vehicles/market_segments",
headers={
"x-api-key": "YOUR_API_KEY",
"x-organization-id": "YOUR_ORGANIZATION_ID",
},
timeout=30,
).json()
# The response is the list itself — no unwrapping
def valid_segment(value):
return value in segments
const response = await fetch(
"https://api.dcycle.io/v1/vehicles/market_segments",
{
headers: {
"x-api-key": "YOUR_API_KEY",
"x-organization-id": "YOUR_ORGANIZATION_ID",
},
},
);
const segments = await response.json();
const validSegment = (value) => segments.includes(value);
Successful Response
Returns200 OK.
[
"mini",
"supermini",
"lower_medium",
"upper_medium",
"executive",
"luxury",
"sports",
"dual_purpose_4x4",
"mpv"
]
Common Errors
422 Unprocessable Entity
Cause:x-organization-id is missing. This fires before any credential check, so it is what you get from a request with no headers at all.
{
"detail": [
{
"loc": ["header", "x-organization-id"],
"msg": "field required",
"type": "value_error.missing"
}
]
}
401 Unauthorized
Cause: The organization header is present but the credentials are not.{
"code": "CREDENTIALS_REQUIRED",
"detail": "Credentials required (API key or JWT token)"
}
Vehicle Sizes
The Vehicles API exposes a second enumeration of the same shape atGET /v1/vehicles/sizes, with the same headers — x-organization-id included — and the same flat-array response. Its four values are:
["small_car", "medium", "large_car", "average_car"]
Use Cases
Validate before you write
When your integration lets a user pick a segment, populate the choice from this endpoint rather than from a hardcoded list that can drift. A value that is not in the list is rejected when you create or update the vehicle, so catching it at selection time turns a write failure into a closed dropdown.Check a hardcoded copy is still current
If you prefer to ship the nine values in your own code, call this endpoint in a test and assert the two lists match. That way a segment added on the platform surfaces as a failing test instead of as user input your form silently refuses.Related Endpoints
Create Vehicle
Where the market segment is sent
Update Vehicle
Change the segment on an existing vehicle
List Vehicle Fuels
The other catalogue you need before creating a vehicle
Vehicles API
Everything the Vehicles API covers
Was this page helpful?