{"openapi":"3.1.0","info":{"title":"OpsGeneral API","version":"v1","description":"Workspace API for customers, assets, tickets, invoices, and incremental synchronization."},"servers":[{"url":"/api/v1","description":"Current OpsGeneral workspace"}],"tags":[{"name":"API access"},{"name":"Customers"},{"name":"Assets"},{"name":"Tickets"},{"name":"Invoices"},{"name":"Synchronization"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"},"clientCredentials":{"type":"http","scheme":"basic"},"oauth":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/api/v1/oauth/token","scopes":{"customers:read":"Read customers","customers:write":"Write customers","assets:read":"Read assets","assets:write":"Write assets","tickets:read":"Read tickets","tickets:write":"Write tickets","invoices:read":"Read invoices","invoices:write":"Write invoices"}}}}}},"paths":{"/":{"get":{"tags":["API access"],"summary":"Check credential access","description":"List the API version, available resources, and this credential’s scopes.","x-opsgeneral-scopes":[],"security":[{"bearerAuth":[]},{"oauth":[]}],"responses":{"200":{"description":"Available API access","content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"resources":{"type":"array","items":{"type":"string"}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/oauth/token":{"post":{"tags":["API access"],"summary":"Request an OAuth token","description":"Authenticate with the client ID and client secret using HTTP Basic. The access token is valid for 15 minutes.","x-opsgeneral-scopes":[],"security":[{"clientCredentials":[]}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"grant_type":{"type":"string","enum":["client_credentials"]},"scope":{"type":"string"}},"required":["grant_type"]},"example":{"grant_type":"client_credentials","scope":"customers:read"}}}},"responses":{"200":{"description":"Access token","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string","enum":["Bearer"]},"expires_in":{"type":"integer"},"scope":{"type":"string"}}}}}},"400":{"description":"Invalid OAuth request, grant type, or scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Too many active access tokens","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customers":{"get":{"tags":["Customers"],"summary":"List records","description":"List records by ascending ID. Reuse the returned cursor to load the next page.","x-opsgeneral-scopes":["customers:read"],"security":[{"bearerAuth":[]},{"oauth":["customers:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Records per page.","required":false},{"name":"after","in":"query","schema":{"type":"integer","minimum":0,"default":0},"description":"Cursor from the previous response.","required":false},{"name":"format","in":"query","schema":{"type":"string","enum":["json","csv"],"default":"json"},"description":"Output format.","required":false}],"responses":{"200":{"description":"Page of records","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"name":{"type":"string"},"email":{"type":"string"},"profile":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"business_name":{"type":"string"},"phone":{"type":"string"},"phone_type":{"type":"string"},"extension":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postal":{"type":"string"},"country":{"type":"string"},"tags":{"type":"string"},"referral":{"type":"string"},"tax_rate":{"type":"string"},"billing_email":{"type":"string"},"notification_emails":{"type":"string"},"invoice_cc_emails":{"type":"string"},"ticket_matching_emails":{"type":"string"},"tax_exempt":{"type":"boolean"},"phones":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"number":{"type":"string"},"extension":{"type":"string"}},"required":["number"]}},"sites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postal":{"type":"string"},"country":{"type":"string"}},"required":["address1"]}},"custom_fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name"]}}}}},"required":["id"]}},"next_after":{"type":["integer","null"]}}}},"text/csv":{"schema":{"type":"string"}}},"headers":{"X-Next-After":{"description":"Pass this value as after to retrieve the next CSV page.","schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"tags":["Customers"],"summary":"Create a record","description":"Use the same idempotency key and payload for retries. Invoice creation produces a draft.","x-opsgeneral-scopes":["customers:write"],"security":[{"bearerAuth":[]},{"oauth":["customers:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string"},"description":"A unique key for this create operation.","required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"profile":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"business_name":{"type":"string"},"phone":{"type":"string"},"phone_type":{"type":"string"},"extension":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postal":{"type":"string"},"country":{"type":"string"},"tags":{"type":"string"},"referral":{"type":"string"},"tax_rate":{"type":"string"},"billing_email":{"type":"string"},"notification_emails":{"type":"string"},"invoice_cc_emails":{"type":"string"},"ticket_matching_emails":{"type":"string"},"tax_exempt":{"type":"boolean"},"phones":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"number":{"type":"string"},"extension":{"type":"string"}},"required":["number"]}},"sites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postal":{"type":"string"},"country":{"type":"string"}},"required":["address1"]}},"custom_fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name"]}}}}},"required":["name"]},"example":{"name":"Example Company","email":"it@example.com"}}}},"responses":{"200":{"description":"Record","headers":{"ETag":{"description":"Entity tag for optimistic concurrency.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"name":{"type":"string"},"email":{"type":"string"},"profile":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"business_name":{"type":"string"},"phone":{"type":"string"},"phone_type":{"type":"string"},"extension":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postal":{"type":"string"},"country":{"type":"string"},"tags":{"type":"string"},"referral":{"type":"string"},"tax_rate":{"type":"string"},"billing_email":{"type":"string"},"notification_emails":{"type":"string"},"invoice_cc_emails":{"type":"string"},"ticket_matching_emails":{"type":"string"},"tax_exempt":{"type":"boolean"},"phones":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"number":{"type":"string"},"extension":{"type":"string"}},"required":["number"]}},"sites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postal":{"type":"string"},"country":{"type":"string"}},"required":["address1"]}},"custom_fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name"]}}}}},"required":["id"]}}}},"201":{"description":"Record","headers":{"ETag":{"description":"Entity tag for optimistic concurrency.","schema":{"type":"string"}},"Location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"name":{"type":"string"},"email":{"type":"string"},"profile":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"business_name":{"type":"string"},"phone":{"type":"string"},"phone_type":{"type":"string"},"extension":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postal":{"type":"string"},"country":{"type":"string"},"tags":{"type":"string"},"referral":{"type":"string"},"tax_rate":{"type":"string"},"billing_email":{"type":"string"},"notification_emails":{"type":"string"},"invoice_cc_emails":{"type":"string"},"ticket_matching_emails":{"type":"string"},"tax_exempt":{"type":"boolean"},"phones":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"number":{"type":"string"},"extension":{"type":"string"}},"required":["number"]}},"sites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postal":{"type":"string"},"country":{"type":"string"}},"required":["address1"]}},"custom_fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name"]}}}}},"required":["id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Record or request conflicts with current state","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"415":{"description":"Unsupported content type","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customers/{id}":{"get":{"tags":["Customers"],"summary":"Get a record","description":"Read the record and its current ETag.","x-opsgeneral-scopes":["customers:read"],"security":[{"bearerAuth":[]},{"oauth":["customers:read"]}],"parameters":[{"name":"id","in":"path","schema":{"type":"integer","minimum":1},"description":"OpsGeneral record ID.","required":true}],"responses":{"200":{"description":"Record","headers":{"ETag":{"description":"Entity tag for optimistic concurrency.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"name":{"type":"string"},"email":{"type":"string"},"profile":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"business_name":{"type":"string"},"phone":{"type":"string"},"phone_type":{"type":"string"},"extension":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postal":{"type":"string"},"country":{"type":"string"},"tags":{"type":"string"},"referral":{"type":"string"},"tax_rate":{"type":"string"},"billing_email":{"type":"string"},"notification_emails":{"type":"string"},"invoice_cc_emails":{"type":"string"},"ticket_matching_emails":{"type":"string"},"tax_exempt":{"type":"boolean"},"phones":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"number":{"type":"string"},"extension":{"type":"string"}},"required":["number"]}},"sites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postal":{"type":"string"},"country":{"type":"string"}},"required":["address1"]}},"custom_fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name"]}}}}},"required":["id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Record or route not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"tags":["Customers"],"summary":"Update a record","description":"Update the supplied fields using the current ETag.","x-opsgeneral-scopes":["customers:write"],"security":[{"bearerAuth":[]},{"oauth":["customers:write"]}],"parameters":[{"name":"id","in":"path","schema":{"type":"integer","minimum":1},"description":"OpsGeneral record ID.","required":true},{"name":"If-Match","in":"header","schema":{"type":"string"},"description":"Current ETag, including quotes.","required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"profile":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"business_name":{"type":"string"},"phone":{"type":"string"},"phone_type":{"type":"string"},"extension":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postal":{"type":"string"},"country":{"type":"string"},"tags":{"type":"string"},"referral":{"type":"string"},"tax_rate":{"type":"string"},"billing_email":{"type":"string"},"notification_emails":{"type":"string"},"invoice_cc_emails":{"type":"string"},"ticket_matching_emails":{"type":"string"},"tax_exempt":{"type":"boolean"},"phones":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"number":{"type":"string"},"extension":{"type":"string"}},"required":["number"]}},"sites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postal":{"type":"string"},"country":{"type":"string"}},"required":["address1"]}},"custom_fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name"]}}}}}},"example":{"name":"Example Company"}}}},"responses":{"200":{"description":"Record","headers":{"ETag":{"description":"Entity tag for optimistic concurrency.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"name":{"type":"string"},"email":{"type":"string"},"profile":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"business_name":{"type":"string"},"phone":{"type":"string"},"phone_type":{"type":"string"},"extension":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postal":{"type":"string"},"country":{"type":"string"},"tags":{"type":"string"},"referral":{"type":"string"},"tax_rate":{"type":"string"},"billing_email":{"type":"string"},"notification_emails":{"type":"string"},"invoice_cc_emails":{"type":"string"},"ticket_matching_emails":{"type":"string"},"tax_exempt":{"type":"boolean"},"phones":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"number":{"type":"string"},"extension":{"type":"string"}},"required":["number"]}},"sites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postal":{"type":"string"},"country":{"type":"string"}},"required":["address1"]}},"custom_fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name"]}}}}},"required":["id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Record or route not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Record or request conflicts with current state","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"412":{"description":"ETag no longer matches","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"415":{"description":"Unsupported content type","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"428":{"description":"Current ETag required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customers/import":{"post":{"tags":["Customers"],"summary":"Import records","description":"Import up to 100 records as one transaction. Provide an external_id for each source record and use dry_run to preview.","x-opsgeneral-scopes":["customers:write"],"security":[{"bearerAuth":[]},{"oauth":["customers:write"]}],"parameters":[{"name":"dry_run","in":"query","schema":{"type":"boolean"},"description":"Preview a native CSV request.","required":false},{"name":"on_conflict","in":"query","schema":{"type":"string","enum":["skip","update","error"],"default":"skip"},"description":"Conflict policy for a native CSV request.","required":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"profile":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"business_name":{"type":"string"},"phone":{"type":"string"},"phone_type":{"type":"string"},"extension":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postal":{"type":"string"},"country":{"type":"string"},"tags":{"type":"string"},"referral":{"type":"string"},"tax_rate":{"type":"string"},"billing_email":{"type":"string"},"notification_emails":{"type":"string"},"invoice_cc_emails":{"type":"string"},"ticket_matching_emails":{"type":"string"},"tax_exempt":{"type":"boolean"},"phones":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"number":{"type":"string"},"extension":{"type":"string"}},"required":["number"]}},"sites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postal":{"type":"string"},"country":{"type":"string"}},"required":["address1"]}},"custom_fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name"]}}}},"external_id":{"type":"string"},"etag":{"type":"string"}},"required":["external_id"]},"minItems":1,"maxItems":100},"dry_run":{"type":"boolean"},"on_conflict":{"type":"string","enum":["skip","update","error"],"default":"skip"}},"required":["records"]},{"type":"object","properties":{"csv":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"dry_run":{"type":"boolean"},"on_conflict":{"type":"string","enum":["skip","update","error"],"default":"skip"}},"required":["csv"]}]},"example":{"dry_run":true,"records":[{"external_id":"source-123","name":"Example Company","email":"it@example.com"}]}},"text/csv":{"schema":{"type":"string"}}}},"responses":{"200":{"description":"Import results","content":{"application/json":{"schema":{"type":"object","properties":{"dry_run":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"external_id":{"type":"string"},"id":{"type":"integer","minimum":1},"etag":{"type":"string"},"status":{"type":"string","enum":["created","updated","skipped"]}},"required":["external_id","status"]}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Record or route not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Record or request conflicts with current state","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"412":{"description":"ETag no longer matches","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"415":{"description":"Unsupported content type","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"428":{"description":"Current ETag required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customers/export":{"get":{"tags":["Customers"],"summary":"Export records","description":"Export one page as CSV or JSON. JSON preserves the original cell text and nested data.","x-opsgeneral-scopes":["customers:read"],"security":[{"bearerAuth":[]},{"oauth":["customers:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Records per page.","required":false},{"name":"after","in":"query","schema":{"type":"integer","minimum":0,"default":0},"description":"Cursor from the previous response.","required":false},{"name":"format","in":"query","schema":{"type":"string","enum":["json","csv"],"default":"json"},"description":"Output format.","required":false}],"responses":{"200":{"description":"Page of records","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"name":{"type":"string"},"email":{"type":"string"},"profile":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"business_name":{"type":"string"},"phone":{"type":"string"},"phone_type":{"type":"string"},"extension":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postal":{"type":"string"},"country":{"type":"string"},"tags":{"type":"string"},"referral":{"type":"string"},"tax_rate":{"type":"string"},"billing_email":{"type":"string"},"notification_emails":{"type":"string"},"invoice_cc_emails":{"type":"string"},"ticket_matching_emails":{"type":"string"},"tax_exempt":{"type":"boolean"},"phones":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"number":{"type":"string"},"extension":{"type":"string"}},"required":["number"]}},"sites":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postal":{"type":"string"},"country":{"type":"string"}},"required":["address1"]}},"custom_fields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"required":["name"]}}}}},"required":["id"]}},"next_after":{"type":["integer","null"]}}}},"text/csv":{"schema":{"type":"string"}}},"headers":{"X-Next-After":{"description":"Pass this value as after to retrieve the next CSV page.","schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/assets":{"get":{"tags":["Assets"],"summary":"List records","description":"List records by ascending ID. Reuse the returned cursor to load the next page.","x-opsgeneral-scopes":["assets:read"],"security":[{"bearerAuth":[]},{"oauth":["assets:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Records per page.","required":false},{"name":"after","in":"query","schema":{"type":"integer","minimum":0,"default":0},"description":"Cursor from the previous response.","required":false},{"name":"client_id","in":"query","schema":{"type":"integer","minimum":1},"description":"Filter by customer ID.","required":false},{"name":"format","in":"query","schema":{"type":"string","enum":["json","csv"],"default":"json"},"description":"Output format.","required":false}],"responses":{"200":{"description":"Page of records","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"client_id":{"type":"integer","minimum":1},"name":{"type":"string"},"platform":{"type":"string"}},"required":["id"]}},"next_after":{"type":["integer","null"]}}}},"text/csv":{"schema":{"type":"string"}}},"headers":{"X-Next-After":{"description":"Pass this value as after to retrieve the next CSV page.","schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"tags":["Assets"],"summary":"Create a record","description":"Use the same idempotency key and payload for retries. Invoice creation produces a draft.","x-opsgeneral-scopes":["assets:write"],"security":[{"bearerAuth":[]},{"oauth":["assets:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string"},"description":"A unique key for this create operation.","required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"integer","minimum":1},"name":{"type":"string"},"platform":{"type":"string"}},"required":["client_id","name","platform"]},"example":{"client_id":1,"name":"Office workstation","platform":"Windows"}}}},"responses":{"200":{"description":"Record","headers":{"ETag":{"description":"Entity tag for optimistic concurrency.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"client_id":{"type":"integer","minimum":1},"name":{"type":"string"},"platform":{"type":"string"}},"required":["id"]}}}},"201":{"description":"Record","headers":{"ETag":{"description":"Entity tag for optimistic concurrency.","schema":{"type":"string"}},"Location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"client_id":{"type":"integer","minimum":1},"name":{"type":"string"},"platform":{"type":"string"}},"required":["id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Record or request conflicts with current state","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"415":{"description":"Unsupported content type","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/assets/{id}":{"get":{"tags":["Assets"],"summary":"Get a record","description":"Read the record and its current ETag.","x-opsgeneral-scopes":["assets:read"],"security":[{"bearerAuth":[]},{"oauth":["assets:read"]}],"parameters":[{"name":"id","in":"path","schema":{"type":"integer","minimum":1},"description":"OpsGeneral record ID.","required":true}],"responses":{"200":{"description":"Record","headers":{"ETag":{"description":"Entity tag for optimistic concurrency.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"client_id":{"type":"integer","minimum":1},"name":{"type":"string"},"platform":{"type":"string"}},"required":["id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Record or route not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"tags":["Assets"],"summary":"Update a record","description":"Update the supplied fields using the current ETag.","x-opsgeneral-scopes":["assets:write"],"security":[{"bearerAuth":[]},{"oauth":["assets:write"]}],"parameters":[{"name":"id","in":"path","schema":{"type":"integer","minimum":1},"description":"OpsGeneral record ID.","required":true},{"name":"If-Match","in":"header","schema":{"type":"string"},"description":"Current ETag, including quotes.","required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"platform":{"type":"string"}}},"example":{"name":"Office workstation"}}}},"responses":{"200":{"description":"Record","headers":{"ETag":{"description":"Entity tag for optimistic concurrency.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"client_id":{"type":"integer","minimum":1},"name":{"type":"string"},"platform":{"type":"string"}},"required":["id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Record or route not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Record or request conflicts with current state","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"412":{"description":"ETag no longer matches","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"415":{"description":"Unsupported content type","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"428":{"description":"Current ETag required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/assets/import":{"post":{"tags":["Assets"],"summary":"Import records","description":"Import up to 100 records as one transaction. Provide an external_id for each source record and use dry_run to preview.","x-opsgeneral-scopes":["assets:write"],"security":[{"bearerAuth":[]},{"oauth":["assets:write"]}],"parameters":[{"name":"dry_run","in":"query","schema":{"type":"boolean"},"description":"Preview a native CSV request.","required":false},{"name":"on_conflict","in":"query","schema":{"type":"string","enum":["skip","update","error"],"default":"skip"},"description":"Conflict policy for a native CSV request.","required":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"client_id":{"type":"integer","minimum":1},"name":{"type":"string"},"platform":{"type":"string"},"external_id":{"type":"string"},"etag":{"type":"string"},"customer_external_id":{"type":"string"}},"required":["external_id"]},"minItems":1,"maxItems":100},"dry_run":{"type":"boolean"},"on_conflict":{"type":"string","enum":["skip","update","error"],"default":"skip"}},"required":["records"]},{"type":"object","properties":{"csv":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"dry_run":{"type":"boolean"},"on_conflict":{"type":"string","enum":["skip","update","error"],"default":"skip"}},"required":["csv"]}]},"example":{"dry_run":true,"records":[{"external_id":"source-123","client_id":1,"name":"Office workstation","platform":"Windows"}]}},"text/csv":{"schema":{"type":"string"}}}},"responses":{"200":{"description":"Import results","content":{"application/json":{"schema":{"type":"object","properties":{"dry_run":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"external_id":{"type":"string"},"id":{"type":"integer","minimum":1},"etag":{"type":"string"},"status":{"type":"string","enum":["created","updated","skipped"]}},"required":["external_id","status"]}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Record or route not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Record or request conflicts with current state","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"412":{"description":"ETag no longer matches","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"415":{"description":"Unsupported content type","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"428":{"description":"Current ETag required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/assets/export":{"get":{"tags":["Assets"],"summary":"Export records","description":"Export one page as CSV or JSON. JSON preserves the original cell text and nested data.","x-opsgeneral-scopes":["assets:read"],"security":[{"bearerAuth":[]},{"oauth":["assets:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Records per page.","required":false},{"name":"after","in":"query","schema":{"type":"integer","minimum":0,"default":0},"description":"Cursor from the previous response.","required":false},{"name":"client_id","in":"query","schema":{"type":"integer","minimum":1},"description":"Filter by customer ID.","required":false},{"name":"format","in":"query","schema":{"type":"string","enum":["json","csv"],"default":"json"},"description":"Output format.","required":false}],"responses":{"200":{"description":"Page of records","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"client_id":{"type":"integer","minimum":1},"name":{"type":"string"},"platform":{"type":"string"}},"required":["id"]}},"next_after":{"type":["integer","null"]}}}},"text/csv":{"schema":{"type":"string"}}},"headers":{"X-Next-After":{"description":"Pass this value as after to retrieve the next CSV page.","schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/tickets":{"get":{"tags":["Tickets"],"summary":"List records","description":"List records by ascending ID. Reuse the returned cursor to load the next page.","x-opsgeneral-scopes":["tickets:read"],"security":[{"bearerAuth":[]},{"oauth":["tickets:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Records per page.","required":false},{"name":"after","in":"query","schema":{"type":"integer","minimum":0,"default":0},"description":"Cursor from the previous response.","required":false},{"name":"client_id","in":"query","schema":{"type":"integer","minimum":1},"description":"Filter by customer ID.","required":false},{"name":"format","in":"query","schema":{"type":"string","enum":["json","csv"],"default":"json"},"description":"Output format.","required":false}],"responses":{"200":{"description":"Page of records","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"client_id":{"type":"integer","minimum":1},"title":{"type":"string"},"description":{"type":"string"},"service_address":{"type":"string"},"priority":{"type":"string","enum":["Low","Normal","High","Urgent"]},"status":{"type":"string","enum":["Open","In progress","Waiting","Resolved"]},"assignee":{"type":"string"},"type":{"type":"string"},"tags":{"type":"string"},"created_at":{"type":"string"}},"required":["id"]}},"next_after":{"type":["integer","null"]}}}},"text/csv":{"schema":{"type":"string"}}},"headers":{"X-Next-After":{"description":"Pass this value as after to retrieve the next CSV page.","schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"tags":["Tickets"],"summary":"Create a record","description":"Use the same idempotency key and payload for retries. Invoice creation produces a draft.","x-opsgeneral-scopes":["tickets:write"],"security":[{"bearerAuth":[]},{"oauth":["tickets:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string"},"description":"A unique key for this create operation.","required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"integer","minimum":1},"title":{"type":"string"},"description":{"type":"string"},"service_address":{"type":"string"},"priority":{"type":"string","enum":["Low","Normal","High","Urgent"]},"status":{"type":"string","enum":["Open","In progress","Waiting","Resolved"]},"assignee":{"type":"string"},"type":{"type":"string"},"tags":{"type":"string"}},"required":["client_id","title","description"]},"example":{"client_id":1,"title":"Printer offline","description":"Reception printer is offline.","priority":"Normal"}}}},"responses":{"200":{"description":"Record","headers":{"ETag":{"description":"Entity tag for optimistic concurrency.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"client_id":{"type":"integer","minimum":1},"title":{"type":"string"},"description":{"type":"string"},"service_address":{"type":"string"},"priority":{"type":"string","enum":["Low","Normal","High","Urgent"]},"status":{"type":"string","enum":["Open","In progress","Waiting","Resolved"]},"assignee":{"type":"string"},"type":{"type":"string"},"tags":{"type":"string"},"created_at":{"type":"string"}},"required":["id"]}}}},"201":{"description":"Record","headers":{"ETag":{"description":"Entity tag for optimistic concurrency.","schema":{"type":"string"}},"Location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"client_id":{"type":"integer","minimum":1},"title":{"type":"string"},"description":{"type":"string"},"service_address":{"type":"string"},"priority":{"type":"string","enum":["Low","Normal","High","Urgent"]},"status":{"type":"string","enum":["Open","In progress","Waiting","Resolved"]},"assignee":{"type":"string"},"type":{"type":"string"},"tags":{"type":"string"},"created_at":{"type":"string"}},"required":["id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Record or request conflicts with current state","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"415":{"description":"Unsupported content type","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/tickets/{id}":{"get":{"tags":["Tickets"],"summary":"Get a record","description":"Read the record and its current ETag.","x-opsgeneral-scopes":["tickets:read"],"security":[{"bearerAuth":[]},{"oauth":["tickets:read"]}],"parameters":[{"name":"id","in":"path","schema":{"type":"integer","minimum":1},"description":"OpsGeneral record ID.","required":true}],"responses":{"200":{"description":"Record","headers":{"ETag":{"description":"Entity tag for optimistic concurrency.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"client_id":{"type":"integer","minimum":1},"title":{"type":"string"},"description":{"type":"string"},"service_address":{"type":"string"},"priority":{"type":"string","enum":["Low","Normal","High","Urgent"]},"status":{"type":"string","enum":["Open","In progress","Waiting","Resolved"]},"assignee":{"type":"string"},"type":{"type":"string"},"tags":{"type":"string"},"created_at":{"type":"string"}},"required":["id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Record or route not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"tags":["Tickets"],"summary":"Update a record","description":"Update the supplied fields using the current ETag.","x-opsgeneral-scopes":["tickets:write"],"security":[{"bearerAuth":[]},{"oauth":["tickets:write"]}],"parameters":[{"name":"id","in":"path","schema":{"type":"integer","minimum":1},"description":"OpsGeneral record ID.","required":true},{"name":"If-Match","in":"header","schema":{"type":"string"},"description":"Current ETag, including quotes.","required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"service_address":{"type":"string"},"priority":{"type":"string","enum":["Low","Normal","High","Urgent"]},"status":{"type":"string","enum":["Open","In progress","Waiting","Resolved"]},"assignee":{"type":"string"},"type":{"type":"string"},"tags":{"type":"string"}}},"example":{"title":"Printer offline"}}}},"responses":{"200":{"description":"Record","headers":{"ETag":{"description":"Entity tag for optimistic concurrency.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"client_id":{"type":"integer","minimum":1},"title":{"type":"string"},"description":{"type":"string"},"service_address":{"type":"string"},"priority":{"type":"string","enum":["Low","Normal","High","Urgent"]},"status":{"type":"string","enum":["Open","In progress","Waiting","Resolved"]},"assignee":{"type":"string"},"type":{"type":"string"},"tags":{"type":"string"},"created_at":{"type":"string"}},"required":["id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Record or route not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Record or request conflicts with current state","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"412":{"description":"ETag no longer matches","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"415":{"description":"Unsupported content type","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"428":{"description":"Current ETag required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/tickets/import":{"post":{"tags":["Tickets"],"summary":"Import records","description":"Import up to 100 records as one transaction. Provide an external_id for each source record and use dry_run to preview.","x-opsgeneral-scopes":["tickets:write"],"security":[{"bearerAuth":[]},{"oauth":["tickets:write"]}],"parameters":[{"name":"dry_run","in":"query","schema":{"type":"boolean"},"description":"Preview a native CSV request.","required":false},{"name":"on_conflict","in":"query","schema":{"type":"string","enum":["skip","update","error"],"default":"skip"},"description":"Conflict policy for a native CSV request.","required":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"client_id":{"type":"integer","minimum":1},"title":{"type":"string"},"description":{"type":"string"},"service_address":{"type":"string"},"priority":{"type":"string","enum":["Low","Normal","High","Urgent"]},"status":{"type":"string","enum":["Open","In progress","Waiting","Resolved"]},"assignee":{"type":"string"},"type":{"type":"string"},"tags":{"type":"string"},"external_id":{"type":"string"},"etag":{"type":"string"},"customer_external_id":{"type":"string"}},"required":["external_id"]},"minItems":1,"maxItems":100},"dry_run":{"type":"boolean"},"on_conflict":{"type":"string","enum":["skip","update","error"],"default":"skip"}},"required":["records"]},{"type":"object","properties":{"csv":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"dry_run":{"type":"boolean"},"on_conflict":{"type":"string","enum":["skip","update","error"],"default":"skip"}},"required":["csv"]}]},"example":{"dry_run":true,"records":[{"external_id":"source-123","client_id":1,"title":"Printer offline","description":"Reception printer is offline.","priority":"Normal"}]}},"text/csv":{"schema":{"type":"string"}}}},"responses":{"200":{"description":"Import results","content":{"application/json":{"schema":{"type":"object","properties":{"dry_run":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"external_id":{"type":"string"},"id":{"type":"integer","minimum":1},"etag":{"type":"string"},"status":{"type":"string","enum":["created","updated","skipped"]}},"required":["external_id","status"]}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Record or route not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Record or request conflicts with current state","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"412":{"description":"ETag no longer matches","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"415":{"description":"Unsupported content type","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"428":{"description":"Current ETag required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/tickets/export":{"get":{"tags":["Tickets"],"summary":"Export records","description":"Export one page as CSV or JSON. JSON preserves the original cell text and nested data.","x-opsgeneral-scopes":["tickets:read"],"security":[{"bearerAuth":[]},{"oauth":["tickets:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Records per page.","required":false},{"name":"after","in":"query","schema":{"type":"integer","minimum":0,"default":0},"description":"Cursor from the previous response.","required":false},{"name":"client_id","in":"query","schema":{"type":"integer","minimum":1},"description":"Filter by customer ID.","required":false},{"name":"format","in":"query","schema":{"type":"string","enum":["json","csv"],"default":"json"},"description":"Output format.","required":false}],"responses":{"200":{"description":"Page of records","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"client_id":{"type":"integer","minimum":1},"title":{"type":"string"},"description":{"type":"string"},"service_address":{"type":"string"},"priority":{"type":"string","enum":["Low","Normal","High","Urgent"]},"status":{"type":"string","enum":["Open","In progress","Waiting","Resolved"]},"assignee":{"type":"string"},"type":{"type":"string"},"tags":{"type":"string"},"created_at":{"type":"string"}},"required":["id"]}},"next_after":{"type":["integer","null"]}}}},"text/csv":{"schema":{"type":"string"}}},"headers":{"X-Next-After":{"description":"Pass this value as after to retrieve the next CSV page.","schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/invoices":{"get":{"tags":["Invoices"],"summary":"List records","description":"List records by ascending ID. Reuse the returned cursor to load the next page.","x-opsgeneral-scopes":["invoices:read"],"security":[{"bearerAuth":[]},{"oauth":["invoices:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Records per page.","required":false},{"name":"after","in":"query","schema":{"type":"integer","minimum":0,"default":0},"description":"Cursor from the previous response.","required":false},{"name":"client_id","in":"query","schema":{"type":"integer","minimum":1},"description":"Filter by customer ID.","required":false},{"name":"format","in":"query","schema":{"type":"string","enum":["json","csv"],"default":"json"},"description":"Output format.","required":false}],"responses":{"200":{"description":"Page of records","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"client_id":{"type":"integer","minimum":1},"name":{"type":"string"},"due_date":{"type":"string","description":"YYYY-MM-DD or an empty string"},"reference":{"type":"string"},"manual_item":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":["integer","null"]},"description":{"type":"string"},"kind":{"type":"string","enum":["Stock","Service","Sales tax"]},"quantity":{"type":"integer","minimum":1},"unit_cents":{"type":"integer"}}}},"created_at":{"type":"string"},"total_cents":{"type":"integer"},"status":{"type":"string","enum":["Draft","Open","Paid"]},"paid_at":{"type":["string","null"]},"billed_time":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"ticket_id":{"type":"integer","minimum":1},"minutes":{"type":"integer"},"rate_cents":{"type":"integer"},"note":{"type":"string"}}}}},"required":["id"]}},"next_after":{"type":["integer","null"]}}}},"text/csv":{"schema":{"type":"string"}}},"headers":{"X-Next-After":{"description":"Pass this value as after to retrieve the next CSV page.","schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"tags":["Invoices"],"summary":"Create a record","description":"Use the same idempotency key and payload for retries. Invoice creation produces a draft.","x-opsgeneral-scopes":["invoices:write"],"security":[{"bearerAuth":[]},{"oauth":["invoices:write"]}],"parameters":[{"name":"Idempotency-Key","in":"header","schema":{"type":"string"},"description":"A unique key for this create operation.","required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"integer","minimum":1},"name":{"type":"string"},"due_date":{"type":"string","description":"YYYY-MM-DD or an empty string"},"reference":{"type":"string"},"manual_item":{"type":"string"},"manual_cents":{"type":"integer"},"lines":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["Catalog","Service","Sales tax"]},"quantity":{"type":"integer","minimum":1},"item_id":{"type":"integer","minimum":1},"description":{"type":"string"},"unit_cents":{"type":"integer"}},"required":["kind","quantity"]}}},"required":["client_id"]},"example":{"client_id":1,"name":"On-site support","lines":[{"kind":"Service","description":"Labor","quantity":2,"unit_cents":7500}]}}}},"responses":{"200":{"description":"Record","headers":{"ETag":{"description":"Entity tag for optimistic concurrency.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"client_id":{"type":"integer","minimum":1},"name":{"type":"string"},"due_date":{"type":"string","description":"YYYY-MM-DD or an empty string"},"reference":{"type":"string"},"manual_item":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":["integer","null"]},"description":{"type":"string"},"kind":{"type":"string","enum":["Stock","Service","Sales tax"]},"quantity":{"type":"integer","minimum":1},"unit_cents":{"type":"integer"}}}},"created_at":{"type":"string"},"total_cents":{"type":"integer"},"status":{"type":"string","enum":["Draft","Open","Paid"]},"paid_at":{"type":["string","null"]},"billed_time":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"ticket_id":{"type":"integer","minimum":1},"minutes":{"type":"integer"},"rate_cents":{"type":"integer"},"note":{"type":"string"}}}}},"required":["id"]}}}},"201":{"description":"Record","headers":{"ETag":{"description":"Entity tag for optimistic concurrency.","schema":{"type":"string"}},"Location":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"client_id":{"type":"integer","minimum":1},"name":{"type":"string"},"due_date":{"type":"string","description":"YYYY-MM-DD or an empty string"},"reference":{"type":"string"},"manual_item":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":["integer","null"]},"description":{"type":"string"},"kind":{"type":"string","enum":["Stock","Service","Sales tax"]},"quantity":{"type":"integer","minimum":1},"unit_cents":{"type":"integer"}}}},"created_at":{"type":"string"},"total_cents":{"type":"integer"},"status":{"type":"string","enum":["Draft","Open","Paid"]},"paid_at":{"type":["string","null"]},"billed_time":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"ticket_id":{"type":"integer","minimum":1},"minutes":{"type":"integer"},"rate_cents":{"type":"integer"},"note":{"type":"string"}}}}},"required":["id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Record or request conflicts with current state","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"415":{"description":"Unsupported content type","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/invoices/{id}":{"get":{"tags":["Invoices"],"summary":"Get a record","description":"Read the record and its current ETag.","x-opsgeneral-scopes":["invoices:read"],"security":[{"bearerAuth":[]},{"oauth":["invoices:read"]}],"parameters":[{"name":"id","in":"path","schema":{"type":"integer","minimum":1},"description":"OpsGeneral record ID.","required":true}],"responses":{"200":{"description":"Record","headers":{"ETag":{"description":"Entity tag for optimistic concurrency.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"client_id":{"type":"integer","minimum":1},"name":{"type":"string"},"due_date":{"type":"string","description":"YYYY-MM-DD or an empty string"},"reference":{"type":"string"},"manual_item":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":["integer","null"]},"description":{"type":"string"},"kind":{"type":"string","enum":["Stock","Service","Sales tax"]},"quantity":{"type":"integer","minimum":1},"unit_cents":{"type":"integer"}}}},"created_at":{"type":"string"},"total_cents":{"type":"integer"},"status":{"type":"string","enum":["Draft","Open","Paid"]},"paid_at":{"type":["string","null"]},"billed_time":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"ticket_id":{"type":"integer","minimum":1},"minutes":{"type":"integer"},"rate_cents":{"type":"integer"},"note":{"type":"string"}}}}},"required":["id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Record or route not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"tags":["Invoices"],"summary":"Update a record","description":"Edit the name, due date, or reference on a draft invoice.","x-opsgeneral-scopes":["invoices:write"],"security":[{"bearerAuth":[]},{"oauth":["invoices:write"]}],"parameters":[{"name":"id","in":"path","schema":{"type":"integer","minimum":1},"description":"OpsGeneral record ID.","required":true},{"name":"If-Match","in":"header","schema":{"type":"string"},"description":"Current ETag, including quotes.","required":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"due_date":{"type":"string","description":"YYYY-MM-DD or an empty string"},"reference":{"type":"string"}}},"example":{"name":"On-site support"}}}},"responses":{"200":{"description":"Record","headers":{"ETag":{"description":"Entity tag for optimistic concurrency.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"client_id":{"type":"integer","minimum":1},"name":{"type":"string"},"due_date":{"type":"string","description":"YYYY-MM-DD or an empty string"},"reference":{"type":"string"},"manual_item":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":["integer","null"]},"description":{"type":"string"},"kind":{"type":"string","enum":["Stock","Service","Sales tax"]},"quantity":{"type":"integer","minimum":1},"unit_cents":{"type":"integer"}}}},"created_at":{"type":"string"},"total_cents":{"type":"integer"},"status":{"type":"string","enum":["Draft","Open","Paid"]},"paid_at":{"type":["string","null"]},"billed_time":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"ticket_id":{"type":"integer","minimum":1},"minutes":{"type":"integer"},"rate_cents":{"type":"integer"},"note":{"type":"string"}}}}},"required":["id"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Record or route not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Record or request conflicts with current state","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"412":{"description":"ETag no longer matches","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"415":{"description":"Unsupported content type","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"428":{"description":"Current ETag required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/invoices/import":{"post":{"tags":["Invoices"],"summary":"Import records","description":"Import up to 100 records as one transaction. Provide an external_id for each source record and use dry_run to preview.","x-opsgeneral-scopes":["invoices:write"],"security":[{"bearerAuth":[]},{"oauth":["invoices:write"]}],"parameters":[{"name":"dry_run","in":"query","schema":{"type":"boolean"},"description":"Preview a native CSV request.","required":false},{"name":"on_conflict","in":"query","schema":{"type":"string","enum":["skip","update","error"],"default":"skip"},"description":"Conflict policy for a native CSV request.","required":false}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"records":{"type":"array","items":{"type":"object","properties":{"client_id":{"type":"integer","minimum":1},"name":{"type":"string"},"due_date":{"type":"string","description":"YYYY-MM-DD or an empty string"},"reference":{"type":"string"},"manual_item":{"type":"string"},"manual_cents":{"type":"integer"},"lines":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["Catalog","Service","Sales tax"]},"quantity":{"type":"integer","minimum":1},"item_id":{"type":"integer","minimum":1},"description":{"type":"string"},"unit_cents":{"type":"integer"}},"required":["kind","quantity"]}},"external_id":{"type":"string"},"etag":{"type":"string"},"customer_external_id":{"type":"string"}},"required":["external_id"]},"minItems":1,"maxItems":100},"dry_run":{"type":"boolean"},"on_conflict":{"type":"string","enum":["skip","update","error"],"default":"skip"}},"required":["records"]},{"type":"object","properties":{"csv":{"type":"string"},"mapping":{"type":"object","additionalProperties":{"type":"string"}},"dry_run":{"type":"boolean"},"on_conflict":{"type":"string","enum":["skip","update","error"],"default":"skip"}},"required":["csv"]}]},"example":{"dry_run":true,"records":[{"external_id":"source-123","client_id":1,"name":"On-site support","lines":[{"kind":"Service","description":"Labor","quantity":2,"unit_cents":7500}]}]}},"text/csv":{"schema":{"type":"string"}}}},"responses":{"200":{"description":"Import results","content":{"application/json":{"schema":{"type":"object","properties":{"dry_run":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"external_id":{"type":"string"},"id":{"type":"integer","minimum":1},"etag":{"type":"string"},"status":{"type":"string","enum":["created","updated","skipped"]}},"required":["external_id","status"]}}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Record or route not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Record or request conflicts with current state","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"412":{"description":"ETag no longer matches","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Payload too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"415":{"description":"Unsupported content type","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"428":{"description":"Current ETag required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/invoices/export":{"get":{"tags":["Invoices"],"summary":"Export records","description":"Export one page as CSV or JSON. JSON preserves the original cell text and nested data.","x-opsgeneral-scopes":["invoices:read"],"security":[{"bearerAuth":[]},{"oauth":["invoices:read"]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Records per page.","required":false},{"name":"after","in":"query","schema":{"type":"integer","minimum":0,"default":0},"description":"Cursor from the previous response.","required":false},{"name":"client_id","in":"query","schema":{"type":"integer","minimum":1},"description":"Filter by customer ID.","required":false},{"name":"format","in":"query","schema":{"type":"string","enum":["json","csv"],"default":"json"},"description":"Output format.","required":false}],"responses":{"200":{"description":"Page of records","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"client_id":{"type":"integer","minimum":1},"name":{"type":"string"},"due_date":{"type":"string","description":"YYYY-MM-DD or an empty string"},"reference":{"type":"string"},"manual_item":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":["integer","null"]},"description":{"type":"string"},"kind":{"type":"string","enum":["Stock","Service","Sales tax"]},"quantity":{"type":"integer","minimum":1},"unit_cents":{"type":"integer"}}}},"created_at":{"type":"string"},"total_cents":{"type":"integer"},"status":{"type":"string","enum":["Draft","Open","Paid"]},"paid_at":{"type":["string","null"]},"billed_time":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"ticket_id":{"type":"integer","minimum":1},"minutes":{"type":"integer"},"rate_cents":{"type":"integer"},"note":{"type":"string"}}}}},"required":["id"]}},"next_after":{"type":["integer","null"]}}}},"text/csv":{"schema":{"type":"string"}}},"headers":{"X-Next-After":{"description":"Pass this value as after to retrieve the next CSV page.","schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/changes":{"get":{"tags":["Synchronization"],"summary":"Read the change feed","description":"Read workspace changes in event order. Events are filtered by the read scopes on the credential.","x-opsgeneral-scopes":[],"security":[{"bearerAuth":[]},{"oauth":[]}],"parameters":[{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Records per page.","required":false},{"name":"after","in":"query","schema":{"type":"integer","minimum":0,"default":0},"description":"Cursor from the previous response.","required":false}],"responses":{"200":{"description":"Change events","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":1},"resource":{"type":"string","enum":["customers","assets","tickets","invoices"]},"record_id":{"type":"integer","minimum":1},"operation":{"type":"string","enum":["created","updated","deleted"]},"changed_at":{"type":"string"}}}},"next_after":{"type":"integer"},"has_more":{"type":"boolean"}}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, or revoked credential","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Insufficient scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace API unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}}}}