{"openapi":"3.1.0","info":{"title":"SaaSpocalypse API","version":"1.0.0","description":"One API for the four SaaSpocalypse tools: S/Planner (people, projects, bookings, schedule), S/Boards (work items), S/CRM (companies, contacts, deals) and S/Tables (tables and rows).\n\nAuthenticate with an API key made under Settings, API in the web app, sent as `Authorization: Bearer sp_...`. A read key can call every GET; a write key can also create, change and archive.\n\nEach key may make 120 requests a minute, shared with the MCP server; every answer carries X-RateLimit-Limit and X-RateLimit-Remaining, and a 429 carries Retry-After. An address that sends 30 requests without a valid key in a minute is also told to wait.\n\nLists answer `{ data, nextCursor }`; pass `nextCursor` back as `cursor` for the next page, with `limit` up to 200 (50 by default). Single records answer `{ data }`. Errors answer `{ error: { code, message } }`.\n\nDates are YYYY-MM-DD and timestamps are ISO 8601 in UTC. Records are archived, never erased, by DELETE."},"externalDocs":{"description":"Guides and examples","url":"https://saaspocalypse.online/docs"},"servers":[{"url":"https://app.saaspocalypse.online/api/v1"}],"security":[{"apiKey":[]}],"tags":[{"name":"Workspace","description":"What the key can reach."},{"name":"Planner","description":"People and projects (on every plan), and bookings and the schedule (S/Planner)."},{"name":"Boards","description":"Work items on a kanban board (S/Boards)."},{"name":"CRM","description":"Companies, contacts, deals and the pipeline (S/CRM)."},{"name":"Tables","description":"Tables with typed fields, rows and saved views (S/Tables)."}],"paths":{"/workspace":{"get":{"operationId":"getWorkspace","tags":["Workspace"],"summary":"The workspace this key belongs to","description":"Name, plan, the tools the plan includes, what this key may do, and how many records each tool holds.","x-scope":"read","x-mcp-tool":"get_workspace","responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Workspace"}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/people":{"get":{"operationId":"listPeople","tags":["Planner"],"summary":"List people","description":"The people who can be booked and assigned work, in name order. Archived people are left out.","x-scope":"read","x-mcp-tool":"list_people","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"description":"How many to return, up to 200."}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":20,"description":"The nextCursor from the previous page. Leave out for the first page."}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Person"}},"nextCursor":{"type":["string","null"],"description":"Pass as cursor for the next page; null on the last page."}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createPerson","tags":["Planner"],"summary":"Add a person","x-scope":"write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Full name.","maxLength":120,"minLength":1},"email":{"type":["string","null"],"description":"Work email.","maxLength":254},"roleLabel":{"type":["string","null"],"description":"Role or discipline shown on the planner, such as Designer.","maxLength":60},"regionId":{"type":["string","null"],"description":"Region code used for public holidays, such as UK.","maxLength":40},"employment":{"type":"string","enum":["employee","contractor","placeholder"],"description":"Defaults to employee."},"standardDayHours":{"type":["number","null"],"minimum":0.25,"maximum":24,"description":"Hours in this person's working day when they have no contract. Leave out to use the workspace's."},"startDate":{"type":["string","null"],"format":"date","description":"First working day."},"endDate":{"type":["string","null"],"format":"date","description":"Last working day."}},"additionalProperties":false}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Person"}}}}}},"400":{"description":"The body is not a JSON object (invalid_json).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/people/{id}":{"get":{"operationId":"getPerson","tags":["Planner"],"summary":"Get a person","x-scope":"read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The person's id.","maxLength":64}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Person"}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updatePerson","tags":["Planner"],"summary":"Change a person","description":"Send only the fields to change.","x-scope":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The person's id.","maxLength":64}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Full name.","maxLength":120,"minLength":1},"email":{"type":["string","null"],"description":"Work email.","maxLength":254},"roleLabel":{"type":["string","null"],"description":"Role or discipline shown on the planner, such as Designer.","maxLength":60},"regionId":{"type":["string","null"],"description":"Region code used for public holidays, such as UK.","maxLength":40},"employment":{"type":"string","enum":["employee","contractor","placeholder"],"description":"Defaults to employee."},"standardDayHours":{"type":["number","null"],"minimum":0.25,"maximum":24,"description":"Hours in this person's working day when they have no contract. Leave out to use the workspace's."},"startDate":{"type":["string","null"],"format":"date","description":"First working day."},"endDate":{"type":["string","null"],"format":"date","description":"Last working day."}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Person"}}}}}},"400":{"description":"The body is not a JSON object (invalid_json).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"archivePerson","tags":["Planner"],"summary":"Archive a person","description":"The person leaves lists and can no longer be booked. Their past bookings stay.","x-scope":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The person's id.","maxLength":64}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Deleted"}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/projects":{"get":{"operationId":"listProjects","tags":["Planner"],"summary":"List projects","x-scope":"read","x-mcp-tool":"list_projects","parameters":[{"name":"companyId","in":"query","required":false,"schema":{"type":"string","description":"Only this company's projects.","maxLength":64}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["tentative","confirmed","complete","cancelled"],"description":"Only projects with this status."}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"description":"How many to return, up to 200."}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":20,"description":"The nextCursor from the previous page. Leave out for the first page."}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Project"}},"nextCursor":{"type":["string","null"],"description":"Pass as cursor for the next page; null on the last page."}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createProject","tags":["Planner"],"summary":"Add a project","description":"`warnings` lists anything the planner noticed that did not stop the project being saved.","x-scope":"write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Project name.","maxLength":160,"minLength":1},"companyId":{"type":["string","null"],"description":"The company (client) the project is for.","maxLength":64},"code":{"type":["string","null"],"description":"Short job code.","maxLength":40},"status":{"type":"string","enum":["tentative","confirmed","complete","cancelled"],"description":"Defaults to confirmed."},"billable":{"type":"boolean","description":"Defaults to true."},"start":{"type":["string","null"],"format":"date","description":"First day of the contract window."},"end":{"type":["string","null"],"format":"date","description":"Last day of the contract window."},"budgetHours":{"type":["number","null"],"minimum":0,"description":"Planned hours for the whole project."}},"additionalProperties":false}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Project"},"warnings":{"type":"array","items":{"type":"string"},"description":"Present on create and update: things noticed that did not stop the save."}}}}}},"400":{"description":"The body is not a JSON object (invalid_json).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/projects/{id}":{"get":{"operationId":"getProject","tags":["Planner"],"summary":"Get a project","x-scope":"read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The project's id.","maxLength":64}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Project"},"warnings":{"type":"array","items":{"type":"string"},"description":"Present on create and update: things noticed that did not stop the save."}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateProject","tags":["Planner"],"summary":"Change a project","description":"Send only the fields to change.","x-scope":"write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The project's id.","maxLength":64}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Project name.","maxLength":160,"minLength":1},"companyId":{"type":["string","null"],"description":"The company (client) the project is for.","maxLength":64},"code":{"type":["string","null"],"description":"Short job code.","maxLength":40},"status":{"type":"string","enum":["tentative","confirmed","complete","cancelled"],"description":"Defaults to confirmed."},"billable":{"type":"boolean","description":"Defaults to true."},"start":{"type":["string","null"],"format":"date","description":"First day of the contract window."},"end":{"type":["string","null"],"format":"date","description":"Last day of the contract window."},"budgetHours":{"type":["number","null"],"minimum":0,"description":"Planned hours for the whole project."}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Project"},"warnings":{"type":"array","items":{"type":"string"},"description":"Present on create and update: things noticed that did not stop the save."}}}}}},"400":{"description":"The body is not a JSON object (invalid_json).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/bookings":{"get":{"operationId":"listBookings","tags":["Planner"],"summary":"List bookings in a date range","description":"Bookings that touch the range, including weekly repeats that started earlier, in start order.","x-scope":"read","x-tool":"planner","parameters":[{"name":"start","in":"query","required":true,"schema":{"type":"string","format":"date","description":"First day of the range."}},{"name":"end","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Last day of the range."}},{"name":"personId","in":"query","required":false,"schema":{"type":"string","description":"Only bookings for this person.","maxLength":64}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string","description":"Only bookings on this project.","maxLength":64}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"description":"How many to return, up to 200."}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":20,"description":"The nextCursor from the previous page. Leave out for the first page."}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Booking"}},"nextCursor":{"type":["string","null"],"description":"Pass as cursor for the next page; null on the last page."}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createBooking","tags":["Planner"],"summary":"Book people onto a project","description":"Goes through the planner's own checks. A booking that would land on no working day for someone (not contracted, a holiday, a closure, on leave) is refused with the reason. `warnings` lists anything noticed that did not stop it, such as dates outside the project's window.","x-scope":"write","x-tool":"planner","x-mcp-tool":"create_booking","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["projectId","personIds","start","hoursPerDay"],"properties":{"projectId":{"type":"string","description":"The project the time is booked to.","maxLength":64},"personIds":{"type":"array","maxItems":50,"description":"Who is booked. At least one person.","items":{"type":"string","description":"A person's id.","maxLength":64}},"start":{"type":"string","format":"date","description":"First day of the booking."},"end":{"type":["string","null"],"format":"date","description":"Last day. Leave out for a single day."},"hoursPerDay":{"type":"number","minimum":0.01,"maximum":24,"description":"Hours on each working day in the range."},"status":{"type":"string","enum":["tentative","confirmed"],"description":"Defaults to confirmed."},"phaseId":{"type":["string","null"],"description":"A phase of the project.","maxLength":64},"repeatWeekly":{"type":"boolean","description":"Repeat the same days every week."},"repeatUntil":{"type":["string","null"],"format":"date","description":"Last day the weekly repeat may start. Leave out to repeat with no end."},"label":{"type":["string","null"],"description":"Short label shown on the booking.","maxLength":120},"notes":{"type":["string","null"],"description":"Notes.","maxLength":2000}},"additionalProperties":false}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Booking"},"warnings":{"type":"array","items":{"type":"string"},"description":"Present on create and update: things noticed that did not stop the save."}}}}}},"400":{"description":"The body is not a JSON object (invalid_json).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/bookings/{id}":{"get":{"operationId":"getBooking","tags":["Planner"],"summary":"Get a booking","x-scope":"read","x-tool":"planner","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The booking's id.","maxLength":64}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Booking"},"warnings":{"type":"array","items":{"type":"string"},"description":"Present on create and update: things noticed that did not stop the save."}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateBooking","tags":["Planner"],"summary":"Change a booking","description":"Send only the fields to change. The result is checked like a new booking.","x-scope":"write","x-tool":"planner","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The booking's id.","maxLength":64}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"type":"string","description":"The project the time is booked to.","maxLength":64},"personIds":{"type":"array","maxItems":50,"description":"Who is booked. At least one person.","items":{"type":"string","description":"A person's id.","maxLength":64}},"start":{"type":"string","format":"date","description":"First day of the booking."},"end":{"type":["string","null"],"format":"date","description":"Last day. Leave out for a single day."},"hoursPerDay":{"type":"number","minimum":0.01,"maximum":24,"description":"Hours on each working day in the range."},"status":{"type":"string","enum":["tentative","confirmed"],"description":"Defaults to confirmed."},"phaseId":{"type":["string","null"],"description":"A phase of the project.","maxLength":64},"repeatWeekly":{"type":"boolean","description":"Repeat the same days every week."},"repeatUntil":{"type":["string","null"],"format":"date","description":"Last day the weekly repeat may start. Leave out to repeat with no end."},"label":{"type":["string","null"],"description":"Short label shown on the booking.","maxLength":120},"notes":{"type":["string","null"],"description":"Notes.","maxLength":2000}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Booking"},"warnings":{"type":"array","items":{"type":"string"},"description":"Present on create and update: things noticed that did not stop the save."}}}}}},"400":{"description":"The body is not a JSON object (invalid_json).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteBooking","tags":["Planner"],"summary":"Remove a booking","x-scope":"write","x-tool":"planner","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The booking's id.","maxLength":64}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Deleted"}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/schedule":{"get":{"operationId":"getSchedule","tags":["Planner"],"summary":"Booked and available hours per person","description":"For each person, the hours they are available in the range (contracted time less holidays and leave) and the hours booked, worked out by the planner's engine. With `days=true` each person also carries the two figures for every day.","x-scope":"read","x-tool":"planner","x-mcp-tool":"get_schedule","parameters":[{"name":"start","in":"query","required":true,"schema":{"type":"string","format":"date","description":"First day of the range."}},{"name":"end","in":"query","required":true,"schema":{"type":"string","format":"date","description":"Last day of the range, at most 366 days after start."}},{"name":"personId","in":"query","required":false,"schema":{"type":"string","description":"Only this person.","maxLength":64}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string","description":"Count only bookings on this project.","maxLength":64}},{"name":"days","in":"query","required":false,"schema":{"type":"boolean","description":"Include a per-day breakdown for each person.","default":false}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Schedule"}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/stages":{"get":{"operationId":"listStages","tags":["Boards"],"summary":"List board stages","description":"The workspace's stages in board order. Items in a stage marked `done` count as complete.","x-scope":"read","x-tool":"boards","x-mcp-tool":"list_stages","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"description":"How many to return, up to 200."}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":20,"description":"The nextCursor from the previous page. Leave out for the first page."}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Stage"}},"nextCursor":{"type":["string","null"],"description":"Pass as cursor for the next page; null on the last page."}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/work-items":{"get":{"operationId":"listWorkItems","tags":["Boards"],"summary":"List work items","description":"Open work across every project, in board order (by stage, then position). Each item carries its stage, project, assignees and comment count.","x-scope":"read","x-tool":"boards","x-mcp-tool":"list_work_items","parameters":[{"name":"projectId","in":"query","required":false,"schema":{"type":"string","description":"Only items on this project.","maxLength":64}},{"name":"stageId","in":"query","required":false,"schema":{"type":"string","description":"Only items in this stage.","maxLength":64}},{"name":"assigneeId","in":"query","required":false,"schema":{"type":"string","description":"Only items assigned to this person.","maxLength":64}},{"name":"dueBefore","in":"query","required":false,"schema":{"type":"string","format":"date","description":"Only items due on or before this day."}},{"name":"dueAfter","in":"query","required":false,"schema":{"type":"string","format":"date","description":"Only items due on or after this day."}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"description":"How many to return, up to 200."}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":20,"description":"The nextCursor from the previous page. Leave out for the first page."}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkItem"}},"nextCursor":{"type":["string","null"],"description":"Pass as cursor for the next page; null on the last page."}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createWorkItem","tags":["Boards"],"summary":"Add a work item","description":"The item goes to the end of its stage; without a `stageId` that is the first stage.","x-scope":"write","x-tool":"boards","x-mcp-tool":"create_work_item","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["projectId","title"],"properties":{"projectId":{"type":"string","description":"The project the item belongs to.","maxLength":64},"title":{"type":"string","description":"What needs doing.","maxLength":200,"minLength":1},"description":{"type":["string","null"],"description":"Detail, in plain text.","maxLength":20000},"stageId":{"type":"string","description":"The stage to put it in. See the stages list.","maxLength":64},"assigneeIds":{"type":"array","maxItems":20,"description":"People assigned.","items":{"type":"string","description":"A person's id.","maxLength":64}},"labels":{"type":"array","maxItems":12,"description":"Free-text labels.","items":{"type":"string","description":"A label.","maxLength":40}},"priority":{"type":"string","enum":["low","normal","high","urgent"],"description":"Defaults to normal."},"dueDate":{"type":["string","null"],"format":"date","description":"When it is due."},"estimateHours":{"type":["number","null"],"minimum":0,"description":"Estimated effort in hours."},"parentId":{"type":["string","null"],"description":"Another work item on the same project that this is a sub-item of.","maxLength":64},"clientVisible":{"type":"boolean","description":"Whether client-role members can see it."}},"additionalProperties":false}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/WorkItem"}}}}}},"400":{"description":"The body is not a JSON object (invalid_json).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/work-items/{id}":{"get":{"operationId":"getWorkItem","tags":["Boards"],"summary":"Get a work item","x-scope":"read","x-tool":"boards","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The work item's id.","maxLength":64}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/WorkItem"}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateWorkItem","tags":["Boards"],"summary":"Change a work item","description":"Send only the fields to change. Setting `stageId` here changes the stage and keeps the item's position number; use the move operation to place it.","x-scope":"write","x-tool":"boards","x-mcp-tool":"update_work_item","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The work item's id.","maxLength":64}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"What needs doing.","maxLength":200,"minLength":1},"description":{"type":["string","null"],"description":"Detail, in plain text.","maxLength":20000},"stageId":{"type":"string","description":"The stage to put it in. See the stages list.","maxLength":64},"assigneeIds":{"type":"array","maxItems":20,"description":"People assigned.","items":{"type":"string","description":"A person's id.","maxLength":64}},"labels":{"type":"array","maxItems":12,"description":"Free-text labels.","items":{"type":"string","description":"A label.","maxLength":40}},"priority":{"type":"string","enum":["low","normal","high","urgent"],"description":"Defaults to normal."},"dueDate":{"type":["string","null"],"format":"date","description":"When it is due."},"estimateHours":{"type":["number","null"],"minimum":0,"description":"Estimated effort in hours."},"parentId":{"type":["string","null"],"description":"Another work item on the same project that this is a sub-item of.","maxLength":64},"clientVisible":{"type":"boolean","description":"Whether client-role members can see it."}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/WorkItem"}}}}}},"400":{"description":"The body is not a JSON object (invalid_json).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"archiveWorkItem","tags":["Boards"],"summary":"Archive a work item","x-scope":"write","x-tool":"boards","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The work item's id.","maxLength":64}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Deleted"}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/work-items/{id}/move":{"post":{"operationId":"moveWorkItem","tags":["Boards"],"summary":"Move a work item to a stage","description":"Places the item at the end of the stage, or just before `beforeId` when given.","x-scope":"write","x-tool":"boards","x-mcp-tool":"move_work_item","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The work item's id.","maxLength":64}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["stageId"],"properties":{"stageId":{"type":"string","description":"The stage to move to.","maxLength":64},"beforeId":{"type":["string","null"],"description":"An item already in that stage to place this one before.","maxLength":64}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/WorkItem"}}}}}},"400":{"description":"The body is not a JSON object (invalid_json).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/work-items/{id}/comments":{"get":{"operationId":"listWorkItemComments","tags":["Boards"],"summary":"List a work item's comments","description":"Oldest first.","x-scope":"read","x-tool":"boards","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The work item's id.","maxLength":64}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"description":"How many to return, up to 200."}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":20,"description":"The nextCursor from the previous page. Leave out for the first page."}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}},"nextCursor":{"type":["string","null"],"description":"Pass as cursor for the next page; null on the last page."}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"addWorkItemComment","tags":["Boards"],"summary":"Comment on a work item","description":"The comment's author is shown as the key's name followed by \"(API key)\".","x-scope":"write","x-tool":"boards","x-mcp-tool":"add_comment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The work item's id.","maxLength":64}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["body"],"properties":{"body":{"type":"string","description":"The comment, in plain text.","maxLength":10000,"minLength":1}},"additionalProperties":false}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Comment"}}}}}},"400":{"description":"The body is not a JSON object (invalid_json).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/companies":{"get":{"operationId":"listCompanies","tags":["CRM"],"summary":"List companies","description":"Prospects, clients and former clients in name order. A company is the same record the planner calls a client. Internal companies (for non-billable work) are left out.","x-scope":"read","x-tool":"crm","x-mcp-tool":"list_companies","parameters":[{"name":"lifecycle","in":"query","required":false,"schema":{"type":"string","enum":["prospect","client","former"],"description":"Only companies at this point in the relationship."}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"description":"How many to return, up to 200."}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":20,"description":"The nextCursor from the previous page. Leave out for the first page."}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Company"}},"nextCursor":{"type":["string","null"],"description":"Pass as cursor for the next page; null on the last page."}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createCompany","tags":["CRM"],"summary":"Add a company","x-scope":"write","x-tool":"crm","x-mcp-tool":"create_company","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Company name.","maxLength":120,"minLength":1},"lifecycle":{"type":"string","enum":["prospect","client","former"],"description":"Where the relationship stands. A new company starts as a prospect."},"website":{"type":["string","null"],"description":"Website. A bare domain is stored with https://.","maxLength":200},"industry":{"type":["string","null"],"description":"Industry.","maxLength":80},"ownerUserId":{"type":["string","null"],"description":"The member who owns the relationship.","maxLength":64},"deliveryOwnerUserId":{"type":["string","null"],"description":"The member who runs the work.","maxLength":64},"renewalDate":{"type":["string","null"],"format":"date","description":"When the current agreement is up for renewal."},"notes":{"type":["string","null"],"description":"Notes.","maxLength":10000}},"additionalProperties":false}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Company"}}}}}},"400":{"description":"The body is not a JSON object (invalid_json).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/companies/{id}":{"get":{"operationId":"getCompany","tags":["CRM"],"summary":"Get a company","x-scope":"read","x-tool":"crm","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The company's id.","maxLength":64}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Company"}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateCompany","tags":["CRM"],"summary":"Change a company","description":"Send only the fields to change.","x-scope":"write","x-tool":"crm","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The company's id.","maxLength":64}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Company name.","maxLength":120,"minLength":1},"lifecycle":{"type":"string","enum":["prospect","client","former"],"description":"Where the relationship stands. A new company starts as a prospect."},"website":{"type":["string","null"],"description":"Website. A bare domain is stored with https://.","maxLength":200},"industry":{"type":["string","null"],"description":"Industry.","maxLength":80},"ownerUserId":{"type":["string","null"],"description":"The member who owns the relationship.","maxLength":64},"deliveryOwnerUserId":{"type":["string","null"],"description":"The member who runs the work.","maxLength":64},"renewalDate":{"type":["string","null"],"format":"date","description":"When the current agreement is up for renewal."},"notes":{"type":["string","null"],"description":"Notes.","maxLength":10000}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Company"}}}}}},"400":{"description":"The body is not a JSON object (invalid_json).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/contacts":{"get":{"operationId":"listContacts","tags":["CRM"],"summary":"List contacts","x-scope":"read","x-tool":"crm","x-mcp-tool":"list_contacts","parameters":[{"name":"companyId","in":"query","required":false,"schema":{"type":"string","description":"Only this company's contacts.","maxLength":64}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"description":"How many to return, up to 200."}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":20,"description":"The nextCursor from the previous page. Leave out for the first page."}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"nextCursor":{"type":["string","null"],"description":"Pass as cursor for the next page; null on the last page."}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createContact","tags":["CRM"],"summary":"Add a contact","description":"A contact may stand alone, with no company yet.","x-scope":"write","x-tool":"crm","x-mcp-tool":"create_contact","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Full name.","maxLength":120,"minLength":1},"companyId":{"type":["string","null"],"description":"The company they work for.","maxLength":64},"email":{"type":["string","null"],"description":"Email address.","maxLength":254},"phone":{"type":["string","null"],"description":"Phone number.","maxLength":40},"title":{"type":["string","null"],"description":"Job title.","maxLength":80},"notes":{"type":["string","null"],"description":"Notes.","maxLength":10000}},"additionalProperties":false}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Contact"}}}}}},"400":{"description":"The body is not a JSON object (invalid_json).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/contacts/{id}":{"get":{"operationId":"getContact","tags":["CRM"],"summary":"Get a contact","x-scope":"read","x-tool":"crm","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The contact's id.","maxLength":64}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Contact"}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateContact","tags":["CRM"],"summary":"Change a contact","description":"Send only the fields to change.","x-scope":"write","x-tool":"crm","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The contact's id.","maxLength":64}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Full name.","maxLength":120,"minLength":1},"companyId":{"type":["string","null"],"description":"The company they work for.","maxLength":64},"email":{"type":["string","null"],"description":"Email address.","maxLength":254},"phone":{"type":["string","null"],"description":"Phone number.","maxLength":40},"title":{"type":["string","null"],"description":"Job title.","maxLength":80},"notes":{"type":["string","null"],"description":"Notes.","maxLength":10000}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Contact"}}}}}},"400":{"description":"The body is not a JSON object (invalid_json).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deal-stages":{"get":{"operationId":"listDealStages","tags":["CRM"],"summary":"List pipeline stages","description":"The pipeline's stages in order. `kind` is open, won or lost; behaviour follows the kind, never the name.","x-scope":"read","x-tool":"crm","x-mcp-tool":"list_deal_stages","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"description":"How many to return, up to 200."}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":20,"description":"The nextCursor from the previous page. Leave out for the first page."}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DealStage"}},"nextCursor":{"type":["string","null"],"description":"Pass as cursor for the next page; null on the last page."}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deals":{"get":{"operationId":"listDeals","tags":["CRM"],"summary":"List deals","description":"Deals in pipeline order (by stage, then position), won and lost included. Each deal carries its stage, company and contact.","x-scope":"read","x-tool":"crm","x-mcp-tool":"list_deals","parameters":[{"name":"companyId","in":"query","required":false,"schema":{"type":"string","description":"Only this company's deals.","maxLength":64}},{"name":"stageId","in":"query","required":false,"schema":{"type":"string","description":"Only deals in this stage.","maxLength":64}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","won","lost"],"description":"Only deals whose stage is of this kind."}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"description":"How many to return, up to 200."}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":20,"description":"The nextCursor from the previous page. Leave out for the first page."}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Deal"}},"nextCursor":{"type":["string","null"],"description":"Pass as cursor for the next page; null on the last page."}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createDeal","tags":["CRM"],"summary":"Add a deal","description":"Without a `stageId` the deal starts in the first open stage. Creating a deal straight into a won stage settles it as a move would.","x-scope":"write","x-tool":"crm","x-mcp-tool":"create_deal","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name","companyId"],"properties":{"name":{"type":"string","description":"Deal name.","maxLength":160,"minLength":1},"companyId":{"type":"string","description":"The company the deal is with.","maxLength":64},"contactId":{"type":["string","null"],"description":"The main contact.","maxLength":64},"value":{"type":["integer","null"],"minimum":0,"description":"Whole-currency amount, such as 12500 for £12,500."},"currency":{"type":"string","description":"Three-letter ISO currency code. Defaults to GBP.","maxLength":3,"minLength":3},"ownerUserId":{"type":["string","null"],"description":"The member who owns the deal.","maxLength":64},"expectedClose":{"type":["string","null"],"format":"date","description":"When it is expected to close."},"source":{"type":["string","null"],"description":"Where the deal came from.","maxLength":80},"notes":{"type":["string","null"],"description":"Notes.","maxLength":10000},"stageId":{"type":"string","description":"The stage to start in. See the deal stages list.","maxLength":64}},"additionalProperties":false}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Deal"}}}}}},"400":{"description":"The body is not a JSON object (invalid_json).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deals/{id}":{"get":{"operationId":"getDeal","tags":["CRM"],"summary":"Get a deal","x-scope":"read","x-tool":"crm","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The deal's id.","maxLength":64}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Deal"}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateDeal","tags":["CRM"],"summary":"Change a deal","description":"Send only the fields to change. The stage is changed with the move operation.","x-scope":"write","x-tool":"crm","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The deal's id.","maxLength":64}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Deal name.","maxLength":160,"minLength":1},"companyId":{"type":"string","description":"The company the deal is with.","maxLength":64},"contactId":{"type":["string","null"],"description":"The main contact.","maxLength":64},"value":{"type":["integer","null"],"minimum":0,"description":"Whole-currency amount, such as 12500 for £12,500."},"currency":{"type":"string","description":"Three-letter ISO currency code. Defaults to GBP.","maxLength":3,"minLength":3},"ownerUserId":{"type":["string","null"],"description":"The member who owns the deal.","maxLength":64},"expectedClose":{"type":["string","null"],"format":"date","description":"When it is expected to close."},"source":{"type":["string","null"],"description":"Where the deal came from.","maxLength":80},"notes":{"type":["string","null"],"description":"Notes.","maxLength":10000}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Deal"}}}}}},"400":{"description":"The body is not a JSON object (invalid_json).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"archiveDeal","tags":["CRM"],"summary":"Archive a deal","x-scope":"write","x-tool":"crm","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The deal's id.","maxLength":64}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Deleted"}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/deals/{id}/move":{"post":{"operationId":"moveDeal","tags":["CRM"],"summary":"Move a deal to a stage","description":"Entering a won stage closes the deal, creates a confirmed project for the company (once; the deal's `projectId` remembers it) and turns a prospect into a client. Entering a lost stage closes it. Moving back to an open stage reopens it.","x-scope":"write","x-tool":"crm","x-mcp-tool":"move_deal","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","description":"The deal's id.","maxLength":64}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["stageId"],"properties":{"stageId":{"type":"string","description":"The stage to move to.","maxLength":64},"beforeId":{"type":["string","null"],"description":"A deal already in that stage to place this one before.","maxLength":64}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Deal"}}}}}},"400":{"description":"The body is not a JSON object (invalid_json).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/pipeline":{"get":{"operationId":"getPipeline","tags":["CRM"],"summary":"Pipeline totals","description":"Totals per currency (open count, value and probability-weighted value; won and lost counts and values) and a count and value per stage. Currencies are never added together.","x-scope":"read","x-tool":"crm","x-mcp-tool":"get_pipeline","responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Pipeline"}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tables":{"get":{"operationId":"listTables","tags":["Tables"],"summary":"List tables","x-scope":"read","x-tool":"tables","x-mcp-tool":"list_tables","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"description":"How many to return, up to 200."}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":20,"description":"The nextCursor from the previous page. Leave out for the first page."}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TableSummary"}},"nextCursor":{"type":["string","null"],"description":"Pass as cursor for the next page; null on the last page."}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tables/{tableId}":{"get":{"operationId":"getTable","tags":["Tables"],"summary":"Get a table with its fields and views","description":"Fields carry their type and, for selects, their choices. Views are saved filters and sorts that the rows list can apply.","x-scope":"read","x-tool":"tables","x-mcp-tool":"get_table","parameters":[{"name":"tableId","in":"path","required":true,"schema":{"type":"string","description":"The table's id.","maxLength":64}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Table"}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tables/{tableId}/rows":{"get":{"operationId":"listRows","tags":["Tables"],"summary":"List a table's rows","description":"Every row in the table's own order, or with `viewId` the rows that view shows, filtered and sorted as it is. `values` holds stored values by field id (a select holds a choice id); `display` holds what a person reads, by field name. Lookups, rollups and formulas are filled in.","x-scope":"read","x-tool":"tables","x-mcp-tool":"list_rows","parameters":[{"name":"tableId","in":"path","required":true,"schema":{"type":"string","description":"The table's id.","maxLength":64}},{"name":"viewId","in":"query","required":false,"schema":{"type":"string","description":"Apply this view's filters and sorts.","maxLength":64}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"description":"How many to return, up to 200."}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","maxLength":20,"description":"The nextCursor from the previous page. Leave out for the first page."}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Row"}},"nextCursor":{"type":["string","null"],"description":"Pass as cursor for the next page; null on the last page."}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createRow","tags":["Tables"],"summary":"Add a row","description":"Every value is checked against its field before anything is stored; a value that does not fit is refused with the field's reason and no row is made.","x-scope":"write","x-tool":"tables","x-mcp-tool":"create_row","parameters":[{"name":"tableId","in":"path","required":true,"schema":{"type":"string","description":"The table's id.","maxLength":64}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["values"],"properties":{"values":{"type":"object","description":"Cell values keyed by field name or field id. A select takes a choice's name; a multi-select a list of names; a tick true or false; a date YYYY-MM-DD; a member field a member's id or name; a link field a list of record ids or names. null empties a cell. Lookups, rollups and formulas are worked out and cannot be set.","additionalProperties":true}},"additionalProperties":false}}}},"responses":{"201":{"description":"Created.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Row"}}}}}},"400":{"description":"The body is not a JSON object (invalid_json).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tables/{tableId}/rows/{rowId}":{"get":{"operationId":"getRow","tags":["Tables"],"summary":"Get a row","x-scope":"read","x-tool":"tables","parameters":[{"name":"tableId","in":"path","required":true,"schema":{"type":"string","description":"The table's id.","maxLength":64}},{"name":"rowId","in":"path","required":true,"schema":{"type":"string","description":"The row's id.","maxLength":64}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Row"}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"A parameter is wrong (validation_failed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateRow","tags":["Tables"],"summary":"Change a row's cells","description":"Send only the cells to change. Every value is checked against its field first; if one does not fit, nothing changes.","x-scope":"write","x-tool":"tables","x-mcp-tool":"update_row","parameters":[{"name":"tableId","in":"path","required":true,"schema":{"type":"string","description":"The table's id.","maxLength":64}},{"name":"rowId","in":"path","required":true,"schema":{"type":"string","description":"The row's id.","maxLength":64}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["values"],"properties":{"values":{"type":"object","description":"Cell values keyed by field name or field id. A select takes a choice's name; a multi-select a list of names; a tick true or false; a date YYYY-MM-DD; a member field a member's id or name; a link field a list of record ids or names. null empties a cell. Lookups, rollups and formulas are worked out and cannot be set.","additionalProperties":true}},"additionalProperties":false}}}},"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Row"}}}}}},"400":{"description":"The body is not a JSON object (invalid_json).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteRow","tags":["Tables"],"summary":"Remove a row","x-scope":"write","x-tool":"tables","parameters":[{"name":"tableId","in":"path","required":true,"schema":{"type":"string","description":"The table's id.","maxLength":64}},{"name":"rowId","in":"path","required":true,"schema":{"type":"string","description":"The row's id.","maxLength":64}}],"responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","required":["data"],"properties":{"data":{"$ref":"#/components/schemas/Deleted"}}}}}},"401":{"description":"The key is missing, wrong or revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key cannot do this (insufficient_scope).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such record.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The input is wrong (validation_failed, with a message per field) or a rule refused it (refused).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests. Retry-After says how many seconds to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key: sp_<workspace>_<secret>."}},"schemas":{"Error":{"type":"object","description":"Every error has this shape.","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"A stable code: unauthorized, insufficient_scope, not_found, method_not_allowed, invalid_json, payload_too_large, validation_failed, refused, rate_limited or internal_error."},"message":{"type":"string","description":"What went wrong, in plain words."},"fields":{"type":"object","additionalProperties":{"type":"string"},"description":"With validation_failed: a message for each field that was wrong."}}}}},"Deleted":{"type":"object","properties":{"id":{"type":"string"},"archived":{"type":"boolean","description":"Always true. Records are archived, not erased."}}},"Workspace":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string","description":"The workspace's address in the web app: /w/{slug}."},"kind":{"type":"string","enum":["live","demo"]},"plan":{"type":"string","enum":["free","team","unlimited","example"],"description":"Plans differ by how many people can sign in, never by tool. example is the try-it workspace."},"tools":{"type":"array","items":{"type":"string","enum":["planner","boards","crm","tables"]},"description":"The tools in the workspace. Every plan includes all of them."},"key":{"type":"object","description":"The key making this request.","properties":{"name":{"type":"string"},"scope":{"type":"string","enum":["read","write"]}}},"counts":{"type":"object","additionalProperties":{"type":"integer"},"description":"Record counts: people and projects always; workItems, companies, contacts, deals and tables when their tool is on."}}},"Person":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":["string","null"]},"userId":{"type":["string","null"],"description":"The member account this person signs in with, if any."},"regionId":{"type":["string","null"]},"teamIds":{"type":"array","items":{"type":"string"}},"roleLabel":{"type":["string","null"]},"contracts":{"type":"array","items":{"type":"object","properties":{"effectiveFrom":{"type":"string","description":"YYYY-MM-DD"},"hours":{"type":"array","items":{"type":"number"},"description":"Hours for each weekday, Sunday first."}}},"description":"Contracted working weeks, each from a date."},"standardDayHours":{"type":["number","null"]},"employment":{"type":"string","enum":["employee","contractor","placeholder"]},"startDate":{"type":["string","null"],"description":"YYYY-MM-DD"},"endDate":{"type":["string","null"],"description":"YYYY-MM-DD"},"createdAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"updatedAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"archivedAt":{"type":["string","null"],"description":"Set once the record is archived."}}},"Project":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":["string","null"]},"name":{"type":"string"},"code":{"type":["string","null"]},"status":{"type":"string","enum":["tentative","confirmed","complete","cancelled"]},"billable":{"type":"boolean"},"colour":{"type":["string","null"],"description":"Hex colour used on the schedule."},"start":{"type":["string","null"],"description":"YYYY-MM-DD"},"end":{"type":["string","null"],"description":"YYYY-MM-DD"},"budgetHours":{"type":["number","null"]},"externalIds":{"type":"object","additionalProperties":{"type":"string"},"description":"Identifiers from other systems, keyed by system name."},"createdAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"updatedAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"archivedAt":{"type":["string","null"],"description":"Set once the record is archived."}}},"Booking":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"phaseId":{"type":["string","null"]},"personIds":{"type":"array","items":{"type":"string"}},"start":{"type":"string","description":"YYYY-MM-DD"},"end":{"type":["string","null"],"description":"YYYY-MM-DD; null for a single day."},"hoursPerDay":{"type":"number"},"repeat":{"type":["object","null"],"properties":{"cadence":{"type":"string","enum":["weekly"]},"until":{"type":["string","null"],"description":"YYYY-MM-DD"}}},"status":{"type":"string","enum":["tentative","confirmed"]},"label":{"type":["string","null"]},"notes":{"type":["string","null"]},"excludeFromPlan":{"type":"boolean"},"planCell":{"type":["string","null"],"description":"Set when the monthly plan wrote this booking."},"externalIds":{"type":"object","additionalProperties":{"type":"string"},"description":"Identifiers from other systems, keyed by system name."},"createdAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"updatedAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"archivedAt":{"type":["string","null"],"description":"Set once the record is archived."}}},"Schedule":{"type":"object","properties":{"range":{"type":"object","properties":{"start":{"type":"string","description":"YYYY-MM-DD"},"end":{"type":"string","description":"YYYY-MM-DD"}}},"closedDates":{"type":"array","items":{"type":"string"},"description":"Company closures in the range."},"people":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"roleLabel":{"type":["string","null"]},"team":{"type":["string","null"],"description":"Name of the person's first team."},"available":{"type":"number","description":"Hours contracted in the range, less holidays and leave."},"booked":{"type":"number","description":"Hours booked in the range, after the planner's allocation rule."},"free":{"type":"number","description":"available less booked, never below zero."},"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","description":"YYYY-MM-DD"},"available":{"type":"number"},"booked":{"type":"number"}}},"description":"Present with days=true."}}}}}},"Stage":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":["string","null"],"description":"null for the workspace's shared stages."},"name":{"type":"string"},"sortOrder":{"type":"number"},"done":{"type":"boolean","description":"Items here count as complete."},"createdAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"updatedAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"archivedAt":{"type":["string","null"],"description":"Set once the record is archived."}}},"WorkItem":{"type":"object","properties":{"id":{"type":"string"},"projectId":{"type":"string"},"phaseId":{"type":["string","null"]},"parentId":{"type":["string","null"]},"stageId":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"assigneeIds":{"type":"array","items":{"type":"string"},"description":"People assigned."},"labels":{"type":"array","items":{"type":"string"}},"priority":{"type":"string","enum":["low","normal","high","urgent"]},"dueDate":{"type":["string","null"],"description":"YYYY-MM-DD"},"estimateHours":{"type":["number","null"]},"sortOrder":{"type":"number","description":"Position within the stage; lower is higher up."},"clientVisible":{"type":"boolean"},"checklist":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"done":{"type":"boolean"}}}},"stage":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"done":{"type":"boolean"}}},"project":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}},"assignees":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}}},"commentCount":{"type":"integer"},"createdAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"updatedAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"archivedAt":{"type":["string","null"],"description":"Set once the record is archived."}}},"Comment":{"type":"object","properties":{"id":{"type":"string"},"workItemId":{"type":"string","description":"The record the comment is on."},"authorUserId":{"type":["string","null"],"description":"A member's id, or the API key's id."},"authorName":{"type":"string"},"body":{"type":"string"},"createdAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"updatedAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"archivedAt":{"type":["string","null"],"description":"Set once the record is archived."}}},"Company":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"internal":{"type":"boolean"},"lifecycle":{"type":"string","enum":["prospect","client","former"]},"website":{"type":["string","null"]},"industry":{"type":["string","null"]},"ownerUserId":{"type":["string","null"]},"deliveryOwnerUserId":{"type":["string","null"]},"renewalDate":{"type":["string","null"],"description":"YYYY-MM-DD"},"notes":{"type":["string","null"]},"externalIds":{"type":"object","additionalProperties":{"type":"string"},"description":"Identifiers from other systems, keyed by system name."},"createdAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"updatedAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"archivedAt":{"type":["string","null"],"description":"Set once the record is archived."}}},"Contact":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":["string","null"]},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"title":{"type":["string","null"]},"notes":{"type":["string","null"]},"externalIds":{"type":"object","additionalProperties":{"type":"string"},"description":"Identifiers from other systems, keyed by system name."},"createdAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"updatedAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"archivedAt":{"type":["string","null"],"description":"Set once the record is archived."}}},"DealStage":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"sortOrder":{"type":"number"},"kind":{"type":"string","enum":["open","won","lost"]},"probability":{"type":"number","description":"Chance of winning, 0 to 100."},"createdAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"updatedAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"archivedAt":{"type":["string","null"],"description":"Set once the record is archived."}}},"Deal":{"type":"object","properties":{"id":{"type":"string"},"companyId":{"type":"string"},"contactId":{"type":["string","null"]},"stageId":{"type":"string"},"name":{"type":"string"},"value":{"type":"number","description":"Whole-currency amount."},"currency":{"type":"string","description":"ISO currency code."},"ownerUserId":{"type":["string","null"]},"expectedClose":{"type":["string","null"],"description":"YYYY-MM-DD"},"closedAt":{"type":["string","null"],"description":"Set while the deal sits in a won or lost stage."},"projectId":{"type":["string","null"],"description":"The project made when the deal was won."},"source":{"type":["string","null"]},"notes":{"type":["string","null"]},"sortOrder":{"type":"number"},"externalIds":{"type":"object","additionalProperties":{"type":"string"},"description":"Identifiers from other systems, keyed by system name."},"stage":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["open","won","lost"]},"probability":{"type":"number"}}},"company":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}}},"contact":{"type":["object","null"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}},"createdAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"updatedAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"archivedAt":{"type":["string","null"],"description":"Set once the record is archived."}}},"Pipeline":{"type":"object","properties":{"totals":{"type":"array","description":"One entry per currency.","items":{"type":"object","properties":{"currency":{"type":"string"},"open":{"type":"object","properties":{"count":{"type":"integer"},"value":{"type":"number"},"weighted":{"type":"number","description":"Value times each stage's probability."}}},"won":{"type":"object","properties":{"count":{"type":"integer"},"value":{"type":"number"}}},"lost":{"type":"object","properties":{"count":{"type":"integer"},"value":{"type":"number"}}}}}},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string"},"probability":{"type":"number"},"count":{"type":"integer"},"value":{"type":"object","additionalProperties":{"type":"number"},"description":"Value of the stage's deals, per currency."}}}}}},"TableSummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"sortOrder":{"type":"number"},"rowCount":{"type":"integer"},"fieldCount":{"type":"integer"},"createdAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"updatedAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"archivedAt":{"type":["string","null"],"description":"Set once the record is archived."}}},"Table":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"sortOrder":{"type":"number"},"rowCount":{"type":"integer"},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["text","longText","number","currency","percent","date","checkbox","select","multiSelect","url","email","member","link","lookup","rollup","formula"]},"primary":{"type":"boolean","description":"The first column, which names the row."},"sortOrder":{"type":"number"},"options":{"type":"object","description":"Per-type settings: choices (id, name, tone) for selects, precision and currency for numbers, link, source, aggregate and expression for links and computed fields."},"createdAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"updatedAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"archivedAt":{"type":["string","null"],"description":"Set once the record is archived."}}}},"views":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["grid","board"]},"sortOrder":{"type":"number"},"config":{"type":"object","description":"filters, match, sorts, hiddenFieldIds and groupFieldId."},"createdAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"updatedAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"archivedAt":{"type":["string","null"],"description":"Set once the record is archived."}}}},"createdAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"updatedAt":{"type":"string","description":"ISO 8601 UTC timestamp."},"archivedAt":{"type":["string","null"],"description":"Set once the record is archived."}}},"Row":{"type":"object","properties":{"id":{"type":"string"},"tableId":{"type":"string"},"values":{"type":"object","description":"Stored and computed values keyed by field id. A select holds a choice id, a multi-select a list of them, a link a list of record ids. Empty cells are absent."},"display":{"type":"object","additionalProperties":{"type":"string"},"description":"Every field's value as a person reads it, keyed by field name."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}}}}