{"openapi":"3.1.0","info":{"title":"WorkHub API","version":"1","description":"Read and change a WorkHub workspace's data from your own software. Create a key in Settings → API and send it as \"Authorization: Bearer whk_…\". Read-only keys can only GET; \"read and write\" keys can also create and change tasks, leads, contacts and activities, under the same rules as the app. A key acts as the admin who created it and stops working if they leave or stop being an admin. Each key can make 600 requests a minute. Lists are returned oldest first, a page at a time: pass \"nextCursor\" back as \"cursor\" until it is null."},"servers":[{"url":"https://workhub-staging.onrender.com/api"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key from Settings → API."}},"schemas":{"Me":{"type":"object","properties":{"workspace":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"timezone":{"type":"string","description":"IANA time zone, e.g. Asia/Karachi"}},"required":["id","name","timezone"]},"actingAs":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","manager","member","guest"]}},"required":["id","name","email","role"]}},"required":["workspace","actingAs"]},"Person":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","manager","member","guest"]},"employeeCode":{"type":["string","null"]},"team":{"type":["string","null"]},"clientCompanyId":{"type":["string","null"],"description":"For a client contact (a guest): their company.","format":"uuid"},"joinedAt":{"type":"string","format":"date-time"}},"required":["id","name","email","role","employeeCode","team","clientCompanyId","joinedAt"]},"AttendanceDay":{"type":"object","properties":{"userId":{"type":"string","format":"uuid"},"name":{"type":"string"},"employeeCode":{"type":["string","null"]},"date":{"type":"string","format":"date"},"status":{"type":"string","description":"present, late, half_day, absent, on_leave, holiday, weekend or not_started"},"flags":{"type":"array","items":{"type":"string"}},"checkInAt":{"type":["string","null"],"format":"date-time"},"checkOutAt":{"type":["string","null"],"format":"date-time"},"workedMinutes":{"type":"integer"},"breakMinutes":{"type":"integer"},"lateMinutes":{"type":"integer"},"shiftName":{"type":["string","null"]},"holidayName":{"type":["string","null"]},"leave":{"type":["object","null"],"properties":{"typeName":{"type":"string"},"fraction":{"type":"number"},"paid":{"type":"boolean"}}}},"required":["userId","name","employeeCode","date","status","flags","checkInAt","checkOutAt","workedMinutes","breakMinutes","lateMinutes","shiftName","holidayName","leave"]},"LeaveRequest":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"userName":{"type":"string"},"leaveType":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"paid":{"type":"boolean"}},"required":["id","name","paid"]},"startDate":{"type":"string","format":"date"},"endDate":{"type":"string","format":"date"},"halfDay":{"type":"string","enum":["none","first","second"]},"days":{"type":"number"},"reason":{"type":["string","null"]},"status":{"type":"string","enum":["pending","approved","rejected","cancelled"]},"decidedBy":{"type":["string","null"],"format":"uuid"},"decidedAt":{"type":["string","null"],"format":"date-time"},"decisionNote":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","userId","userName","leaveType","startDate","endDate","halfDay","days","reason","status","decidedBy","decidedAt","decisionNote","createdAt"]},"TimeEntry":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"projectId":{"type":"string","format":"uuid"},"taskId":{"type":["string","null"],"format":"uuid"},"date":{"type":"string","format":"date"},"minutes":{"type":"integer"},"note":{"type":["string","null"]},"billable":{"type":"boolean"},"source":{"type":"string","enum":["manual","timer"]},"approved":{"type":"boolean","description":"True when the person's timesheet for that week was approved."},"invoiceId":{"type":["string","null"],"description":"The client invoice these hours were billed on.","format":"uuid"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","userId","projectId","taskId","date","minutes","note","billable","source","approved","invoiceId","createdAt"]},"Project":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","on_hold","completed","archived"]},"clientId":{"type":["string","null"],"format":"uuid"},"budgetHours":{"type":["number","null"]},"hourlyRate":{"type":["number","null"]},"rateCurrency":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","description","status","clientId","budgetHours","hourlyRate","rateCurrency","createdAt","updatedAt"]},"Task":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"projectId":{"type":"string","format":"uuid"},"parentTaskId":{"type":["string","null"],"format":"uuid"},"column":{"type":"string","description":"The board column it is in, e.g. \"In progress\"."},"title":{"type":"string"},"description":{"type":["string","null"]},"priority":{"type":"string","enum":["none","low","medium","high","urgent"]},"startDate":{"type":["string","null"],"format":"date"},"dueDate":{"type":["string","null"],"format":"date"},"estimateHours":{"type":["number","null"]},"assigneeIds":{"type":"array","items":{"type":"string","format":"uuid"}},"completed":{"type":"boolean"},"completedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","projectId","parentTaskId","column","title","description","priority","startDate","dueDate","estimateHours","assigneeIds","completed","completedAt","createdAt","updatedAt"]},"Company":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"website":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"industry":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"address":{"type":["string","null"]},"notes":{"type":["string","null"]},"ownerId":{"type":["string","null"],"format":"uuid"},"custom":{"type":"object","description":"Custom field values, by field key.","additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","website","email","phone","industry","city","country","address","notes","ownerId","custom","createdAt","updatedAt"]},"Contact":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"companyId":{"type":["string","null"],"format":"uuid"},"firstName":{"type":"string"},"lastName":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"title":{"type":["string","null"]},"notes":{"type":["string","null"]},"ownerId":{"type":["string","null"],"format":"uuid"},"leadId":{"type":["string","null"],"format":"uuid"},"custom":{"type":"object","description":"Custom field values, by field key.","additionalProperties":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","companyId","firstName","lastName","email","phone","title","notes","ownerId","leadId","custom","createdAt","updatedAt"]},"Lead":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"companyName":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"source":{"type":"string"},"sourceDetail":{"type":["string","null"]},"status":{"type":"string","enum":["new","contacted","qualified","unqualified","converted"]},"value":{"type":["number","null"]},"currency":{"type":"string"},"notes":{"type":["string","null"]},"ownerId":{"type":["string","null"],"format":"uuid"},"custom":{"type":"object","description":"Custom field values, by field key.","additionalProperties":true},"convertedContactId":{"type":["string","null"],"format":"uuid"},"convertedCompanyId":{"type":["string","null"],"format":"uuid"},"convertedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","companyName","email","phone","source","sourceDetail","status","value","currency","notes","ownerId","custom","convertedContactId","convertedCompanyId","convertedAt","createdAt","updatedAt"]},"Deal":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"value":{"type":["number","null"]},"currency":{"type":"string"},"pipeline":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"stage":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"status":{"type":"string","enum":["open","won","lost"]},"companyId":{"type":["string","null"],"format":"uuid"},"contactId":{"type":["string","null"],"format":"uuid"},"leadId":{"type":["string","null"],"format":"uuid"},"ownerId":{"type":["string","null"],"format":"uuid"},"projectId":{"type":["string","null"],"format":"uuid"},"expectedClose":{"type":["string","null"],"format":"date"},"wonAt":{"type":["string","null"],"format":"date-time"},"lostAt":{"type":["string","null"],"format":"date-time"},"lostReason":{"type":["string","null"]},"notes":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","title","value","currency","pipeline","stage","status","companyId","contactId","leadId","ownerId","projectId","expectedClose","wonAt","lostAt","lostReason","notes","createdAt","updatedAt"]},"Invoice":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"number":{"type":"string"},"companyId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["draft","sent","paid","void"]},"currency":{"type":"string"},"issueDate":{"type":"string","format":"date"},"dueDate":{"type":["string","null"],"format":"date"},"subtotal":{"type":"number"},"taxLabel":{"type":["string","null"]},"taxRate":{"type":"number"},"taxAmount":{"type":"number"},"total":{"type":"number"},"sentAt":{"type":["string","null"],"format":"date-time"},"paidAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","number","companyId","status","currency","issueDate","dueDate","subtotal","taxLabel","taxRate","taxAmount","total","sentAt","paidAt","createdAt"]},"InvoiceLine":{"type":"object","properties":{"description":{"type":"string"},"quantity":{"type":"number"},"unitPrice":{"type":"number"},"amount":{"type":"number"},"projectId":{"type":["string","null"],"format":"uuid"}},"required":["description","quantity","unitPrice","amount","projectId"]},"Activity":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["call","meeting","email","whatsapp","note","task"]},"subject":{"type":"string"},"body":{"type":["string","null"]},"dueAt":{"type":["string","null"],"format":"date-time"},"done":{"type":"boolean"},"doneAt":{"type":["string","null"],"format":"date-time"},"ownerId":{"type":["string","null"],"format":"uuid"},"dealId":{"type":["string","null"],"format":"uuid"},"companyId":{"type":["string","null"],"format":"uuid"},"contactId":{"type":["string","null"],"format":"uuid"},"leadId":{"type":["string","null"],"format":"uuid"},"createdBy":{"type":["string","null"],"format":"uuid"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","kind","subject","body","dueAt","done","doneAt","ownerId","dealId","companyId","contactId","leadId","createdBy","createdAt","updatedAt"]},"TaskFields":{"type":"object","properties":{"description":{"type":["string","null"]},"priority":{"type":"string","enum":["none","low","medium","high","urgent"]},"startDate":{"type":["string","null"],"format":"date"},"dueDate":{"type":["string","null"],"format":"date"},"estimateHours":{"type":["number","null"]},"assigneeIds":{"type":"array","items":{"type":"string","format":"uuid"},"description":"Replaces the assignees. Each must be able to see the project."},"completed":{"type":"boolean"}}},"NewTask":{"allOf":[{"type":"object","required":["projectId","title"],"properties":{"projectId":{"type":"string","format":"uuid"},"title":{"type":"string"},"columnId":{"type":"string","format":"uuid","description":"Defaults to the first column."},"parentTaskId":{"type":"string","format":"uuid","description":"Makes it a subtask."}}},{"$ref":"#/components/schemas/TaskFields"}]},"TaskChanges":{"allOf":[{"type":"object","properties":{"title":{"type":"string"},"columnId":{"type":"string","format":"uuid","description":"Moves it to the bottom of this column."}}},{"$ref":"#/components/schemas/TaskFields"}]},"LeadFields":{"type":"object","properties":{"name":{"type":"string"},"companyName":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"source":{"type":"string","enum":["upwork","fiverr","linkedin","whatsapp","referral","website","facebook","instagram","cold_call","event","other"]},"sourceDetail":{"type":["string","null"]},"status":{"type":"string","enum":["new","contacted","qualified","unqualified"]},"value":{"type":["number","null"]},"currency":{"type":"string"},"notes":{"type":["string","null"]},"ownerId":{"type":["string","null"],"format":"uuid"},"custom":{"type":"object","description":"Custom field values, by field key.","additionalProperties":true}}},"ContactFields":{"type":"object","properties":{"firstName":{"type":"string"},"lastName":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"title":{"type":["string","null"]},"companyId":{"type":["string","null"],"format":"uuid"},"notes":{"type":["string","null"]},"ownerId":{"type":["string","null"],"format":"uuid"},"custom":{"type":"object","description":"Custom field values, by field key.","additionalProperties":true}}},"NewActivity":{"type":"object","required":["kind","subject"],"description":"Link it to at least one of a deal, company, contact or lead. With dueAt it is a follow-up and its owner is reminded; without, it is logged as done.","properties":{"kind":{"type":"string","enum":["call","meeting","email","whatsapp","note","task"]},"subject":{"type":"string"},"body":{"type":["string","null"]},"dueAt":{"type":["string","null"],"format":"date-time"},"done":{"type":"boolean"},"dealId":{"type":["string","null"],"format":"uuid"},"companyId":{"type":["string","null"],"format":"uuid"},"contactId":{"type":["string","null"],"format":"uuid"},"leadId":{"type":["string","null"],"format":"uuid"},"ownerId":{"type":["string","null"],"format":"uuid"}}},"Error":{"type":"object","properties":{"statusCode":{"type":"integer"},"message":{"type":"string"}}},"InvoiceWithLines":{"allOf":[{"$ref":"#/components/schemas/Invoice"},{"type":"object","properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceLine"}}},"required":["lines"]}]},"AttendancePunch":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"userId":{"type":"string","format":"uuid"},"name":{"type":["string","null"]},"employeeCode":{"type":["string","null"]},"date":{"type":"string","format":"date","description":"The workday it counts towards (a night shift can start the day before)."},"at":{"type":"string","format":"date-time"},"offline":{"type":"boolean","description":"Recorded without a connection and sent later."},"inZone":{"type":["boolean","null"],"description":"Inside an office zone, when the workspace uses them."},"flags":{"type":"array","items":{"type":"string"}}},"required":["id","userId","name","employeeCode","date","at","offline","inZone","flags"]}}},"webhooks":{"attendance.checked_in":{"post":{"summary":"Someone checks in","description":"Signed: the WorkHub-Signature header is \"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the signing secret>\". WorkHub-Event and WorkHub-Delivery name the event and the delivery.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The delivery; the same as WorkHub-Delivery."},"event":{"type":"string","const":"attendance.checked_in"},"createdAt":{"type":"string","format":"date-time"},"workspaceId":{"type":"string","format":"uuid"},"data":{"$ref":"#/components/schemas/AttendancePunch"}},"required":["id","event","createdAt","workspaceId","data"]}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds means it arrived. Anything else is retried for about a day."}}}},"attendance.checked_out":{"post":{"summary":"Someone checks out","description":"Signed: the WorkHub-Signature header is \"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the signing secret>\". WorkHub-Event and WorkHub-Delivery name the event and the delivery.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The delivery; the same as WorkHub-Delivery."},"event":{"type":"string","const":"attendance.checked_out"},"createdAt":{"type":"string","format":"date-time"},"workspaceId":{"type":"string","format":"uuid"},"data":{"$ref":"#/components/schemas/AttendancePunch"}},"required":["id","event","createdAt","workspaceId","data"]}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds means it arrived. Anything else is retried for about a day."}}}},"leave.requested":{"post":{"summary":"Leave is requested","description":"Signed: the WorkHub-Signature header is \"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the signing secret>\". WorkHub-Event and WorkHub-Delivery name the event and the delivery.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The delivery; the same as WorkHub-Delivery."},"event":{"type":"string","const":"leave.requested"},"createdAt":{"type":"string","format":"date-time"},"workspaceId":{"type":"string","format":"uuid"},"data":{"$ref":"#/components/schemas/LeaveRequest"}},"required":["id","event","createdAt","workspaceId","data"]}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds means it arrived. Anything else is retried for about a day."}}}},"leave.approved":{"post":{"summary":"Leave is approved","description":"Signed: the WorkHub-Signature header is \"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the signing secret>\". WorkHub-Event and WorkHub-Delivery name the event and the delivery.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The delivery; the same as WorkHub-Delivery."},"event":{"type":"string","const":"leave.approved"},"createdAt":{"type":"string","format":"date-time"},"workspaceId":{"type":"string","format":"uuid"},"data":{"$ref":"#/components/schemas/LeaveRequest"}},"required":["id","event","createdAt","workspaceId","data"]}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds means it arrived. Anything else is retried for about a day."}}}},"leave.rejected":{"post":{"summary":"Leave is rejected","description":"Signed: the WorkHub-Signature header is \"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the signing secret>\". WorkHub-Event and WorkHub-Delivery name the event and the delivery.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The delivery; the same as WorkHub-Delivery."},"event":{"type":"string","const":"leave.rejected"},"createdAt":{"type":"string","format":"date-time"},"workspaceId":{"type":"string","format":"uuid"},"data":{"$ref":"#/components/schemas/LeaveRequest"}},"required":["id","event","createdAt","workspaceId","data"]}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds means it arrived. Anything else is retried for about a day."}}}},"task.created":{"post":{"summary":"A task is created","description":"Signed: the WorkHub-Signature header is \"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the signing secret>\". WorkHub-Event and WorkHub-Delivery name the event and the delivery.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The delivery; the same as WorkHub-Delivery."},"event":{"type":"string","const":"task.created"},"createdAt":{"type":"string","format":"date-time"},"workspaceId":{"type":"string","format":"uuid"},"data":{"$ref":"#/components/schemas/Task"}},"required":["id","event","createdAt","workspaceId","data"]}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds means it arrived. Anything else is retried for about a day."}}}},"task.completed":{"post":{"summary":"A task is completed","description":"Signed: the WorkHub-Signature header is \"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the signing secret>\". WorkHub-Event and WorkHub-Delivery name the event and the delivery.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The delivery; the same as WorkHub-Delivery."},"event":{"type":"string","const":"task.completed"},"createdAt":{"type":"string","format":"date-time"},"workspaceId":{"type":"string","format":"uuid"},"data":{"$ref":"#/components/schemas/Task"}},"required":["id","event","createdAt","workspaceId","data"]}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds means it arrived. Anything else is retried for about a day."}}}},"lead.created":{"post":{"summary":"A lead is added","description":"Signed: the WorkHub-Signature header is \"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the signing secret>\". WorkHub-Event and WorkHub-Delivery name the event and the delivery.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The delivery; the same as WorkHub-Delivery."},"event":{"type":"string","const":"lead.created"},"createdAt":{"type":"string","format":"date-time"},"workspaceId":{"type":"string","format":"uuid"},"data":{"$ref":"#/components/schemas/Lead"}},"required":["id","event","createdAt","workspaceId","data"]}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds means it arrived. Anything else is retried for about a day."}}}},"deal.won":{"post":{"summary":"A deal is won","description":"Signed: the WorkHub-Signature header is \"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the signing secret>\". WorkHub-Event and WorkHub-Delivery name the event and the delivery.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The delivery; the same as WorkHub-Delivery."},"event":{"type":"string","const":"deal.won"},"createdAt":{"type":"string","format":"date-time"},"workspaceId":{"type":"string","format":"uuid"},"data":{"$ref":"#/components/schemas/Deal"}},"required":["id","event","createdAt","workspaceId","data"]}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds means it arrived. Anything else is retried for about a day."}}}},"deal.lost":{"post":{"summary":"A deal is lost","description":"Signed: the WorkHub-Signature header is \"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the signing secret>\". WorkHub-Event and WorkHub-Delivery name the event and the delivery.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The delivery; the same as WorkHub-Delivery."},"event":{"type":"string","const":"deal.lost"},"createdAt":{"type":"string","format":"date-time"},"workspaceId":{"type":"string","format":"uuid"},"data":{"$ref":"#/components/schemas/Deal"}},"required":["id","event","createdAt","workspaceId","data"]}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds means it arrived. Anything else is retried for about a day."}}}},"invoice.paid":{"post":{"summary":"An invoice to a client is marked paid","description":"Signed: the WorkHub-Signature header is \"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the signing secret>\". WorkHub-Event and WorkHub-Delivery name the event and the delivery.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The delivery; the same as WorkHub-Delivery."},"event":{"type":"string","const":"invoice.paid"},"createdAt":{"type":"string","format":"date-time"},"workspaceId":{"type":"string","format":"uuid"},"data":{"$ref":"#/components/schemas/Invoice"}},"required":["id","event","createdAt","workspaceId","data"]}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds means it arrived. Anything else is retried for about a day."}}}},"ping":{"post":{"summary":"Sent by \"Send a test\" in Settings → API","description":"Signed: the WorkHub-Signature header is \"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\" with the signing secret>\". WorkHub-Event and WorkHub-Delivery name the event and the delivery.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","description":"The delivery; the same as WorkHub-Delivery."},"event":{"type":"string","const":"ping"},"createdAt":{"type":"string","format":"date-time"},"workspaceId":{"type":"string","format":"uuid"},"data":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["id","event","createdAt","workspaceId","data"]}}}},"responses":{"200":{"description":"Any 2xx within 10 seconds means it arrived. Anything else is retried for about a day."}}}}},"paths":{"/v1/me":{"get":{"summary":"The workspace and person a key acts as","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"400":{"description":"A parameter is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or the key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, its creator is no longer an admin, or the workspace plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than the key's limit of requests a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/people":{"get":{"summary":"People in the workspace","parameters":[{"name":"limit","in":"query","required":false,"description":"How many to return.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","required":false,"description":"From the previous page's \"nextCursor\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Person"}},"nextCursor":{"type":["string","null"],"description":"Null on the last page."}},"required":["data","nextCursor"]}}}},"400":{"description":"A parameter is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or the key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, its creator is no longer an admin, or the workspace plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than the key's limit of requests a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/attendance":{"get":{"summary":"Attendance for a month: one row per person per day, as in the payroll export","parameters":[{"name":"month","in":"query","required":true,"description":"The month.","schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$","example":"2027-01"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"month":{"type":"string"},"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"},"data":{"type":"array","items":{"$ref":"#/components/schemas/AttendanceDay"}}},"required":["month","from","to","data"]}}}},"400":{"description":"A parameter is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or the key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, its creator is no longer an admin, or the workspace plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than the key's limit of requests a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/leave-requests":{"get":{"summary":"Leave requests","parameters":[{"name":"status","in":"query","required":false,"description":"Only this status.","schema":{"type":"string","enum":["pending","approved","rejected","cancelled"]}},{"name":"from","in":"query","required":false,"description":"Requests that end on or after this date.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":false,"description":"Requests that start on or before this date.","schema":{"type":"string","format":"date"}},{"name":"limit","in":"query","required":false,"description":"How many to return.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","required":false,"description":"From the previous page's \"nextCursor\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeaveRequest"}},"nextCursor":{"type":["string","null"],"description":"Null on the last page."}},"required":["data","nextCursor"]}}}},"400":{"description":"A parameter is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or the key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, its creator is no longer an admin, or the workspace plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than the key's limit of requests a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/time-entries":{"get":{"summary":"Time logged on projects","parameters":[{"name":"from","in":"query","required":true,"description":"First work date.","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","required":true,"description":"Last work date, at most 366 days after \"from\".","schema":{"type":"string","format":"date"}},{"name":"projectId","in":"query","required":false,"description":"Only this project.","schema":{"type":"string","format":"uuid"}},{"name":"userId","in":"query","required":false,"description":"Only this person's time.","schema":{"type":"string","format":"uuid"}},{"name":"approved","in":"query","required":false,"description":"Only time whose week was (or was not) approved.","schema":{"type":"string","enum":["true","false"]}},{"name":"limit","in":"query","required":false,"description":"How many to return.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","required":false,"description":"From the previous page's \"nextCursor\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TimeEntry"}},"nextCursor":{"type":["string","null"],"description":"Null on the last page."}},"required":["data","nextCursor"]}}}},"400":{"description":"A parameter is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or the key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, its creator is no longer an admin, or the workspace plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than the key's limit of requests a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/projects":{"get":{"summary":"Projects","parameters":[{"name":"status","in":"query","required":false,"description":"Only this status.","schema":{"type":"string","enum":["active","on_hold","completed","archived"]}},{"name":"limit","in":"query","required":false,"description":"How many to return.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","required":false,"description":"From the previous page's \"nextCursor\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Project"}},"nextCursor":{"type":["string","null"],"description":"Null on the last page."}},"required":["data","nextCursor"]}}}},"400":{"description":"A parameter is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or the key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, its creator is no longer an admin, or the workspace plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than the key's limit of requests a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks":{"get":{"summary":"Tasks, including subtasks","parameters":[{"name":"projectId","in":"query","required":false,"description":"Only this project.","schema":{"type":"string","format":"uuid"}},{"name":"completed","in":"query","required":false,"description":"Only completed (or open) tasks.","schema":{"type":"string","enum":["true","false"]}},{"name":"updatedSince","in":"query","required":false,"description":"Only records created or changed at or after this time, to sync changes.","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","required":false,"description":"How many to return.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","required":false,"description":"From the previous page's \"nextCursor\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"nextCursor":{"type":["string","null"],"description":"Null on the last page."}},"required":["data","nextCursor"]}}}},"400":{"description":"A parameter is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or the key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, its creator is no longer an admin, or the workspace plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than the key's limit of requests a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a task or subtask (read and write keys)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewTask"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"description":"A parameter is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or the key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, its creator is no longer an admin, or the workspace plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than the key's limit of requests a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tasks/{id}":{"patch":{"summary":"Change a task, or move it to another column (read and write keys)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskChanges"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"description":"A parameter is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or the key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, its creator is no longer an admin, or the workspace plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than the key's limit of requests a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/companies":{"get":{"summary":"CRM companies (clients)","parameters":[{"name":"updatedSince","in":"query","required":false,"description":"Only records created or changed at or after this time, to sync changes.","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","required":false,"description":"How many to return.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","required":false,"description":"From the previous page's \"nextCursor\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Company"}},"nextCursor":{"type":["string","null"],"description":"Null on the last page."}},"required":["data","nextCursor"]}}}},"400":{"description":"A parameter is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or the key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, its creator is no longer an admin, or the workspace plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than the key's limit of requests a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/contacts":{"get":{"summary":"CRM contacts","parameters":[{"name":"updatedSince","in":"query","required":false,"description":"Only records created or changed at or after this time, to sync changes.","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","required":false,"description":"How many to return.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","required":false,"description":"From the previous page's \"nextCursor\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"nextCursor":{"type":["string","null"],"description":"Null on the last page."}},"required":["data","nextCursor"]}}}},"400":{"description":"A parameter is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or the key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, its creator is no longer an admin, or the workspace plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than the key's limit of requests a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a contact (read and write keys)","requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ContactFields"},{"type":"object","required":["firstName"]}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"400":{"description":"A parameter is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or the key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, its creator is no longer an admin, or the workspace plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than the key's limit of requests a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/contacts/{id}":{"patch":{"summary":"Change a contact (read and write keys)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactFields"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"400":{"description":"A parameter is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or the key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, its creator is no longer an admin, or the workspace plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than the key's limit of requests a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/leads":{"get":{"summary":"CRM leads","parameters":[{"name":"status","in":"query","required":false,"description":"Only this status.","schema":{"type":"string","enum":["new","contacted","qualified","unqualified","converted"]}},{"name":"updatedSince","in":"query","required":false,"description":"Only records created or changed at or after this time, to sync changes.","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","required":false,"description":"How many to return.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","required":false,"description":"From the previous page's \"nextCursor\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Lead"}},"nextCursor":{"type":["string","null"],"description":"Null on the last page."}},"required":["data","nextCursor"]}}}},"400":{"description":"A parameter is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or the key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, its creator is no longer an admin, or the workspace plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than the key's limit of requests a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a lead (read and write keys)","requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/LeadFields"},{"type":"object","required":["name"]}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lead"}}}},"400":{"description":"A parameter is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or the key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, its creator is no longer an admin, or the workspace plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than the key's limit of requests a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/leads/{id}":{"patch":{"summary":"Change a lead (read and write keys)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadFields"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Lead"}}}},"400":{"description":"A parameter is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or the key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, its creator is no longer an admin, or the workspace plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than the key's limit of requests a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/deals":{"get":{"summary":"CRM deals","parameters":[{"name":"status","in":"query","required":false,"description":"Only open, won or lost deals.","schema":{"type":"string","enum":["open","won","lost"]}},{"name":"updatedSince","in":"query","required":false,"description":"Only records created or changed at or after this time, to sync changes.","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","required":false,"description":"How many to return.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","required":false,"description":"From the previous page's \"nextCursor\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Deal"}},"nextCursor":{"type":["string","null"],"description":"Null on the last page."}},"required":["data","nextCursor"]}}}},"400":{"description":"A parameter is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or the key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, its creator is no longer an admin, or the workspace plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than the key's limit of requests a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/activities":{"get":{"summary":"CRM activities: calls, meetings, notes and follow-ups","parameters":[{"name":"dealId","in":"query","required":false,"description":"Only on this deal.","schema":{"type":"string","format":"uuid"}},{"name":"companyId","in":"query","required":false,"description":"Only on this company.","schema":{"type":"string","format":"uuid"}},{"name":"contactId","in":"query","required":false,"description":"Only on this contact.","schema":{"type":"string","format":"uuid"}},{"name":"leadId","in":"query","required":false,"description":"Only on this lead.","schema":{"type":"string","format":"uuid"}},{"name":"updatedSince","in":"query","required":false,"description":"Only records created or changed at or after this time, to sync changes.","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","required":false,"description":"How many to return.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","required":false,"description":"From the previous page's \"nextCursor\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Activity"}},"nextCursor":{"type":["string","null"],"description":"Null on the last page."}},"required":["data","nextCursor"]}}}},"400":{"description":"A parameter is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or the key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, its creator is no longer an admin, or the workspace plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than the key's limit of requests a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Log an activity or add a follow-up (read and write keys)","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewActivity"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Activity"}}}},"400":{"description":"A parameter is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or the key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, its creator is no longer an admin, or the workspace plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found in this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than the key's limit of requests a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invoices":{"get":{"summary":"Invoices to clients","parameters":[{"name":"status","in":"query","required":false,"description":"Only this status.","schema":{"type":"string","enum":["draft","sent","paid","void"]}},{"name":"companyId","in":"query","required":false,"description":"Only this client.","schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"description":"How many to return.","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","required":false,"description":"From the previous page's \"nextCursor\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}},"nextCursor":{"type":["string","null"],"description":"Null on the last page."}},"required":["data","nextCursor"]}}}},"400":{"description":"A parameter is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or the key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, its creator is no longer an admin, or the workspace plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than the key's limit of requests a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invoices/{id}":{"get":{"summary":"One invoice to a client, with its lines","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceWithLines"}}}},"400":{"description":"A parameter is missing or not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No API key, or the key is not valid or was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key is read-only, its creator is no longer an admin, or the workspace plan does not include the API.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such invoice."},"429":{"description":"More than the key's limit of requests a minute.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}