Documentation
Documents
documents.for_record
REST
ShippingPOST /api/v1/documents/for_recordMCP tool
Livedocuments.for_recordExposed on: REST API · Shop MCP server · Claude connector · Dash (in-app copilot) · Zapier. Part of the Documents domain.
Operating contract
The paperwork and photos attached to ONE record — the 'Files' card on a customer, a job, a vehicle, a quote, an invoice, a warranty or a lead.
This is the read to use when the question is about a record rather than about the library. documents.list searches everything; this answers 'what have we got on this car'.
GIVE EXACTLY ONE RECORD ID: customer_id, vehicle_id, job_id, quote_id, invoice_id, warranty_id or lead_id. Two at once is refused rather than guessed at, and each one comes from that domain's own list capability — so there is never a question about which kind of id a field wants.
role says what the file is FOR on that record — a before photo, an after photo, a signed agreement — where the shop recorded one.
Photos are usually the bulk of a job's files. Ask for exclude_photos: true when the question is about paperwork and you do not want forty pictures of a bumper in the way.
TRUNCATION: at most limit documents come back, newest first, and omitted says how many more are filed against the record. When it is not 0, raise limit — do not conclude a job has no signed agreement from a truncated list of its photos.
Who may call it
- Permission
- NoneThe library is open to every active member of the shop — `/documents` is guarded by `requireShopContext()` and by no section at all, because a technician needs the photos of the car they are working on. Gating this would make a machine see less of the shop's own filing than the bench does.
- Plan
- Every planNo plan gate. Available on every Service VIN plan.
- Retries
naturalNaturally idempotent — running it twice leaves the same world as running it once. A retrying integration needs no key.- Rate class
readCounted against the read budget — the widest of the four.
Partial answers
omitted is how many matching records are not in the response, and 0 is a real answer meaning you have all of them. There is no cursor here — narrow the filter instead.
Do not summarise from a truncated response
Input
| Field | Type | Description |
|---|---|---|
| customer_id | stringuuid | A customer's id, as returned by customers.list or customers.get. |
| vehicle_id | stringuuid | A vehicle's id, as returned by vehicles.list or vehicles.find_by_vin. |
| job_id | stringuuid | A job's id, as returned by jobs.list or calendar.day. |
| quote_id | stringuuid | A quote's id, as returned by quotes.list. |
| invoice_id | stringuuid | An invoice's id, as returned by invoices.list. |
| warranty_id | stringuuid | A warranty's id, as returned by warranties.list. |
| lead_id | stringuuid | A lead's id, as returned by leads.list. |
| exclude_photos | boolean | True leaves photos and videos out, so paperwork is not buried. |
| limit | integer1–100 | How many documents to return, 1-100. Defaults to 30. Default:30 |
Output
| Field | Type | Description |
|---|---|---|
| attached_to | string | — |
| items | object[] | — |
| items[].id | string | — |
| items[].title | string | null | — |
| items[].kind | string | — |
| items[].role | string | null | — |
| items[].size_bytes | number | null | — |
| items[].created_at | string | — |
| omitted | number | — |
Examples
Built from this capability's own schema — required fields and the ones carrying a default, and nothing invented. Paste one and it validates.
export SERVICEVIN_API_KEY=svk_live_…
curl -X POST https://www.servicevin.com/api/v1/documents/for_record \
-H "Authorization: Bearer $SERVICEVIN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"limit":30}'const res = await fetch("https://www.servicevin.com/api/v1/documents/for_record", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SERVICEVIN_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"limit": 30
}),
});
// Success and failure are both envelopes. Switch on error.code, never
// on error.message — the codes are stable, the messages are for people.
const payload = await res.json();
if (!res.ok) throw new Error(payload.error.code);
const data = payload.data;import os, requests
res = requests.post(
"https://www.servicevin.com/api/v1/documents/for_record",
headers={"Authorization": f"Bearer {os.environ['SERVICEVIN_API_KEY']}"},
json={
"limit": 30
},
timeout=30,
)
payload = res.json()
if not res.ok:
raise RuntimeError(payload["error"]["code"])
data = payload["data"]{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "documents.for_record",
"arguments": {
"limit": 30
}
}
}Refusals
The four gates run in this order on every surface, and the order is not arbitrary — see Authentication.
| Status | Code | When |
|---|---|---|
| 404 | not_found | The id is unknown, or the feature is not enabled for this account. Deliberately the same answer for both. |
| 422 | validation_error | An argument was wrong. The message names the field. |
| 429 | rate_limited | Too many read calls. Back off and retry. |
| 500 | internal_error | Something failed on our side. Nothing was changed. |