{"openapi":"3.1.0","info":{"title":"Tradecraft API","version":"1.0.0","description":"Read-only access to one business's records. Send a secret key as `Authorization: Bearer <key>`. Money is whole cents with a currency; times are ISO 8601 in UTC, and `/me` gives the business's time zone. Lists are newest first and page with `limit` and `cursor`. Errors are problem details with a stable `code`."},"servers":[{"url":"https://api.tradecraft.nexus/v1"}],"security":[{"secretKey":[]}],"paths":{"/me":{"get":{"summary":"Who this key is, its business and its usage this month","operationId":"getMe","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/tools":{"get":{"summary":"The MCP tools, as data, for a harness that calls functions but does not speak MCP","operationId":"getTools","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["openai","openai-chat","anthropic"]},"description":"Return only the tools this key may call, each in the shape that provider's API takes as `tools`: `openai` for the Responses API, `openai-chat` for chat completions, `anthropic` for the Messages API. Left out, every tool is listed in the shape documented here."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Tool"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/tools/{name}":{"post":{"summary":"Run one tool","operationId":"postToolsByName","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"},"description":"A tool's `name` from `GET /v1/tools`."}],"requestBody":{"required":false,"description":"The tool's arguments, as named in its `input_schema`. Leave the body out for a tool that takes none.","content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"What the tool returns: the same record or list as its REST endpoint. `GET /v1/tools` gives each tool's scope and arguments.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such record in this business.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/search":{"get":{"summary":"Find customers, jobs, leads, quotes and invoices by text, in one request","operationId":"getSearch","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":100},"description":"The text to look for: a name, a job title, a quote or invoice number, or with `contacts:read` an email or phone number."},{"name":"types","in":"query","required":false,"schema":{"type":"string"},"description":"Search only these kinds, comma-separated: customers, jobs, leads, quotes, invoices. Each needs its own scope. Left out, every kind the key may read is searched."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":25,"default":5},"description":"How many of each kind to return, newest first."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResults"}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/customers":{"get":{"summary":"List customers","operationId":"getCustomers","description":"Needs the `customers:read` scope.","x-required-scope":"customers:read","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"`next_cursor` from the previous page. Keep the other parameters the same."},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"`desc` is newest first; `asc` is oldest first."},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":2,"maxLength":100},"description":"Only records with this text in the name or contact name, or with `contacts:read` the email or phone number. Case does not matter."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","inactive"]}},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["residential","commercial"]}},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Only records changed at or after this time."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/customers/{id}":{"get":{"summary":"Get one customer","operationId":"getCustomersById","description":"Needs the `customers:read` scope.","x-required-scope":"customers:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such record in this business.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/customers/{id}/equipment":{"get":{"summary":"List the equipment on file for one customer","operationId":"getCustomersByIdEquipment","description":"Needs the `customers:read` scope.","x-required-scope":"customers:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"`next_cursor` from the previous page. Keep the other parameters the same."},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"`desc` is newest first; `asc` is oldest first."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Equipment"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such record in this business.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/jobs":{"get":{"summary":"List jobs","operationId":"getJobs","description":"Needs the `jobs:read` scope.","x-required-scope":"jobs:read","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"`next_cursor` from the previous page. Keep the other parameters the same."},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"`desc` is newest first; `asc` is oldest first."},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":2,"maxLength":100},"description":"Only records with this text in the title or description. Case does not matter."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["scheduled","in_progress","completed","cancelled"]}},{"name":"customer_id","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"scheduled_from","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Scheduled at or after this time."},{"name":"scheduled_to","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Scheduled before this time."},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Only records changed at or after this time."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Job"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/jobs/{id}":{"get":{"summary":"Get one job","operationId":"getJobsById","description":"Needs the `jobs:read` scope.","x-required-scope":"jobs:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such record in this business.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/jobs/{id}/notes":{"get":{"summary":"List the notes on one job","operationId":"getJobsByIdNotes","description":"Needs the `jobs:read` scope.","x-required-scope":"jobs:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"`next_cursor` from the previous page. Keep the other parameters the same."},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"`desc` is newest first; `asc` is oldest first."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/JobNote"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such record in this business.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/schedule/events":{"get":{"summary":"List scheduled jobs","operationId":"getScheduleEvents","description":"Needs the `schedule:read` scope.","x-required-scope":"schedule:read","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","format":"date-time"},"description":"Start of the window."},{"name":"to","in":"query","required":true,"schema":{"type":"string","format":"date-time"},"description":"End of the window, at most 92 days after `from`."},{"name":"technician_id","in":"query","required":false,"schema":{"type":"string","format":"uuid"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["scheduled","in_progress","completed","cancelled"]}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"`next_cursor` from the previous page. Keep the other parameters the same."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleEvent"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/technicians":{"get":{"summary":"List technicians","operationId":"getTechnicians","description":"Needs the `technicians:read` scope.","x-required-scope":"technicians:read","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","inactive"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Technician"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/technicians/{id}":{"get":{"summary":"Get one technician","operationId":"getTechniciansById","description":"Needs the `technicians:read` scope.","x-required-scope":"technicians:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Technician"}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such record in this business.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/quotes":{"get":{"summary":"List quotes","operationId":"getQuotes","description":"Needs the `quotes:read` scope.","x-required-scope":"quotes:read","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"`next_cursor` from the previous page. Keep the other parameters the same."},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"`desc` is newest first; `asc` is oldest first."},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":2,"maxLength":100},"description":"Only records with this text in the quote number or title. Case does not matter."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","sent","accepted","declined","expired","converted"]}},{"name":"customer_id","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"job_id","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Only records changed at or after this time."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Quote"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/quotes/{id}":{"get":{"summary":"Get one quote","operationId":"getQuotesById","description":"Needs the `quotes:read` scope.","x-required-scope":"quotes:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Quote"}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such record in this business.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/invoices":{"get":{"summary":"List invoices","operationId":"getInvoices","description":"Needs the `invoices:read` scope.","x-required-scope":"invoices:read","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"`next_cursor` from the previous page. Keep the other parameters the same."},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"`desc` is newest first; `asc` is oldest first."},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":2,"maxLength":100},"description":"Only records with this text in the invoice number or memo. Case does not matter."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","pending","paid","overdue","void"]}},{"name":"customer_id","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"job_id","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"due_before","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Due before this time."},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Only records changed at or after this time."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/invoices/{id}":{"get":{"summary":"Get one invoice","operationId":"getInvoicesById","description":"Needs the `invoices:read` scope.","x-required-scope":"invoices:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such record in this business.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/payments":{"get":{"summary":"List payments","operationId":"getPayments","description":"Needs the `payments:read` scope.","x-required-scope":"payments:read","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"`next_cursor` from the previous page. Keep the other parameters the same."},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"`desc` is newest first; `asc` is oldest first."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","completed","failed","refunded","canceled"]}},{"name":"invoice_id","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"customer_id","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"paid_since","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Paid at or after this time."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/payments/{id}":{"get":{"summary":"Get one payment","operationId":"getPaymentsById","description":"Needs the `payments:read` scope.","x-required-scope":"payments:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Payment"}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such record in this business.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/expenses":{"get":{"summary":"List expenses","operationId":"getExpenses","description":"Needs the `expenses:read` scope.","x-required-scope":"expenses:read","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"`next_cursor` from the previous page. Keep the other parameters the same."},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"`desc` is newest first; `asc` is oldest first."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","approved","rejected"]}},{"name":"job_id","in":"query","required":false,"schema":{"type":"integer","minimum":1}},{"name":"incurred_since","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Dated on or after this day."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Expense"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/expenses/{id}":{"get":{"summary":"Get one expense","operationId":"getExpensesById","description":"Needs the `expenses:read` scope.","x-required-scope":"expenses:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Expense"}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such record in this business.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/leads":{"get":{"summary":"List leads","operationId":"getLeads","description":"Needs the `leads:read` scope.","x-required-scope":"leads:read","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"`next_cursor` from the previous page. Keep the other parameters the same."},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"`desc` is newest first; `asc` is oldest first."},{"name":"q","in":"query","required":false,"schema":{"type":"string","minLength":2,"maxLength":100},"description":"Only records with this text in the name, or with `contacts:read` the email or phone number. Case does not matter."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["new","contacted","qualified","converted","lost"]}},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["chat","form","direct","homie","network","google_lsa","website"]}},{"name":"created_since","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Created at or after this time."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Lead"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/leads/{id}":{"get":{"summary":"Get one lead","operationId":"getLeadsById","description":"Needs the `leads:read` scope.","x-required-scope":"leads:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lead"}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such record in this business.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/services":{"get":{"summary":"List services","operationId":"getServices","description":"Needs the `services:read` scope.","x-required-scope":"services:read","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"`next_cursor` from the previous page. Keep the other parameters the same."},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"`desc` is newest first; `asc` is oldest first."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Service"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/inventory/items":{"get":{"summary":"List inventory items","operationId":"getInventoryItems","description":"Needs the `inventory:read` scope.","x-required-scope":"inventory:read","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"`next_cursor` from the previous page. Keep the other parameters the same."},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"`desc` is newest first; `asc` is oldest first."},{"name":"active","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"updated_since","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"Only records changed at or after this time."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/InventoryItem"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/inventory/items/{id}":{"get":{"summary":"Get one inventory item","operationId":"getInventoryItemsById","description":"Needs the `inventory:read` scope.","x-required-scope":"inventory:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InventoryItem"}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such record in this business.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/inventory/locations":{"get":{"summary":"List stock locations","operationId":"getInventoryLocations","description":"Needs the `inventory:read` scope.","x-required-scope":"inventory:read","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/InventoryLocation"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/inventory/assets":{"get":{"summary":"List tool or assets","operationId":"getInventoryAssets","description":"Needs the `inventory:read` scope.","x-required-scope":"inventory:read","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"`next_cursor` from the previous page. Keep the other parameters the same."},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"`desc` is newest first; `asc` is oldest first."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["available","checked_out","in_service","lost","retired"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/InventoryAsset"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/purchase-orders":{"get":{"summary":"List purchase orders","operationId":"getPurchaseOrders","description":"Needs the `purchasing:read` scope.","x-required-scope":"purchasing:read","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"`next_cursor` from the previous page. Keep the other parameters the same."},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"`desc` is newest first; `asc` is oldest first."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","sent","partial","received","closed","cancelled"]}},{"name":"supplier_id","in":"query","required":false,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrder"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/purchase-orders/{id}":{"get":{"summary":"Get one purchase order","operationId":"getPurchaseOrdersById","description":"Needs the `purchasing:read` scope.","x-required-scope":"purchasing:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrder"}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"404":{"description":"No such record in this business.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}},"/suppliers":{"get":{"summary":"List suppliers","operationId":"getSuppliers","description":"Needs the `purchasing:read` scope.","x-required-scope":"purchasing:read","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"`next_cursor` from the previous page. Keep the other parameters the same."},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"`desc` is newest first; `asc` is oldest first."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Supplier"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["object","data","has_more","next_cursor"]}}}},"400":{"description":"The request has a problem; `errors` names each field.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"401":{"description":"No key, or the key is not valid, revoked or expired.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"403":{"description":"The key lacks a scope, or the business cannot use the API.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}},"429":{"description":"Rate limit or monthly quota reached. See `Retry-After`.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/Problem"}}}}}}}},"components":{"securitySchemes":{"secretKey":{"type":"http","scheme":"bearer","description":"A secret key from Connected apps & API."}},"schemas":{"Customer":{"type":"object","properties":{"object":{"const":"customer"},"id":{"type":"integer"},"name":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"contact_name":{"type":["string","null"]},"email":{"type":["string","null"],"description":"Present only when the key has `contacts:read`."},"phone":{"type":["string","null"],"description":"Present only when the key has `contacts:read`."},"address":{"type":["string","null"],"description":"Present only when the key has `contacts:read`."},"created_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"updated_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"url":{"type":"string"}},"required":["object","id","name","type","status","contact_name","created_at","updated_at","url"],"additionalProperties":false},"Job":{"type":"object","properties":{"object":{"const":"job"},"id":{"type":"integer"},"title":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string"},"priority":{"type":["string","null"]},"category":{"type":["string","null"]},"customer_id":{"type":"integer"},"scheduled_start":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"scheduled_end":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"completed_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"address":{"type":["string","null"],"description":"Present only when the key has `contacts:read`."},"created_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"updated_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"url":{"type":"string"}},"required":["object","id","title","description","status","priority","category","customer_id","scheduled_start","scheduled_end","completed_at","created_at","updated_at","url"],"additionalProperties":false},"Equipment":{"type":"object","properties":{"object":{"const":"equipment"},"id":{"type":"integer"},"customer_id":{"type":"integer"},"type":{"type":"string"},"make":{"type":["string","null"]},"model":{"type":["string","null"]},"serial_number":{"type":["string","null"]},"installed_on":{"type":["string","null"],"format":"date"},"warranty_expires_on":{"type":["string","null"],"format":"date"},"notes":{"type":["string","null"]},"created_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"updated_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."}},"required":["object","id","customer_id","type","make","model","serial_number","installed_on","warranty_expires_on","notes","created_at","updated_at"],"additionalProperties":false},"JobNote":{"type":"object","properties":{"object":{"const":"job_note"},"id":{"type":"integer"},"job_id":{"type":"integer"},"body":{"type":"string"},"created_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."}},"required":["object","id","job_id","body","created_at"],"additionalProperties":false},"Quote":{"type":"object","properties":{"object":{"const":"quote"},"id":{"type":"integer"},"number":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string"},"customer_id":{"type":"integer"},"job_id":{"type":["integer","null"]},"invoice_id":{"type":["integer","null"]},"currency":{"type":"string"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":"string"},"tier":{"type":"string"},"total":{"type":["integer","null"],"description":"Whole minor units (cents)."},"preferred":{"type":"boolean"},"line_items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"type":{"type":["string","null"]},"description":{"type":"string"},"quantity":{"type":"number"},"unit_amount":{"type":["integer","null"],"description":"Whole minor units (cents)."},"amount":{"type":["integer","null"],"description":"Whole minor units (cents)."}},"required":["id","type","description","quantity","unit_amount","amount"],"additionalProperties":false},"description":"Present when one quote is fetched by ID."}},"required":["id","name","tier","total","preferred"],"additionalProperties":false}},"valid_until":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"sent_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"accepted_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"declined_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"created_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"updated_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"url":{"type":"string"}},"required":["object","id","number","title","description","status","customer_id","job_id","invoice_id","currency","options","valid_until","sent_at","accepted_at","declined_at","created_at","updated_at","url"],"additionalProperties":false},"Invoice":{"type":"object","properties":{"object":{"const":"invoice"},"id":{"type":"integer"},"number":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"customer_id":{"type":"integer"},"job_id":{"type":["integer","null"]},"quote_id":{"type":["integer","null"]},"currency":{"type":"string"},"amount":{"type":["integer","null"],"description":"Whole minor units (cents)."},"memo":{"type":["string","null"]},"line_items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"description":{"type":"string"},"quantity":{"type":"number"},"unit_amount":{"type":["integer","null"],"description":"Whole minor units (cents)."},"amount":{"type":["integer","null"],"description":"Whole minor units (cents)."},"kind":{"type":"string"}},"required":["id","description","quantity","unit_amount","amount","kind"],"additionalProperties":false},"description":"Present when one invoice is fetched by ID."},"issued_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"due_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"paid_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"voided_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"created_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"updated_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"url":{"type":"string"}},"required":["object","id","number","type","status","customer_id","job_id","quote_id","currency","amount","memo","issued_at","due_at","paid_at","voided_at","created_at","updated_at","url"],"additionalProperties":false},"ScheduleEvent":{"type":"object","properties":{"object":{"const":"schedule_event"},"id":{"type":"integer"},"job_id":{"type":"integer"},"title":{"type":"string"},"status":{"type":"string"},"priority":{"type":["string","null"]},"customer_id":{"type":"integer"},"start":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"end":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"duration_hours":{"type":["number","null"]},"technician_ids":{"type":"array","items":{"type":"string"}},"address":{"type":["string","null"],"description":"Present only when the key has `contacts:read`."},"url":{"type":"string"}},"required":["object","id","job_id","title","status","priority","customer_id","start","end","duration_hours","technician_ids","url"],"additionalProperties":false},"Technician":{"type":"object","properties":{"object":{"const":"technician"},"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"status":{"type":"string"},"specialty":{"type":["string","null"]},"certification_level":{"type":["string","null"]},"email":{"type":["string","null"],"description":"Present only when the key has `contacts:read`."},"phone":{"type":["string","null"],"description":"Present only when the key has `contacts:read`."},"created_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"updated_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."}},"required":["object","id","name","status","specialty","certification_level","created_at","updated_at"],"additionalProperties":false},"Service":{"type":"object","properties":{"object":{"const":"service"},"id":{"type":"integer"},"name":{"type":"string"},"description":{"type":["string","null"]},"trade":{"type":["string","null"]},"category":{"type":["string","null"]},"currency":{"type":"string"},"rate":{"type":["integer","null"],"description":"Whole minor units (cents)."},"pricing_unit":{"type":"string"},"estimated_duration_hours":{"type":["number","null"]},"created_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"updated_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."}},"required":["object","id","name","description","trade","category","currency","rate","pricing_unit","estimated_duration_hours","created_at","updated_at"],"additionalProperties":false},"Payment":{"type":"object","properties":{"object":{"const":"payment"},"id":{"type":"integer"},"status":{"type":"string"},"invoice_id":{"type":"integer"},"customer_id":{"type":"integer"},"currency":{"type":"string"},"amount":{"type":["integer","null"],"description":"Whole minor units (cents)."},"refunded_amount":{"type":["integer","null"],"description":"Whole minor units (cents)."},"paid_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"created_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"updated_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."}},"required":["object","id","status","invoice_id","customer_id","currency","amount","refunded_amount","paid_at","created_at","updated_at"],"additionalProperties":false},"Expense":{"type":"object","properties":{"object":{"const":"expense"},"id":{"type":"integer"},"description":{"type":"string"},"status":{"type":["string","null"]},"vendor":{"type":["string","null"]},"currency":{"type":"string"},"amount":{"type":["integer","null"],"description":"Whole minor units (cents)."},"billable":{"type":"boolean"},"job_id":{"type":["integer","null"]},"technician_id":{"type":["string","null"]},"incurred_on":{"type":["string","null"],"format":"date"},"due_on":{"type":["string","null"],"format":"date"},"created_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"updated_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."}},"required":["object","id","description","status","vendor","currency","amount","billable","job_id","technician_id","incurred_on","due_on","created_at","updated_at"],"additionalProperties":false},"Lead":{"type":"object","properties":{"object":{"const":"lead"},"id":{"type":"integer"},"name":{"type":["string","null"]},"source":{"type":"string"},"status":{"type":"string"},"score":{"type":["number","null"]},"customer_id":{"type":["integer","null"]},"job_id":{"type":["integer","null"]},"email":{"type":["string","null"],"description":"Present only when the key has `contacts:read`."},"phone":{"type":["string","null"],"description":"Present only when the key has `contacts:read`."},"created_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"updated_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."}},"required":["object","id","name","source","status","score","customer_id","job_id","created_at","updated_at"],"additionalProperties":false},"InventoryItem":{"type":"object","properties":{"object":{"const":"inventory_item"},"id":{"type":"integer"},"name":{"type":"string"},"sku":{"type":["string","null"]},"category":{"type":"string"},"description":{"type":["string","null"]},"unit":{"type":"string"},"active":{"type":"boolean"},"tracks_stock":{"type":"boolean"},"quantity_in_stock":{"type":["number","null"]},"min_stock_level":{"type":["number","null"]},"currency":{"type":"string"},"cost":{"type":["integer","null"],"description":"Whole minor units (cents)."},"price":{"type":["integer","null"],"description":"Whole minor units (cents)."},"preferred_supplier_id":{"type":["integer","null"]},"stock":{"type":"array","items":{"type":"object","properties":{"location_id":{"type":"integer"},"quantity":{"type":"number"},"bin":{"type":["string","null"]}},"required":["location_id","quantity","bin"],"additionalProperties":false},"description":"Present when one item is fetched by ID."},"created_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"updated_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."}},"required":["object","id","name","sku","category","description","unit","active","tracks_stock","quantity_in_stock","min_stock_level","currency","cost","price","preferred_supplier_id","created_at","updated_at"],"additionalProperties":false},"InventoryLocation":{"type":"object","properties":{"object":{"const":"inventory_location"},"id":{"type":"integer"},"name":{"type":"string"},"kind":{"type":"string"},"is_default":{"type":"boolean"},"archived":{"type":"boolean"},"created_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"updated_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."}},"required":["object","id","name","kind","is_default","archived","created_at","updated_at"],"additionalProperties":false},"InventoryAsset":{"type":"object","properties":{"object":{"const":"inventory_asset"},"id":{"type":"integer"},"name":{"type":"string"},"asset_tag":{"type":["string","null"]},"category":{"type":["string","null"]},"status":{"type":"string"},"manufacturer":{"type":["string","null"]},"model":{"type":["string","null"]},"holder_technician_id":{"type":["string","null"]},"holder_job_id":{"type":["integer","null"]},"holder_location_id":{"type":["integer","null"]},"due_back_on":{"type":["string","null"],"format":"date"},"next_service_on":{"type":["string","null"],"format":"date"},"created_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"updated_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."}},"required":["object","id","name","asset_tag","category","status","manufacturer","model","holder_technician_id","holder_job_id","holder_location_id","due_back_on","next_service_on","created_at","updated_at"],"additionalProperties":false},"PurchaseOrder":{"type":"object","properties":{"object":{"const":"purchase_order"},"id":{"type":"integer"},"number":{"type":"string"},"status":{"type":"string"},"supplier_id":{"type":["integer","null"]},"supplier_name":{"type":"string"},"ship_to_location_id":{"type":"integer"},"expected_on":{"type":["string","null"],"format":"date"},"sent_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"received_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"currency":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"item_id":{"type":"integer"},"job_id":{"type":["integer","null"]},"quantity_ordered":{"type":"number"},"quantity_received":{"type":"number"},"quantity_returned":{"type":"number"},"unit_cost":{"type":"integer","description":"Whole minor units (cents)."}},"required":["id","item_id","job_id","quantity_ordered","quantity_received","quantity_returned","unit_cost"],"additionalProperties":false},"description":"Present when one purchase order is fetched by ID."},"created_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"updated_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."}},"required":["object","id","number","status","supplier_id","supplier_name","ship_to_location_id","expected_on","sent_at","received_at","currency","created_at","updated_at"],"additionalProperties":false},"Supplier":{"type":"object","properties":{"object":{"const":"supplier"},"id":{"type":"integer"},"name":{"type":"string"},"category":{"type":["string","null"]},"contact_name":{"type":["string","null"]},"lead_time_days":{"type":["integer","null"]},"payment_terms_days":{"type":["integer","null"]},"archived":{"type":"boolean"},"email":{"type":["string","null"],"description":"Present only when the key has `contacts:read`."},"phone":{"type":["string","null"],"description":"Present only when the key has `contacts:read`."},"address":{"type":["string","null"],"description":"Present only when the key has `contacts:read`."},"website":{"type":["string","null"],"description":"Present only when the key has `contacts:read`."},"created_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."},"updated_at":{"type":["string","null"],"format":"date-time","description":"ISO 8601, UTC."}},"required":["object","id","name","category","contact_name","lead_time_days","payment_terms_days","archived","created_at","updated_at"],"additionalProperties":false},"Me":{"type":"object","properties":{"object":{"const":"me"},"principal":{"type":"object","properties":{"kind":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"},"access":{"enum":["read","write"]},"scopes":{"type":"array","items":{"type":"string"}}},"required":["kind","id","name","role","access","scopes"],"additionalProperties":false},"business":{"type":"object","properties":{"id":{"type":"integer"},"name":{"type":["string","null"]},"brand":{"type":"string"},"time_zone":{"type":"string","description":"An IANA time zone name. Every time in the API is UTC; this is the zone the business keeps its schedule in."}},"required":["id","name","brand","time_zone"],"additionalProperties":false},"usage":{"type":"object","properties":{"calls_this_month":{"type":"integer"},"monthly_quota":{"type":"integer"},"resets_at":{"type":"string","format":"date-time"}},"required":["calls_this_month","monthly_quota","resets_at"],"additionalProperties":false}},"required":["object","principal","business","usage"],"additionalProperties":false},"SearchResults":{"type":"object","description":"A kind of record is present when it was searched: the key has its scope and, if `types` was given, it was asked for.","properties":{"object":{"const":"search_results"},"query":{"type":"string"},"customers":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"jobs":{"type":"array","items":{"$ref":"#/components/schemas/Job"}},"leads":{"type":"array","items":{"$ref":"#/components/schemas/Lead"}},"quotes":{"type":"array","items":{"$ref":"#/components/schemas/Quote"}},"invoices":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}}},"required":["object","query"],"additionalProperties":false},"Tool":{"type":"object","properties":{"name":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"scope":{"type":["string","null"]},"read_only":{"type":"boolean"},"allowed":{"type":"boolean","description":"Whether this key has the scope the tool needs."},"input_schema":{"type":"object"}},"required":["name","title","description","scope","read_only","allowed","input_schema"],"additionalProperties":false},"Problem":{"type":"object","description":"Problem details (RFC 9457).","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"code":{"type":"string","description":"Stable, machine-readable."},"help_url":{"type":"string"},"request_id":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"message":{"type":"string"}},"required":["field","message"],"additionalProperties":false}}},"required":["type","title","status","detail","code","help_url"],"additionalProperties":false}}},"x-scopes":[{"id":"customers:read","description":"Customer names, type and status."},{"id":"contacts:read","description":"Emails, phone numbers and addresses on customers, jobs and technicians."},{"id":"jobs:read","description":"Jobs with their status, timing and customer."},{"id":"schedule:read","description":"What is scheduled in a time window, and who is assigned."},{"id":"technicians:read","description":"Technician names, status and specialty."},{"id":"quotes:read","description":"Quotes with their options and totals."},{"id":"invoices:read","description":"Invoices with amounts, status and due dates."},{"id":"services:read","description":"The services the business offers and their rates."},{"id":"payments:read","description":"Payments received, with amounts and status."},{"id":"expenses:read","description":"Expenses with amounts, vendor and status."},{"id":"leads:read","description":"Leads with their source and status."},{"id":"inventory:read","description":"Items, stock levels, stock locations and tools."},{"id":"purchasing:read","description":"Purchase orders and suppliers."}]}