{"openapi":"3.1.0","info":{"title":"DrillerDB Public API","version":"v1","description":"Read-only REST API for DrillerDB ETL and reporting integrations. Enterprise plan required. Every response carries meta.request_id. List endpoints are cursor-paginated through meta.next_cursor. Invoice payment_status and balance are computed from the invoice total and payments recorded against it, not read from cached columns, so they reflect what is actually owed."},"servers":[{"url":"https://console.drillerdb.com/api/partner/v1"}],"tags":[{"name":"Projects"},{"name":"Invoices"},{"name":"Work Orders"},{"name":"Contacts"},{"name":"Equipment"},{"name":"Inventory"},{"name":"Documentation"}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"}},"parameters":{"LimitParam":{"name":"limit","in":"query","description":"Page size. Maximum 200.","schema":{"type":"integer","default":50,"maximum":200,"minimum":1}},"CursorParam":{"name":"cursor","in":"query","description":"Opaque cursor returned from a previous list response.","schema":{"type":"string"}},"UpdatedSinceParam":{"name":"updated_since","in":"query","description":"Return records updated at or after this timestamp.","schema":{"type":"string","format":"date-time"}},"ProjectIdParam":{"name":"intWellKey","in":"path","required":true,"description":"Project identifier.","schema":{"type":"integer"}},"WorkOrderIdParam":{"name":"id","in":"path","required":true,"description":"Work order identifier.","schema":{"type":"integer"}},"ContactIdParam":{"name":"rolodexId","in":"path","required":true,"description":"Contact identifier.","schema":{"type":"integer"}},"EquipmentIdParam":{"name":"equipmentId","in":"path","required":true,"description":"Equipment identifier.","schema":{"type":"string"}},"InventoryItemIdParam":{"name":"id","in":"path","required":true,"description":"Inventory item identifier.","schema":{"type":"integer"}}},"schemas":{"Project":{"type":"object","properties":{"id":{"type":"integer"},"project_number":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"priority":{"type":["integer","null"]},"customer_id":{"type":["integer","null"]},"customer_name":{"type":"string"},"address":{"type":"object","properties":{"line1":{"type":["string","null"]},"line2":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"postal_code":{"type":["string","null"]}}},"drill_type":{"type":["string","null"]},"well_type":{"type":["string","null"]},"created_by":{"type":["string","null"]},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"Invoice":{"type":"object","properties":{"id":{"type":"integer"},"invoice_number":{"type":"string"},"status":{"type":"string","description":"Document lifecycle state as stored (draft, sent, paid, void, ...)."},"payment_status":{"type":"string","enum":["open","partial","paid"],"description":"Derived from the invoice total and recorded payments, not from a stored column."},"invoice_date":{"type":["string","null"]},"due_date":{"type":["string","null"],"format":"date"},"due_terms_raw":{"type":["string","null"],"description":"The stored customer_invoices.due_date string, which may be a date or payment terms such as \"30\" or \"receipt\". due_date carries the resolved date."},"invoice_total_cents":{"type":["integer","null"]},"balance":{"type":["number","null"],"description":"Amount still owed, derived alongside payment_status."},"paid_amount":{"type":["number","null"]},"created_at":{"type":["string","null"],"format":"date-time"},"paid_at":{"type":["string","null"],"format":"date-time"},"last_sent_at":{"type":["string","null"],"format":"date-time"},"project_id":{"type":["integer","null"]}}},"WorkOrder":{"type":"object","properties":{"id":{"type":"integer"},"project_id":{"type":["integer","null"]},"status":{"type":"string"},"category":{"type":"string"},"work_type":{"type":["string","null"]},"field_tech":{"type":["string","null"]},"service_date":{"type":["string","null"]},"completed_at":{"type":["string","null"]},"customer_id":{"type":["integer","null"]},"customer_name":{"type":"string"},"project_title":{"type":["string","null"]},"memo":{"type":["string","null"]},"amount_billed":{"type":["string","number","null"]}}},"Contact":{"type":"object","properties":{"id":{"type":"integer"},"business_name":{"type":["string","null"]},"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"email":{"type":["string","null"]},"billing_email":{"type":["string","null"]},"phone":{"type":["string","null"]},"cell":{"type":["string","null"]},"address":{"type":"object","properties":{"line1":{"type":["string","null"]},"line2":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"postal_code":{"type":["string","null"]}}},"is_client":{"type":"boolean"},"is_vendor":{"type":"boolean"},"is_active":{"type":"boolean"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"Equipment":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"make":{"type":["string","null"]},"model":{"type":["string","null"]},"year":{"type":["integer","null"]},"status":{"type":["string","null"]},"category":{"type":["string","null"]},"assigned_employee_id":{"type":["string","integer","null"]},"last_location":{"type":"object","properties":{"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"updated_at":{"type":["string","null"],"format":"date-time"}}},"updated_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":["string","null"],"format":"date-time"}}},"InventoryItem":{"type":"object","properties":{"id":{"type":"integer"},"item_id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"category":{"type":["string","null"]},"current_quantity":{"type":["number","null"]},"min_quantity":{"type":["number","null"]},"max_quantity":{"type":["number","null"]},"unit":{"type":["string","null"]},"unit_price":{"type":["number","null"]},"location":{"type":["string","null"]},"sku":{"type":["string","null"]},"is_active":{"type":["boolean","null"]},"last_restocked_date":{"type":["string","null"]},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"meta":{"type":"object","properties":{"request_id":{"type":"string"}}},"links":{"type":"object","properties":{"self":{"type":"string"}}}},"required":["error","meta"]}},"responses":{"UnauthorizedResponse":{"description":"Missing, invalid, inactive, or expired API key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ForbiddenResponse":{"description":"The company is not on the Enterprise plan, or the key lacks the required scope.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFoundResponse":{"description":"No such record for this company.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimitedResponse":{"description":"Per-minute or per-day rate limit exceeded. See the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ServiceUnavailableResponse":{"description":"The API schema is not available.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/projects":{"get":{"operationId":"listProjects","tags":["Projects"],"summary":"List projects","responses":{"200":{"description":"List projects","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Project"}},"meta":{"type":"object","properties":{"request_id":{"type":"string"},"limit":{"type":"integer"},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}},"links":{"type":"object","properties":{"self":{"type":"string"},"next":{"type":"string"}}}},"required":["data","meta","links"]}}}},"401":{"$ref":"#/components/responses/UnauthorizedResponse"},"403":{"$ref":"#/components/responses/ForbiddenResponse"},"429":{"$ref":"#/components/responses/RateLimitedResponse"},"503":{"$ref":"#/components/responses/ServiceUnavailableResponse"}},"parameters":[{"$ref":"#/components/parameters/LimitParam"},{"$ref":"#/components/parameters/CursorParam"},{"$ref":"#/components/parameters/UpdatedSinceParam"}],"security":[{"ApiKeyAuth":[]}],"description":"Requires the `projects:read` scope."}},"/projects/{intWellKey}":{"get":{"operationId":"getProject","tags":["Projects"],"summary":"Get a project","responses":{"200":{"description":"Get a project","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Project"},"meta":{"type":"object","properties":{"request_id":{"type":"string"}}},"links":{"type":"object","properties":{"self":{"type":"string"}}}},"required":["data","meta","links"]}}}},"401":{"$ref":"#/components/responses/UnauthorizedResponse"},"403":{"$ref":"#/components/responses/ForbiddenResponse"},"404":{"$ref":"#/components/responses/NotFoundResponse"},"429":{"$ref":"#/components/responses/RateLimitedResponse"},"503":{"$ref":"#/components/responses/ServiceUnavailableResponse"}},"parameters":[{"$ref":"#/components/parameters/ProjectIdParam"}],"security":[{"ApiKeyAuth":[]}],"description":"Requires the `projects:read` scope."}},"/projects/{intWellKey}/invoices":{"get":{"operationId":"listProjectInvoices","tags":["Invoices"],"summary":"List a project's invoices","responses":{"200":{"description":"List a project's invoices","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}},"meta":{"type":"object","properties":{"request_id":{"type":"string"},"limit":{"type":"integer"},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}},"links":{"type":"object","properties":{"self":{"type":"string"},"next":{"type":"string"}}}},"required":["data","meta","links"]}}}},"401":{"$ref":"#/components/responses/UnauthorizedResponse"},"403":{"$ref":"#/components/responses/ForbiddenResponse"},"429":{"$ref":"#/components/responses/RateLimitedResponse"},"503":{"$ref":"#/components/responses/ServiceUnavailableResponse"}},"parameters":[{"$ref":"#/components/parameters/ProjectIdParam"},{"$ref":"#/components/parameters/LimitParam"},{"$ref":"#/components/parameters/CursorParam"}],"security":[{"ApiKeyAuth":[]}],"description":"Requires the `invoices:read` scope."}},"/work-orders":{"get":{"operationId":"listWorkOrders","tags":["Work Orders"],"summary":"List work orders","responses":{"200":{"description":"List work orders","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkOrder"}},"meta":{"type":"object","properties":{"request_id":{"type":"string"},"limit":{"type":"integer"},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}},"links":{"type":"object","properties":{"self":{"type":"string"},"next":{"type":"string"}}}},"required":["data","meta","links"]}}}},"401":{"$ref":"#/components/responses/UnauthorizedResponse"},"403":{"$ref":"#/components/responses/ForbiddenResponse"},"429":{"$ref":"#/components/responses/RateLimitedResponse"},"503":{"$ref":"#/components/responses/ServiceUnavailableResponse"}},"parameters":[{"$ref":"#/components/parameters/LimitParam"},{"$ref":"#/components/parameters/CursorParam"}],"security":[{"ApiKeyAuth":[]}],"description":"Requires the `work_orders:read` scope."}},"/work-orders/{id}":{"get":{"operationId":"getWorkOrder","tags":["Work Orders"],"summary":"Get a work order","responses":{"200":{"description":"Get a work order","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WorkOrder"},"meta":{"type":"object","properties":{"request_id":{"type":"string"}}},"links":{"type":"object","properties":{"self":{"type":"string"}}}},"required":["data","meta","links"]}}}},"401":{"$ref":"#/components/responses/UnauthorizedResponse"},"403":{"$ref":"#/components/responses/ForbiddenResponse"},"404":{"$ref":"#/components/responses/NotFoundResponse"},"429":{"$ref":"#/components/responses/RateLimitedResponse"},"503":{"$ref":"#/components/responses/ServiceUnavailableResponse"}},"parameters":[{"$ref":"#/components/parameters/WorkOrderIdParam"}],"security":[{"ApiKeyAuth":[]}],"description":"Requires the `work_orders:read` scope."}},"/contacts":{"get":{"operationId":"listContacts","tags":["Contacts"],"summary":"List contacts","responses":{"200":{"description":"List contacts","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"meta":{"type":"object","properties":{"request_id":{"type":"string"},"limit":{"type":"integer"},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}},"links":{"type":"object","properties":{"self":{"type":"string"},"next":{"type":"string"}}}},"required":["data","meta","links"]}}}},"401":{"$ref":"#/components/responses/UnauthorizedResponse"},"403":{"$ref":"#/components/responses/ForbiddenResponse"},"429":{"$ref":"#/components/responses/RateLimitedResponse"},"503":{"$ref":"#/components/responses/ServiceUnavailableResponse"}},"parameters":[{"$ref":"#/components/parameters/LimitParam"},{"$ref":"#/components/parameters/CursorParam"},{"$ref":"#/components/parameters/UpdatedSinceParam"}],"security":[{"ApiKeyAuth":[]}],"description":"Requires the `contacts:read` scope."}},"/contacts/{rolodexId}":{"get":{"operationId":"getContact","tags":["Contacts"],"summary":"Get a contact","responses":{"200":{"description":"Get a contact","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Contact"},"meta":{"type":"object","properties":{"request_id":{"type":"string"}}},"links":{"type":"object","properties":{"self":{"type":"string"}}}},"required":["data","meta","links"]}}}},"401":{"$ref":"#/components/responses/UnauthorizedResponse"},"403":{"$ref":"#/components/responses/ForbiddenResponse"},"404":{"$ref":"#/components/responses/NotFoundResponse"},"429":{"$ref":"#/components/responses/RateLimitedResponse"},"503":{"$ref":"#/components/responses/ServiceUnavailableResponse"}},"parameters":[{"$ref":"#/components/parameters/ContactIdParam"}],"security":[{"ApiKeyAuth":[]}],"description":"Requires the `contacts:read` scope."}},"/equipment":{"get":{"operationId":"listEquipment","tags":["Equipment"],"summary":"List equipment","responses":{"200":{"description":"List equipment","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Equipment"}},"meta":{"type":"object","properties":{"request_id":{"type":"string"},"limit":{"type":"integer"},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}},"links":{"type":"object","properties":{"self":{"type":"string"},"next":{"type":"string"}}}},"required":["data","meta","links"]}}}},"401":{"$ref":"#/components/responses/UnauthorizedResponse"},"403":{"$ref":"#/components/responses/ForbiddenResponse"},"429":{"$ref":"#/components/responses/RateLimitedResponse"},"503":{"$ref":"#/components/responses/ServiceUnavailableResponse"}},"parameters":[{"$ref":"#/components/parameters/LimitParam"},{"$ref":"#/components/parameters/CursorParam"},{"$ref":"#/components/parameters/UpdatedSinceParam"}],"security":[{"ApiKeyAuth":[]}],"description":"Requires the `equipment:read` scope."}},"/equipment/{equipmentId}":{"get":{"operationId":"getEquipment","tags":["Equipment"],"summary":"Get an equipment item","responses":{"200":{"description":"Get an equipment item","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Equipment"},"meta":{"type":"object","properties":{"request_id":{"type":"string"}}},"links":{"type":"object","properties":{"self":{"type":"string"}}}},"required":["data","meta","links"]}}}},"401":{"$ref":"#/components/responses/UnauthorizedResponse"},"403":{"$ref":"#/components/responses/ForbiddenResponse"},"404":{"$ref":"#/components/responses/NotFoundResponse"},"429":{"$ref":"#/components/responses/RateLimitedResponse"},"503":{"$ref":"#/components/responses/ServiceUnavailableResponse"}},"parameters":[{"$ref":"#/components/parameters/EquipmentIdParam"}],"security":[{"ApiKeyAuth":[]}],"description":"Requires the `equipment:read` scope."}},"/inventory/items":{"get":{"operationId":"listInventoryItems","tags":["Inventory"],"summary":"List inventory items","responses":{"200":{"description":"List inventory items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InventoryItem"}},"meta":{"type":"object","properties":{"request_id":{"type":"string"},"limit":{"type":"integer"},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}},"links":{"type":"object","properties":{"self":{"type":"string"},"next":{"type":"string"}}}},"required":["data","meta","links"]}}}},"401":{"$ref":"#/components/responses/UnauthorizedResponse"},"403":{"$ref":"#/components/responses/ForbiddenResponse"},"429":{"$ref":"#/components/responses/RateLimitedResponse"},"503":{"$ref":"#/components/responses/ServiceUnavailableResponse"}},"parameters":[{"$ref":"#/components/parameters/LimitParam"},{"$ref":"#/components/parameters/CursorParam"},{"$ref":"#/components/parameters/UpdatedSinceParam"}],"security":[{"ApiKeyAuth":[]}],"description":"Requires the `inventory:read` scope."}},"/inventory/items/{id}":{"get":{"operationId":"getInventoryItem","tags":["Inventory"],"summary":"Get an inventory item","responses":{"200":{"description":"Get an inventory item","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/InventoryItem"},"meta":{"type":"object","properties":{"request_id":{"type":"string"}}},"links":{"type":"object","properties":{"self":{"type":"string"}}}},"required":["data","meta","links"]}}}},"401":{"$ref":"#/components/responses/UnauthorizedResponse"},"403":{"$ref":"#/components/responses/ForbiddenResponse"},"404":{"$ref":"#/components/responses/NotFoundResponse"},"429":{"$ref":"#/components/responses/RateLimitedResponse"},"503":{"$ref":"#/components/responses/ServiceUnavailableResponse"}},"parameters":[{"$ref":"#/components/parameters/InventoryItemIdParam"}],"security":[{"ApiKeyAuth":[]}],"description":"Requires the `inventory:read` scope."}},"/openapi.json":{"get":{"operationId":"getOpenApiDocument","tags":["Documentation"],"summary":"This document","responses":{"200":{"description":"OpenAPI document","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"x-link-prefix":"/api/partner/v1"}