SmartRoutes Driver Questionnaires API
The Driver Questionnaires API from SmartRoutes — 2 operation(s) for driver questionnaires.
The Driver Questionnaires API from SmartRoutes — 2 operation(s) for driver questionnaires.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/smartroutes-io:smartroutes-io-driver-questionnaires-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: SmartRoutes Driver Questionnaires API
description: '# Getting started
## Introduction
The SmartRoutes API gives your software programmatic access to the SmartRoutes platform. You can manage the full delivery lifecycle from your own systems. Push orders and customers in from your ERP, e-commerce or WMS. Keep your fleet, capacities and zones in sync. Run route optimisation and dispatch plans to drivers. Then pull back what happened on the road: order statuses, proof of delivery photos and signatures, and driver questionnaire responses. The API also handles customer notifications and booking availability checks. Webhooks notify your systems in real time when orders change status, plans are dispatched or routes are completed. It''s a REST API over HTTPS that uses JSON and authenticates with an access key, which you generate in SmartRoutes under Settings > Integrations. ## Base URL
Every endpoint path in this reference is relative to this base URL:
https://api.smartroutes.io/v2
So `GET /orders` in this reference means `GET https://api.smartroutes.io/v2/orders`. **The documentation host is not the API host.** These docs are published at `smartroutes.io/api`, which serves this page and the OpenAPI spec only. Requests sent there do not reach the API — send them to the base URL above. ## Authentication
To use the API, you will need to generate an API Access Key for your SmartRoutes account. To generate, login to your SmartRoutes account and navigate to Settings > Integrations > SmartRoutes Open API and click ''Generate API Key''. For more details on SmartRoutes integrations, click here. All requests expect the API Access Key to be provided in the `x-access-key` header:
```http
x-access-key: YOUR_ACCESS_KEY
```
Two optional request headers are also recognised: `x-sr-api-features`, accepted on every endpoint (see API Features), and `idempotency-key`, honoured on the `POST` endpoints listed under Idempotency. Webhook deliveries from SmartRoutes to your receiver are authenticated differently — see Webhooks. ## Rate Limits
Every endpoint has a per-minute limit, and most also have a short burst limit. Requests are rejected as soon as either limit is hit. Most endpoints fall into one of these tiers:
| Tier | Rate limit | Description |
|---|---|---|
| Standard | 60 / min (max 5 / sec) | Single-resource reads and writes (e.g. `GET /orders/{id}`, `PUT /orders/{id}`) |
| Listing | 30 / min (max 5 / sec) | Paginated lists (e.g. `/customers`, `/plans`, `/routes`) |
| Reference | 60 / min (max 1 / sec) | Reference data (e.g. capacities, custom fields, vehicles, zone groups) |
| Bulk | 30 / min (max 1 per 2 sec) | Bulk creates and heavy deletes |
| Upload | 15 / min (max 1 / sec) | File uploads (e.g. `POST /orders/{id}/attachments`) |
The following endpoints have a stricter limit of **5 / min (max 2 per 15 sec)**:
- Plan optimisation: `POST /plans/optimise/orders`, `POST /plans/optimise/orders-for-ids`
- Booking availability: `POST /booking/availability`, `POST /booking/available-dates`, `POST /booking/available-slots`
- Route reversal: `POST /routes/{id}/reverse`
The two dispatch endpoints have the Standard per-minute allowance with a tighter burst, **60 / min (max 2 per 2 sec)**, because each call blocks for the full dispatch (up to two minutes):
- `POST /routes/{id}/dispatch`
- `POST /plans/{id}/dispatch`
When a limit is hit, the API returns HTTP **403** with a `Retry-After` header and `details.retry_after_seconds` in the body — both give the seconds until the limit resets. **Prefer `429`?** `403` is the status this API has always returned for rate limiting, and it stays the default so existing integrations keep working. Send `x-sr-api-features: rate-limit-429` and a tripped limit answers `429 Too Many Requests` with `name: "RATE_LIMIT_EXCEEDED"` instead. Nothing else about the response changes — `Retry-After` and `details.retry_after_seconds` are already sent on the `403`. See API Features. We may temporarily reduce these limits to protect platform stability.'
version: 2.0.0
contact:
name: SmartRoutes Support
email: support@smartroutes.io
url: https://smartroutes.io/support
servers:
- url: https://api.smartroutes.io/v2/
description: API base URL — every path in this reference is relative to it.
tags:
- name: Driver Questionnaires
paths:
/driver-questionnaire-submission/{id}:
get:
summary: Get a driver questionnaire submission by ID
operationId: getDriverQuestionnaireSubmissionById
description: 'Retrieve a driver questionnaire submission and its answers by submission ID.
A submission is attached to a route (`ROUTE_VEHICLE_CHECKIN`), a stop (`VISIT`), or one order at a stop (`VISIT_ORDER`). `VISIT_ORDER` submissions set `order_id`, and also `order_line_item_id` when they are about a single line item; both are `null` for the other types.
Each answer carries an `images` array of absolute URLs pointing at `GET /driver-questionnaire-images/{id}`. Only images the driver app has finished uploading are listed. Images are compressed asynchronously after upload, so a URL taken from this response may answer `202 Accepted` with a `Retry-After` header instead of image data if it is followed before compression finishes — apply the same retry logic described on that endpoint.'
tags:
- Driver Questionnaires
parameters:
- name: id
in: path
required: true
schema:
type: integer
description: Driver Questionnaire Submission ID
responses:
'200':
description: Driver Questionnaire Submission
content:
application/json:
schema:
type: object
properties:
driver_questionnaire_submission:
$ref: '#/components/schemas/DriverQuestionnaireSubmissionDetail'
example:
driver_questionnaire_submission:
id: 1266
route_id: 101838
visit_id: null
order_id: null
order_line_item_id: null
driver_questionnaire:
type: ROUTE_VEHICLE_CHECKIN
title: Route Questionnaire
driver_questionnaire_answers:
- id: 4028
type: CHECKBOX
data: '1'
driver_questionnaire_question:
type: CHECKBOX
question: Checkbox Question?
images: []
- id: 4029
type: TEXT
data: Depot
driver_questionnaire_question:
type: TEXT
question: What is the starting location?
images: []
- id: 4030
type: SELECT
data: '1'
driver_questionnaire_question:
type: SELECT
question: Select an option?
images: []
- id: 4031
type: MULTI_SELECT
data: '1'
driver_questionnaire_question:
type: MULTI_SELECT
question: Select all that applies?
images: []
- id: 4032
type: MULTI_SELECT
data: '3'
driver_questionnaire_question:
type: MULTI_SELECT
question: Select all that applies?
images: []
- id: 4033
type: MULTI_SELECT
data: '2'
driver_questionnaire_question:
type: MULTI_SELECT
question: Select all that applies?
images: []
- id: 4034
type: SIGNATURE
data: 90e4486d-dfcf-4007-90d7-7a169b5c89c0
driver_questionnaire_question:
type: SIGNATURE
question: Did you get a signature?
images:
- https://api.smartroutes.io/v2/driver-questionnaire-images/1034
- id: 4035
type: PHOTO
data: f6c356a0-4622-468c-a6c0-78f11446fd09
driver_questionnaire_question:
type: PHOTO
question: 'Uploaded the photo? '
images:
- https://api.smartroutes.io/v2/driver-questionnaire-images/1035
'404':
$ref: '#/components/responses/NotFound'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/ServerError'
/driver-questionnaire-images/{id}:
get:
summary: Get Driver Questionnaire Image
operationId: getDriverQuestionnaireImageById
description: 'Retrieve a driver questionnaire image (photo or signature) by its ID. The IDs come from the `images` arrays on `GET /driver-questionnaire-submission/{id}`. By default returns the raw image binary. Use the `encoding` query parameter to request a Base64-encoded JSON response instead.
Images are compressed asynchronously after the driver uploads them. If the image exists but compression has not finished, this endpoint returns `202 Accepted` with a `Retry-After` header and the image''s model (`id` and `is_compressed: false`) as the JSON body, instead of image data — retry after the interval given. Image data is returned as WebP unless `format=png` is given; the `Content-Type` header (or `content_type` in the Base64 response) states the format.
**PNG.** Add `format=png` for a lossless PNG of the same compressed image, for systems that need a lossless format. The pixels are identical to the WebP, so the picture is no sharper, but the file is several times larger. With `encoding=base64`, a PNG over 5 MB returns `400`; request it without `encoding` to receive the binary. If the service is temporarily busy it returns `503` with a `Retry-After` header; retry after that interval.'
tags:
- Driver Questionnaires
parameters:
- in: path
name: id
required: true
schema:
type: integer
description: The ID of the image to retrieve.
description: The ID of the image to retrieve.
- in: query
name: encoding
required: false
schema:
type: string
enum:
- base64
description: Set to `base64` to receive the image as a Base64-encoded string in a JSON response instead of raw binary.
description: Set to `base64` to receive the image as a Base64-encoded string in a JSON response instead of raw binary.
- in: query
name: format
required: false
schema:
type: string
enum:
- webp
- png
default: webp
description: 'Image format to return. `webp` (default) is the compressed image. `png` is a lossless copy of that same image: identical pixels, larger file.'
description: 'Image format to return. `webp` (default) is the compressed image. `png` is a lossless copy of that same image: identical pixels, larger file.'
responses:
'200':
description: Successful response. Returns raw image binary by default, or a JSON object when `encoding=base64` is specified.
content:
image/webp:
schema:
type: string
format: binary
image/png:
schema:
type: string
format: binary
application/json:
example:
data: UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAQAcJaQAA3AA/veff8A=
content_type: image/webp
'202':
$ref: '#/components/responses/DriverQuestionnaireImageCompressing'
'400':
$ref: '#/components/responses/InvalidInput'
'404':
$ref: '#/components/responses/NotFound'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/ServerError'
'503':
$ref: '#/components/responses/ServiceBusy'
components:
responses:
RateLimited:
description: 'Rate limit exceeded (`name = RATE_LIMIT_EXCEEDED`). **Only returned to callers that opt in** with the `x-sr-api-features: rate-limit-429` request header; without it the same condition returns `403` with `name = FORBIDDEN` and an otherwise identical body. See [API Features](#section/Getting-started/API-Features).'
headers:
Retry-After:
schema:
type: integer
description: Seconds to wait before retrying. Same value as `details.retry_after_seconds`.
x-sr-api-features-applied:
$ref: '#/components/headers/ApiFeaturesApplied'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
rate_limit_exceeded:
summary: 'Rate limit reached (with x-sr-api-features: rate-limit-429)'
value:
name: RATE_LIMIT_EXCEEDED
statusCode: 429
description: You've reached your limits for this request.
details:
depot_id: 1234
type: ORDERS_GET
retry_after_seconds: 12
Forbidden:
description: 'Forbidden. Returned for rate-limit exhaustion (`name = FORBIDDEN`, with `details.retry_after_seconds` and `Retry-After` header) and permission gate failures (`name = PERMISSION`). Inspect `name` to disambiguate. Send `x-sr-api-features: rate-limit-429` to receive `429 RATE_LIMIT_EXCEEDED` for the rate-limit case instead, leaving `403` to mean permission failures only — see [API Features](#section/Getting-started/API-Features).'
headers:
Retry-After:
schema:
type: integer
description: Seconds to wait before retrying. Present only when the cause is rate-limit exhaustion.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
rate_limited:
summary: Rate limit reached (legacy default)
value:
name: FORBIDDEN
statusCode: 403
description: You've reached your limits for this request.
details:
depot_id: 1234
type: ORDERS_GET
retry_after_seconds: 12
permission:
summary: Not permitted for your depot (e.g. POST /orders without a customer)
value:
name: PERMISSION
statusCode: 403
description: This depot does not allow orders without a customer. Each affected order must include a `customer` object with either `customer.id` (numeric, from the customers endpoint) or `customer.account` (the unique account string).
details:
order_numbers:
- ABC123
remediation: 'Add a `customer` field to each listed order — `{customer: {id: <int>}}` or `{customer: {account: ''<account_string>''}}`. Look up existing customers via GET /v2/customers (REST) or `list_customers` (MCP) before creating a new one.'
ServiceBusy:
description: 'The service is temporarily busy. Nothing is wrong with the request: retry after the interval in the `Retry-After` header.'
headers:
Retry-After:
schema:
type: integer
description: Seconds to wait before retrying. Same value as `details.retry_after_seconds`.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
service_busy:
summary: Temporarily busy
value:
name: SERVICE_UNAVAILABLE
statusCode: 503
description: The service is temporarily busy. Retry shortly.
details:
retry_after_seconds: 5
ServerError:
description: 'An unexpected server error occurred. The body carries only `name` and `description`: internal details are never returned.'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
server_error:
summary: An unexpected server error
value:
name: INTERNAL_SERVER_ERROR
description: Something went wrong. Please try again later.
InvalidInput:
description: Invalid input. The request body failed validation.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
invalid_input:
$ref: '#/components/examples/ErrorResponse'
NotFound:
description: The requested resource was not found.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
not_found:
summary: A resource that does not exist in your depot
value:
name: RESOURCE_NOT_FOUND
statusCode: 404
description: 'Order not found for id: 12345'
details: {}
DriverQuestionnaireImageCompressing:
description: 'The image exists but SmartRoutes has not finished compressing it yet, so no image data is returned. This is a `2xx` response, not an error — retry after the interval given in the `Retry-After` header. The body carries the image''s model with `is_compressed: false`. An image normally becomes available within a few retries.'
headers:
Retry-After:
schema:
type: integer
description: Seconds to wait before retrying.
content:
application/json:
schema:
$ref: '#/components/schemas/DriverQuestionnaireImageCompressing'
schemas:
ErrorResponse:
type: object
description: Standard error envelope. Returned for any non-2xx response (with the exception of legacy endpoints not yet migrated). The shape is flat — no enclosing `error` wrapper.
required:
- name
- statusCode
- description
- details
properties:
name:
type: string
description: Machine-readable error name. Stable string identifier; safe to switch on programmatically.
enum:
- INVALID_INPUT
- RESOURCE_NOT_FOUND
- UNAUTHORIZED
- FORBIDDEN
- PERMISSION
- RATE_LIMIT_EXCEEDED
- GONE
- ALREADY_DISPATCHED
- SERVICE_UNAVAILABLE
- INTERNAL_SERVER_ERROR
- INTERNAL_RESOURCE_MISSING
- ERROR_WARNING
- LATENCY_WARNING
- VALIDATION_REQUEST
- GEOCODING_FAILED
- INVALID_EMAIL_DROPPED
- REDIS_UNAVAILABLE
- SEND_ERROR
- IDEMPOTENCY_KEY_REUSED_WITH_DIFFERENT_BODY
- IDEMPOTENCY_REQUEST_IN_PROGRESS
- IDEMPOTENCY_INVALID_KEY
statusCode:
type: integer
description: HTTP status code matching the response status. Legacy camelCase property name; kept for backwards compatibility.
description:
type: string
description: Human-readable description of the error. For developers; not intended for end-user display.
details:
type: object
additionalProperties: true
description: Additional structured details about the error. Always an object — never null. May be empty (`{}`). Validation errors populate this with a `validationErrors` array of Zod issues.
DriverQuestionnaireSubmissionDetail:
description: A driver questionnaire submission with its answers. Returned by `GET /driver-questionnaire-submission/{id}` and, for an order's own submissions, in `driver_questionnaire_submissions` on `GET /orders/{id}`.
allOf:
- $ref: '#/components/schemas/DriverQuestionnaireSubmission'
- type: object
properties:
route_id:
type:
- integer
- 'null'
description: The route the submission was made on.
visit_id:
type:
- integer
- 'null'
description: The stop the submission was made at. `null` for `ROUTE_VEHICLE_CHECKIN` submissions. Matches a stop `id`, but the stop may no longer be planned.
driver_questionnaire_answers:
type: array
items:
type: object
properties:
id:
type: integer
type:
type: string
description: Answer type, e.g. `TEXT`, `CHECKBOX`, `SELECT`, `MULTI_SELECT`, `PHOTO`, `SIGNATURE`. New values may be added; treat unknown values as opaque.
data:
type:
- string
- 'null'
description: The answer as the driver app recorded it. A `MULTI_SELECT` question is answered with one entry per selected option.
driver_questionnaire_question:
type: object
properties:
type:
type: string
question:
type: string
images:
type: array
items:
type: string
format: uri
description: URLs on `GET /driver-questionnaire-images/{id}` for photos and signatures. Only uploaded images are listed; one still compressing answers `202 Accepted` with a `Retry-After` header.
DriverQuestionnaireSubmission:
type: object
properties:
id:
type: integer
order_id:
type:
- integer
- 'null'
description: 'Set only on `VISIT_ORDER` submissions: the order at the stop this submission is about. `null` for `ROUTE_VEHICLE_CHECKIN` and `VISIT` submissions. Under an order''s `stops`, only that order''s submissions and the stop''s own (`order_id: null`) are listed. An order''s own submissions, with their answers, are also in `driver_questionnaire_submissions` on `GET /orders/{id}`.'
order_line_item_id:
type:
- integer
- 'null'
description: Set only on `VISIT_ORDER` submissions about a single line item of `order_id` — matches `LineItem.id`. `null` when the submission is about the whole order.
driver_questionnaire:
type: object
properties:
type:
type: string
description: What the questionnaire is attached to. One of `ROUTE_VEHICLE_CHECKIN` (the route), `VISIT` (a stop), or `VISIT_ORDER` (one order, or one line item of an order, at a stop — see `order_id` and `order_line_item_id`). New values may be added; treat unknown values as opaque.
title:
type: string
DriverQuestionnaireImageCompressing:
type: object
description: Returned with HTTP 202 by the driver questionnaire image endpoint when the requested image exists but has not finished compressing. Retry after the interval in the `Retry-After` header.
required:
- driver_questionnaire_image
properties:
driver_questionnaire_image:
type: object
required:
- id
- is_compressed
properties:
id:
type: integer
description: ID of the image.
is_compressed:
type: boolean
description: Whether compression has finished. Always `false` in this response — that is why no image data is returned yet.
example:
driver_questionnaire_image:
id: 70629
is_compressed: false
headers:
ApiFeaturesApplied:
description: Echoes the opt-in API feature tokens the server recognised and applied to this request, comma-separated and sorted. Absent when none were applied. Unrecognised tokens are ignored rather than rejected, so this header is how a client confirms an opt-in took effect.
schema:
type: string
examples:
ErrorResponse:
summary: A request body that failed validation
value:
name: INVALID_INPUT
statusCode: 400
description: Customers Validation Error
details:
validationErrors:
- code: invalid_type
expected: string
received: undefined
path:
- 0
- account
message: Required