{"openapi":"3.1.0","info":{"title":"Workscope API","version":"1","description":"Everything in Workscope, for your own systems. Guides: https://developers.workscope.co.uk"},"servers":[{"url":"https://app.workscope.co.uk"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key from Settings > API keys (starts wsk_)"}}},"security":[{"apiKey":[]}],"paths":{"/v1/organization":{"get":{"operationId":"organization.get","summary":"This organisation and its settings","tags":["Organisation"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"timeZone":{"type":"string"},"currency":{"type":"string"},"modules":{"type":"array","items":{"type":"string","enum":["projects","issues","invoicing","holiday","timesheets","quotes","purchases","payroll","recruitment"]}},"terms":{"type":"object","properties":{"client":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false},"project":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false},"booking":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false},"job":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false},"teamMember":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false},"team":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false}},"required":["client","project","booking","job","teamMember","team"],"additionalProperties":false},"durationDisplay":{"type":"string","enum":["minutes","hours"]},"weekStartsOn":{"type":"string","enum":["saturday","sunday","monday"]},"needsClockInDefault":{"type":"boolean"},"recordClockLocation":{"type":"boolean"},"openPickup":{"type":"boolean"},"openNotifyDelayMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missedClockInAlerts":{"type":"boolean"},"missedClockInGraceMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"phoneReminders":{"type":"boolean"},"photosVisibleToClients":{"default":true,"type":"boolean"},"logoUrl":{"type":["string","null"]},"address":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"vatRegistered":{"type":"boolean"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"activeClientDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"emailCopyToCompany":{"type":"boolean"},"profile":{"anyOf":[{"type":"object","properties":{"teamSize":{"type":"string","enum":["1","2-5","6-10","11-25","26-50","50+"]},"workType":{"type":"string","enum":["domestic-cleaning","commercial-cleaning","end-of-tenancy-cleaning","window-cleaning","carpet-and-upholstery-cleaning","plumbers","heating-engineers","electricians","air-conditioning","roofers","property-maintenance","facilities-management","gardening-and-landscaping","grounds-maintenance","pest-control","pool-and-hot-tub-care","fire-safety-servicing","security-patrols","other"]},"workTypes":{"type":"array","items":{"type":"string","enum":["domestic-cleaning","commercial-cleaning","end-of-tenancy-cleaning","window-cleaning","carpet-and-upholstery-cleaning","plumbers","heating-engineers","electricians","air-conditioning","roofers","property-maintenance","facilities-management","gardening-and-landscaping","grounds-maintenance","pest-control","pool-and-hot-tub-care","fire-safety-servicing","security-patrols","other"]}},"workTypeOther":{"type":["string","null"]},"customerType":{"type":"string","enum":["commercial","domestic","both"]},"clientCount":{"type":"string","enum":["0-10","11-50","51-100","101-250","250+"]},"answeredAt":{"type":"string"}},"required":["teamSize","workType","workTypes","workTypeOther","customerType","clientCount","answeredAt"],"additionalProperties":false},{"type":"null"}]},"closure":{"anyOf":[{"type":"object","properties":{"closedAt":{"type":"string"},"deleteAfter":{"type":"string"}},"required":["closedAt","deleteAfter"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","timeZone","currency","modules","terms","durationDisplay","weekStartsOn","needsClockInDefault","recordClockLocation","openPickup","openNotifyDelayMinutes","missedClockInAlerts","missedClockInGraceMinutes","phoneReminders","photosVisibleToClients","logoUrl","address","phone","email","website","companyNumber","vatNumber","vatRegistered","vatRateBp","activeClientDays","emailCopyToCompany","profile","closure"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"organization.update","summary":"Change settings","tags":["Organisation"],"x-permission":"organization.update","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"timeZone":{"type":"string"},"modules":{"type":"array","items":{"type":"string","enum":["projects","issues","invoicing","holiday","timesheets","quotes","purchases","payroll","recruitment"]}},"terms":{"type":"object","properties":{"client":{"anyOf":[{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"]},{"type":"null"}]},"project":{"anyOf":[{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"]},{"type":"null"}]},"booking":{"anyOf":[{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"]},{"type":"null"}]},"teamMember":{"anyOf":[{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"]},{"type":"null"}]},"team":{"anyOf":[{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"]},{"type":"null"}]}}},"durationDisplay":{"type":"string","enum":["minutes","hours"]},"weekStartsOn":{"type":"string","enum":["saturday","sunday","monday"]},"needsClockInDefault":{"type":"boolean"},"recordClockLocation":{"type":"boolean"},"openPickup":{"type":"boolean"},"openNotifyDelayMinutes":{"type":"integer","minimum":0,"maximum":60},"missedClockInAlerts":{"type":"boolean"},"missedClockInGraceMinutes":{"type":"integer","minimum":0,"maximum":240},"phoneReminders":{"type":"boolean"},"photosVisibleToClients":{"type":"boolean"},"invoiceSignedOffOnly":{"type":"boolean"},"activeClientDays":{"type":"integer","minimum":1,"maximum":366},"emailCopyToCompany":{"type":"boolean"},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","const":""},{"type":"string"}]},{"type":"null"}]},"website":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"vatRegistered":{"type":"boolean"},"vatRateBp":{"type":"integer","minimum":0,"maximum":10000},"profile":{"type":"object","properties":{"teamSize":{"type":"string","enum":["1","2-5","6-10","11-25","26-50","50+"]},"workType":{"type":"string","enum":["domestic-cleaning","commercial-cleaning","end-of-tenancy-cleaning","window-cleaning","carpet-and-upholstery-cleaning","plumbers","heating-engineers","electricians","air-conditioning","roofers","property-maintenance","facilities-management","gardening-and-landscaping","grounds-maintenance","pest-control","pool-and-hot-tub-care","fire-safety-servicing","security-patrols","other"]},"workTypes":{"anyOf":[{"maxItems":19,"type":"array","items":{"type":"string","enum":["domestic-cleaning","commercial-cleaning","end-of-tenancy-cleaning","window-cleaning","carpet-and-upholstery-cleaning","plumbers","heating-engineers","electricians","air-conditioning","roofers","property-maintenance","facilities-management","gardening-and-landscaping","grounds-maintenance","pest-control","pool-and-hot-tub-care","fire-safety-servicing","security-patrols","other"]}},{"type":"null"}]},"workTypeOther":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"customerType":{"type":"string","enum":["commercial","domestic","both"]},"clientCount":{"type":"string","enum":["0-10","11-50","51-100","101-250","250+"]}},"required":["teamSize","workType","customerType","clientCount"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"timeZone":{"type":"string"},"currency":{"type":"string"},"modules":{"type":"array","items":{"type":"string","enum":["projects","issues","invoicing","holiday","timesheets","quotes","purchases","payroll","recruitment"]}},"terms":{"type":"object","properties":{"client":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false},"project":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false},"booking":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false},"job":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false},"teamMember":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false},"team":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false}},"required":["client","project","booking","job","teamMember","team"],"additionalProperties":false},"durationDisplay":{"type":"string","enum":["minutes","hours"]},"weekStartsOn":{"type":"string","enum":["saturday","sunday","monday"]},"needsClockInDefault":{"type":"boolean"},"recordClockLocation":{"type":"boolean"},"openPickup":{"type":"boolean"},"openNotifyDelayMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missedClockInAlerts":{"type":"boolean"},"missedClockInGraceMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"phoneReminders":{"type":"boolean"},"photosVisibleToClients":{"default":true,"type":"boolean"},"logoUrl":{"type":["string","null"]},"address":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"vatRegistered":{"type":"boolean"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"activeClientDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"emailCopyToCompany":{"type":"boolean"},"profile":{"anyOf":[{"type":"object","properties":{"teamSize":{"type":"string","enum":["1","2-5","6-10","11-25","26-50","50+"]},"workType":{"type":"string","enum":["domestic-cleaning","commercial-cleaning","end-of-tenancy-cleaning","window-cleaning","carpet-and-upholstery-cleaning","plumbers","heating-engineers","electricians","air-conditioning","roofers","property-maintenance","facilities-management","gardening-and-landscaping","grounds-maintenance","pest-control","pool-and-hot-tub-care","fire-safety-servicing","security-patrols","other"]},"workTypes":{"type":"array","items":{"type":"string","enum":["domestic-cleaning","commercial-cleaning","end-of-tenancy-cleaning","window-cleaning","carpet-and-upholstery-cleaning","plumbers","heating-engineers","electricians","air-conditioning","roofers","property-maintenance","facilities-management","gardening-and-landscaping","grounds-maintenance","pest-control","pool-and-hot-tub-care","fire-safety-servicing","security-patrols","other"]}},"workTypeOther":{"type":["string","null"]},"customerType":{"type":"string","enum":["commercial","domestic","both"]},"clientCount":{"type":"string","enum":["0-10","11-50","51-100","101-250","250+"]},"answeredAt":{"type":"string"}},"required":["teamSize","workType","workTypes","workTypeOther","customerType","clientCount","answeredAt"],"additionalProperties":false},{"type":"null"}]},"closure":{"anyOf":[{"type":"object","properties":{"closedAt":{"type":"string"},"deleteAfter":{"type":"string"}},"required":["closedAt","deleteAfter"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","timeZone","currency","modules","terms","durationDisplay","weekStartsOn","needsClockInDefault","recordClockLocation","openPickup","openNotifyDelayMinutes","missedClockInAlerts","missedClockInGraceMinutes","phoneReminders","photosVisibleToClients","logoUrl","address","phone","email","website","companyNumber","vatNumber","vatRegistered","vatRateBp","activeClientDays","emailCopyToCompany","profile","closure"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/organization/logo":{"post":{"operationId":"organization.setLogo","summary":"Set the company's logo: send the image itself (JPEG, PNG, WebP; up to 5 MB)","tags":["Organisation"],"x-permission":"organization.update","parameters":[],"requestBody":{"required":true,"content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"timeZone":{"type":"string"},"currency":{"type":"string"},"modules":{"type":"array","items":{"type":"string","enum":["projects","issues","invoicing","holiday","timesheets","quotes","purchases","payroll","recruitment"]}},"terms":{"type":"object","properties":{"client":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false},"project":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false},"booking":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false},"job":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false},"teamMember":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false},"team":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false}},"required":["client","project","booking","job","teamMember","team"],"additionalProperties":false},"durationDisplay":{"type":"string","enum":["minutes","hours"]},"weekStartsOn":{"type":"string","enum":["saturday","sunday","monday"]},"needsClockInDefault":{"type":"boolean"},"recordClockLocation":{"type":"boolean"},"openPickup":{"type":"boolean"},"openNotifyDelayMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missedClockInAlerts":{"type":"boolean"},"missedClockInGraceMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"phoneReminders":{"type":"boolean"},"photosVisibleToClients":{"default":true,"type":"boolean"},"logoUrl":{"type":["string","null"]},"address":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"vatRegistered":{"type":"boolean"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"activeClientDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"emailCopyToCompany":{"type":"boolean"},"profile":{"anyOf":[{"type":"object","properties":{"teamSize":{"type":"string","enum":["1","2-5","6-10","11-25","26-50","50+"]},"workType":{"type":"string","enum":["domestic-cleaning","commercial-cleaning","end-of-tenancy-cleaning","window-cleaning","carpet-and-upholstery-cleaning","plumbers","heating-engineers","electricians","air-conditioning","roofers","property-maintenance","facilities-management","gardening-and-landscaping","grounds-maintenance","pest-control","pool-and-hot-tub-care","fire-safety-servicing","security-patrols","other"]},"workTypes":{"type":"array","items":{"type":"string","enum":["domestic-cleaning","commercial-cleaning","end-of-tenancy-cleaning","window-cleaning","carpet-and-upholstery-cleaning","plumbers","heating-engineers","electricians","air-conditioning","roofers","property-maintenance","facilities-management","gardening-and-landscaping","grounds-maintenance","pest-control","pool-and-hot-tub-care","fire-safety-servicing","security-patrols","other"]}},"workTypeOther":{"type":["string","null"]},"customerType":{"type":"string","enum":["commercial","domestic","both"]},"clientCount":{"type":"string","enum":["0-10","11-50","51-100","101-250","250+"]},"answeredAt":{"type":"string"}},"required":["teamSize","workType","workTypes","workTypeOther","customerType","clientCount","answeredAt"],"additionalProperties":false},{"type":"null"}]},"closure":{"anyOf":[{"type":"object","properties":{"closedAt":{"type":"string"},"deleteAfter":{"type":"string"}},"required":["closedAt","deleteAfter"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","timeZone","currency","modules","terms","durationDisplay","weekStartsOn","needsClockInDefault","recordClockLocation","openPickup","openNotifyDelayMinutes","missedClockInAlerts","missedClockInGraceMinutes","phoneReminders","photosVisibleToClients","logoUrl","address","phone","email","website","companyNumber","vatNumber","vatRegistered","vatRateBp","activeClientDays","emailCopyToCompany","profile","closure"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"get":{"operationId":"organization.logo","summary":"The company's logo (PNG)","tags":["Organisation"],"parameters":[],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"organization.removeLogo","summary":"Remove the company's logo","tags":["Organisation"],"x-permission":"organization.update","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"timeZone":{"type":"string"},"currency":{"type":"string"},"modules":{"type":"array","items":{"type":"string","enum":["projects","issues","invoicing","holiday","timesheets","quotes","purchases","payroll","recruitment"]}},"terms":{"type":"object","properties":{"client":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false},"project":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false},"booking":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false},"job":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false},"teamMember":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false},"team":{"type":"object","properties":{"one":{"type":"string","minLength":1,"maxLength":40},"many":{"type":"string","minLength":1,"maxLength":40}},"required":["one","many"],"additionalProperties":false}},"required":["client","project","booking","job","teamMember","team"],"additionalProperties":false},"durationDisplay":{"type":"string","enum":["minutes","hours"]},"weekStartsOn":{"type":"string","enum":["saturday","sunday","monday"]},"needsClockInDefault":{"type":"boolean"},"recordClockLocation":{"type":"boolean"},"openPickup":{"type":"boolean"},"openNotifyDelayMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missedClockInAlerts":{"type":"boolean"},"missedClockInGraceMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"phoneReminders":{"type":"boolean"},"photosVisibleToClients":{"default":true,"type":"boolean"},"logoUrl":{"type":["string","null"]},"address":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"vatRegistered":{"type":"boolean"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"activeClientDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"emailCopyToCompany":{"type":"boolean"},"profile":{"anyOf":[{"type":"object","properties":{"teamSize":{"type":"string","enum":["1","2-5","6-10","11-25","26-50","50+"]},"workType":{"type":"string","enum":["domestic-cleaning","commercial-cleaning","end-of-tenancy-cleaning","window-cleaning","carpet-and-upholstery-cleaning","plumbers","heating-engineers","electricians","air-conditioning","roofers","property-maintenance","facilities-management","gardening-and-landscaping","grounds-maintenance","pest-control","pool-and-hot-tub-care","fire-safety-servicing","security-patrols","other"]},"workTypes":{"type":"array","items":{"type":"string","enum":["domestic-cleaning","commercial-cleaning","end-of-tenancy-cleaning","window-cleaning","carpet-and-upholstery-cleaning","plumbers","heating-engineers","electricians","air-conditioning","roofers","property-maintenance","facilities-management","gardening-and-landscaping","grounds-maintenance","pest-control","pool-and-hot-tub-care","fire-safety-servicing","security-patrols","other"]}},"workTypeOther":{"type":["string","null"]},"customerType":{"type":"string","enum":["commercial","domestic","both"]},"clientCount":{"type":"string","enum":["0-10","11-50","51-100","101-250","250+"]},"answeredAt":{"type":"string"}},"required":["teamSize","workType","workTypes","workTypeOther","customerType","clientCount","answeredAt"],"additionalProperties":false},{"type":"null"}]},"closure":{"anyOf":[{"type":"object","properties":{"closedAt":{"type":"string"},"deleteAfter":{"type":"string"}},"required":["closedAt","deleteAfter"],"additionalProperties":false},{"type":"null"}]}},"required":["id","name","timeZone","currency","modules","terms","durationDisplay","weekStartsOn","needsClockInDefault","recordClockLocation","openPickup","openNotifyDelayMinutes","missedClockInAlerts","missedClockInGraceMinutes","phoneReminders","photosVisibleToClients","logoUrl","address","phone","email","website","companyNumber","vatNumber","vatRegistered","vatRateBp","activeClientDays","emailCopyToCompany","profile","closure"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/organization/setup":{"get":{"operationId":"organization.setup","summary":"Setting up a new company: where the guide carries on from, and the checklist Home shows (worked out from the company's data)","tags":["Organisation"],"x-permission":"organization.update","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"step":{"type":"string","enum":["company","modules","words","money","team","clients","done"]},"seen":{"type":"array","items":{"type":"string","enum":["company","modules","words","money","team","clients"]}},"checklist":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["company","modules","words","money","team","clients","job","booking"]},"done":{"type":"boolean"}},"required":["key","done"],"additionalProperties":false}},"complete":{"type":"boolean"},"dismissed":{"type":"boolean"},"show":{"type":"boolean"}},"required":["step","seen","checklist","complete","dismissed","show"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"organization.updateSetup","summary":"Move the setup guide on, mark a step finished, or hide the checklist","tags":["Organisation"],"x-permission":"organization.update","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"step":{"type":"string","enum":["company","modules","words","money","team","clients","done"]},"seen":{"type":"string","enum":["company","modules","words","money","team","clients"]},"dismissed":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"step":{"type":"string","enum":["company","modules","words","money","team","clients","done"]},"seen":{"type":"array","items":{"type":"string","enum":["company","modules","words","money","team","clients"]}},"checklist":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["company","modules","words","money","team","clients","job","booking"]},"done":{"type":"boolean"}},"required":["key","done"],"additionalProperties":false}},"complete":{"type":"boolean"},"dismissed":{"type":"boolean"},"show":{"type":"boolean"}},"required":["step","seen","checklist","complete","dismissed","show"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/organization/export":{"get":{"operationId":"organization.export","summary":"Download the company's data: a ZIP of CSV files (clients, contacts, projects, bookings, repeat bookings, team members); owners only","tags":["Organisation"],"x-permission":"organization.close","parameters":[],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clients":{"get":{"operationId":"clients.list","summary":"Clients","tags":["Clients"],"x-permission":"client.view","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["live","archived"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"tag","in":"query","required":false,"schema":{"type":"string","enum":["all","active","past","prospect","none"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"address":{"type":["string","null"]},"notes":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"status":{"type":"string","enum":["live","archived"]},"isInternal":{"type":"boolean"},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"tags":{"type":"array","items":{"type":"string","enum":["prospect","active","past"]}},"createdAt":{"type":"string"}},"required":["id","name","email","phone","website","address","notes","logoUrl","status","isInternal","customFields","tags","createdAt"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"clients.create","summary":"Add a client","tags":["Clients"],"x-permission":"client.manage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"anyOf":[{"anyOf":[{"type":"string","const":""},{"type":"string"}]},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"website":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"customFields":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"type":["string","number","boolean","null"]}}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"address":{"type":["string","null"]},"notes":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"status":{"type":"string","enum":["live","archived"]},"isInternal":{"type":"boolean"},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"tags":{"type":"array","items":{"type":"string","enum":["prospect","active","past"]}},"createdAt":{"type":"string"}},"required":["id","name","email","phone","website","address","notes","logoUrl","status","isInternal","customFields","tags","createdAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clients/{id}":{"get":{"operationId":"clients.get","summary":"One client","tags":["Clients"],"x-permission":"client.view","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"address":{"type":["string","null"]},"notes":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"status":{"type":"string","enum":["live","archived"]},"isInternal":{"type":"boolean"},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"tags":{"type":"array","items":{"type":"string","enum":["prospect","active","past"]}},"createdAt":{"type":"string"}},"required":["id","name","email","phone","website","address","notes","logoUrl","status","isInternal","customFields","tags","createdAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"clients.update","summary":"Change or archive a client","tags":["Clients"],"x-permission":"client.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"anyOf":[{"anyOf":[{"type":"string","const":""},{"type":"string"}]},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"website":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"customFields":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"type":["string","number","boolean","null"]}},"status":{"type":"string","enum":["live","archived"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"address":{"type":["string","null"]},"notes":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"status":{"type":"string","enum":["live","archived"]},"isInternal":{"type":"boolean"},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"tags":{"type":"array","items":{"type":"string","enum":["prospect","active","past"]}},"createdAt":{"type":"string"}},"required":["id","name","email","phone","website","address","notes","logoUrl","status","isInternal","customFields","tags","createdAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clients/{id}/logo":{"post":{"operationId":"clients.setLogo","summary":"Set a client's logo: send the image itself (JPEG, PNG, WebP; up to 5 MB)","tags":["Clients"],"x-permission":"client.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"address":{"type":["string","null"]},"notes":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"status":{"type":"string","enum":["live","archived"]},"isInternal":{"type":"boolean"},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"tags":{"type":"array","items":{"type":"string","enum":["prospect","active","past"]}},"createdAt":{"type":"string"}},"required":["id","name","email","phone","website","address","notes","logoUrl","status","isInternal","customFields","tags","createdAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"get":{"operationId":"clients.logo","summary":"The client's logo (PNG)","tags":["Clients"],"x-permission":"client.view","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"clients.removeLogo","summary":"Remove a client's logo","tags":["Clients"],"x-permission":"client.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"address":{"type":["string","null"]},"notes":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"status":{"type":"string","enum":["live","archived"]},"isInternal":{"type":"boolean"},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"tags":{"type":"array","items":{"type":"string","enum":["prospect","active","past"]}},"createdAt":{"type":"string"}},"required":["id","name","email","phone","website","address","notes","logoUrl","status","isInternal","customFields","tags","createdAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clients/import":{"post":{"operationId":"clients.import","summary":"Import clients (and a main contact each) from spreadsheet rows, already matched to fields; dryRun says what would happen","tags":["Clients"],"x-permission":"client.manage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"rows":{"minItems":1,"maxItems":2000,"type":"array","items":{"type":"object","properties":{"rowNumber":{"type":"integer","minimum":1,"maximum":9007199254740991},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":5000}}},"required":["rowNumber","values"]}},"onDuplicate":{"default":"skip","type":"string","enum":["skip","update"]},"dryRun":{"default":false,"type":"boolean"}},"required":["rows"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"dryRun":{"type":"boolean"},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rows":{"type":"array","items":{"type":"object","properties":{"rowNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"outcome":{"type":"string","enum":["created","updated","skipped","failed"]},"message":{"type":["string","null"]}},"required":["rowNumber","name","outcome","message"],"additionalProperties":false}}},"required":["dryRun","created","updated","skipped","failed","rows"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clients/{id}/archive-check":{"get":{"operationId":"clients.archiveCheck","summary":"Whether a client can be archived yet, and what is in the way (upcoming bookings, running repeat bookings)","tags":["Clients"],"x-permission":"client.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"canArchive":{"type":"boolean"},"reasons":{"type":"array","items":{"type":"string"}},"bookingCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"jobCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"date":{"type":"string"},"status":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]}},"required":["id","name","date","status"],"additionalProperties":false}},"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"startDate":{"type":"string"}},"required":["id","name","startDate"],"additionalProperties":false}}},"required":["canArchive","reasons","bookingCount","jobCount","bookings","jobs"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clients/{id}/contacts":{"get":{"operationId":"contacts.list","summary":"A client's contacts","tags":["Clients"],"x-permission":"client.view","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"jobTitle":{"type":["string","null"]},"notes":{"type":["string","null"]},"hasLogin":{"type":"boolean"},"access":{"type":"object","properties":{"state":{"type":"string","enum":["login","invited","none"]},"lastSeenAt":{"type":["string","null"]},"invitationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"invitedAt":{"type":["string","null"]}},"required":["state","lastSeenAt","invitationId","invitedAt"],"additionalProperties":false},"emailBlock":{"anyOf":[{"type":"object","properties":{"reason":{"type":"string","enum":["bounce","complaint"]},"at":{"type":"string"},"canUnblock":{"type":"boolean"}},"required":["reason","at","canUnblock"],"additionalProperties":false},{"type":"null"}]}},"required":["id","clientId","name","email","phone","jobTitle","notes","hasLogin","access"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"contacts.create","summary":"Add a contact","tags":["Clients"],"x-permission":"client.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"anyOf":[{"anyOf":[{"type":"string","const":""},{"type":"string"}]},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"jobTitle":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"jobTitle":{"type":["string","null"]},"notes":{"type":["string","null"]},"hasLogin":{"type":"boolean"},"access":{"type":"object","properties":{"state":{"type":"string","enum":["login","invited","none"]},"lastSeenAt":{"type":["string","null"]},"invitationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"invitedAt":{"type":["string","null"]}},"required":["state","lastSeenAt","invitationId","invitedAt"],"additionalProperties":false},"emailBlock":{"anyOf":[{"type":"object","properties":{"reason":{"type":"string","enum":["bounce","complaint"]},"at":{"type":"string"},"canUnblock":{"type":"boolean"}},"required":["reason","at","canUnblock"],"additionalProperties":false},{"type":"null"}]}},"required":["id","clientId","name","email","phone","jobTitle","notes","hasLogin","access"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clients/{id}/contacts/{childId}":{"patch":{"operationId":"contacts.update","summary":"Change a contact","tags":["Clients"],"x-permission":"client.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"childId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"anyOf":[{"anyOf":[{"type":"string","const":""},{"type":"string"}]},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"jobTitle":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"jobTitle":{"type":["string","null"]},"notes":{"type":["string","null"]},"hasLogin":{"type":"boolean"},"access":{"type":"object","properties":{"state":{"type":"string","enum":["login","invited","none"]},"lastSeenAt":{"type":["string","null"]},"invitationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"invitedAt":{"type":["string","null"]}},"required":["state","lastSeenAt","invitationId","invitedAt"],"additionalProperties":false},"emailBlock":{"anyOf":[{"type":"object","properties":{"reason":{"type":"string","enum":["bounce","complaint"]},"at":{"type":"string"},"canUnblock":{"type":"boolean"}},"required":["reason","at","canUnblock"],"additionalProperties":false},{"type":"null"}]}},"required":["id","clientId","name","email","phone","jobTitle","notes","hasLogin","access"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"contacts.remove","summary":"Remove a contact","tags":["Clients"],"x-permission":"client.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"childId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clients/{id}/contacts/{childId}/unblock-email":{"post":{"operationId":"contacts.unblockEmail","summary":"Email this contact again after one of this company's emails bounced or was marked as spam","tags":["Clients"],"x-permission":"client.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"childId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"jobTitle":{"type":["string","null"]},"notes":{"type":["string","null"]},"hasLogin":{"type":"boolean"},"access":{"type":"object","properties":{"state":{"type":"string","enum":["login","invited","none"]},"lastSeenAt":{"type":["string","null"]},"invitationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"invitedAt":{"type":["string","null"]}},"required":["state","lastSeenAt","invitationId","invitedAt"],"additionalProperties":false},"emailBlock":{"anyOf":[{"type":"object","properties":{"reason":{"type":"string","enum":["bounce","complaint"]},"at":{"type":"string"},"canUnblock":{"type":"boolean"}},"required":["reason","at","canUnblock"],"additionalProperties":false},{"type":"null"}]}},"required":["id","clientId","name","email","phone","jobTitle","notes","hasLogin","access"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/emails":{"get":{"operationId":"emails.list","summary":"The emails sent for one record (a deal, a quote, an invoice): who to, and whether each arrived","tags":["Emails"],"x-permission":"client.view","parameters":[{"name":"relatedType","in":"query","required":true,"schema":{"type":"string","enum":["deal","quote","invoice","credit_note","purchase_order","applicant"]}},{"name":"relatedId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string"},"to":{"type":"string"},"subject":{"type":"string"},"status":{"type":"string","enum":["queued","sent","not_sent","delivered","bounced","complained","failed"]},"detail":{"type":["string","null"]},"sentAt":{"type":["string","null"]},"updatedAt":{"type":"string"},"createdAt":{"type":"string"},"byName":{"type":["string","null"]}},"required":["id","kind","to","subject","status","detail","sentAt","updatedAt","createdAt","byName"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/contacts":{"get":{"operationId":"contactsAll.list","summary":"Contacts across all clients","tags":["Clients"],"x-permission":"client.view","parameters":[{"name":"clientId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"jobTitle":{"type":["string","null"]},"notes":{"type":["string","null"]},"hasLogin":{"type":"boolean"},"access":{"type":"object","properties":{"state":{"type":"string","enum":["login","invited","none"]},"lastSeenAt":{"type":["string","null"]},"invitationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"invitedAt":{"type":["string","null"]}},"required":["state","lastSeenAt","invitationId","invitedAt"],"additionalProperties":false},"emailBlock":{"anyOf":[{"type":"object","properties":{"reason":{"type":"string","enum":["bounce","complaint"]},"at":{"type":"string"},"canUnblock":{"type":"boolean"}},"required":["reason","at","canUnblock"],"additionalProperties":false},{"type":"null"}]},"clientName":{"type":"string"}},"required":["id","clientId","name","email","phone","jobTitle","notes","hasLogin","access","clientName"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/projects":{"get":{"operationId":"projects.list","summary":"Projects (optional pieces of work under a client)","tags":["Projects"],"x-permission":"project.view","parameters":[{"name":"clientId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","archived"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"notes":{"type":["string","null"]},"status":{"type":"string","enum":["active","archived"]},"logoUrl":{"type":["string","null"]},"clientLogoUrl":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}}},"required":["id","clientId","clientName","name","description","startDate","endDate","notes","status","logoUrl","clientLogoUrl","customFields"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"projects.create","summary":"Add a project","tags":["Projects"],"x-permission":"project.manage","x-module":"projects","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"customFields":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"type":["string","number","boolean","null"]}}},"required":["clientId","name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"notes":{"type":["string","null"]},"status":{"type":"string","enum":["active","archived"]},"logoUrl":{"type":["string","null"]},"clientLogoUrl":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}}},"required":["id","clientId","clientName","name","description","startDate","endDate","notes","status","logoUrl","clientLogoUrl","customFields"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/projects/{id}":{"get":{"operationId":"projects.get","summary":"One project","tags":["Projects"],"x-permission":"project.view","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"notes":{"type":["string","null"]},"status":{"type":"string","enum":["active","archived"]},"logoUrl":{"type":["string","null"]},"clientLogoUrl":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}}},"required":["id","clientId","clientName","name","description","startDate","endDate","notes","status","logoUrl","clientLogoUrl","customFields"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"projects.update","summary":"Change or archive a project","tags":["Projects"],"x-permission":"project.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"status":{"type":"string","enum":["active","archived"]},"customFields":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"type":["string","number","boolean","null"]}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"notes":{"type":["string","null"]},"status":{"type":"string","enum":["active","archived"]},"logoUrl":{"type":["string","null"]},"clientLogoUrl":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}}},"required":["id","clientId","clientName","name","description","startDate","endDate","notes","status","logoUrl","clientLogoUrl","customFields"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/projects/{id}/logo":{"post":{"operationId":"projects.setLogo","summary":"Set a project's logo: send the image itself (JPEG, PNG, WebP; up to 5 MB)","tags":["Projects"],"x-permission":"project.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"notes":{"type":["string","null"]},"status":{"type":"string","enum":["active","archived"]},"logoUrl":{"type":["string","null"]},"clientLogoUrl":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}}},"required":["id","clientId","clientName","name","description","startDate","endDate","notes","status","logoUrl","clientLogoUrl","customFields"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"get":{"operationId":"projects.logo","summary":"The project's logo (PNG)","tags":["Projects"],"x-permission":"project.view","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"projects.removeLogo","summary":"Remove a project's logo","tags":["Projects"],"x-permission":"project.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"notes":{"type":["string","null"]},"status":{"type":"string","enum":["active","archived"]},"logoUrl":{"type":["string","null"]},"clientLogoUrl":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}}},"required":["id","clientId","clientName","name","description","startDate","endDate","notes","status","logoUrl","clientLogoUrl","customFields"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/custom-fields":{"get":{"operationId":"customFields.list","summary":"The company's own fields on clients, projects and bookings (operatives get the booking fields marked for them)","tags":["Custom fields"],"x-permission":"customFields.view","parameters":[{"name":"entity","in":"query","required":false,"schema":{"type":"string","enum":["client","project","booking","team_member"]}},{"name":"templateId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"archived","in":"query","required":false,"schema":{"default":"false","type":"string","enum":["true","false","all"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"entity":{"type":"string","enum":["client","project","booking","team_member"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"label":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string","enum":["text","textarea","number","date","checkbox","select","address"]},"options":{"type":"array","items":{"type":"string"}},"required":{"type":"boolean"},"showInList":{"type":"boolean"},"visibleToOperatives":{"type":"boolean"},"visibleToClients":{"type":"boolean"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"}},"required":["id","entity","templateId","label","slug","type","options","required","showInList","visibleToOperatives","visibleToClients","position","archived"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"customFields.create","summary":"Add a field","tags":["Custom fields"],"x-permission":"customFields.manage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":100},"type":{"type":"string","enum":["text","textarea","number","date","checkbox","select","address"]},"options":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"required":{"default":false,"type":"boolean"},"showInList":{"default":false,"type":"boolean"},"visibleToOperatives":{"type":"boolean"},"visibleToClients":{"default":false,"type":"boolean"},"position":{"type":"integer","minimum":0,"maximum":10000},"entity":{"type":"string","enum":["client","project","booking","team_member"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["label","type","entity"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"entity":{"type":"string","enum":["client","project","booking","team_member"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"label":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string","enum":["text","textarea","number","date","checkbox","select","address"]},"options":{"type":"array","items":{"type":"string"}},"required":{"type":"boolean"},"showInList":{"type":"boolean"},"visibleToOperatives":{"type":"boolean"},"visibleToClients":{"type":"boolean"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"}},"required":["id","entity","templateId","label","slug","type","options","required","showInList","visibleToOperatives","visibleToClients","position","archived"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/custom-fields/{id}":{"patch":{"operationId":"customFields.update","summary":"Change a field (its type and slug stay), or archive it","tags":["Custom fields"],"x-permission":"customFields.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":100},"options":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"required":{"type":"boolean"},"showInList":{"type":"boolean"},"visibleToOperatives":{"type":"boolean"},"visibleToClients":{"type":"boolean"},"position":{"type":"integer","minimum":0,"maximum":10000},"archived":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"entity":{"type":"string","enum":["client","project","booking","team_member"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"label":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string","enum":["text","textarea","number","date","checkbox","select","address"]},"options":{"type":"array","items":{"type":"string"}},"required":{"type":"boolean"},"showInList":{"type":"boolean"},"visibleToOperatives":{"type":"boolean"},"visibleToClients":{"type":"boolean"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"}},"required":["id","entity","templateId","label","slug","type","options","required","showInList","visibleToOperatives","visibleToClients","position","archived"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"customFields.remove","summary":"Delete a field nothing has a value for (archive it otherwise)","tags":["Custom fields"],"x-permission":"customFields.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/booking-templates":{"get":{"operationId":"bookingTemplates.list","summary":"Booking templates (Xota's task templates): a name and its own booking fields","tags":["Custom fields"],"x-permission":"customFields.view","parameters":[{"name":"archived","in":"query","required":false,"schema":{"default":"false","type":"string","enum":["true","false","all"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"description":{"type":["string","null"]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"pricePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"fieldDefaults":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"checklist":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string"},"instruction":{"type":["string","null"]},"kind":{"type":"string","enum":["tick","text","textarea","number","date","time","checkbox","select","photo"]},"unit":{"type":["string","null"]},"options":{"type":"array","items":{"type":"string"}},"askComment":{"type":"boolean"},"required":{"type":"boolean"},"visibleToClients":{"type":"boolean"}},"required":["id","label","instruction","kind","unit","options","askComment","required","visibleToClients"],"additionalProperties":false}},"archived":{"type":"boolean"},"inUse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"entity":{"type":"string","enum":["client","project","booking","team_member"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"label":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string","enum":["text","textarea","number","date","checkbox","select","address"]},"options":{"type":"array","items":{"type":"string"}},"required":{"type":"boolean"},"showInList":{"type":"boolean"},"visibleToOperatives":{"type":"boolean"},"visibleToClients":{"type":"boolean"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"}},"required":["id","entity","templateId","label","slug","type","options","required","showInList","visibleToOperatives","visibleToClients","position","archived"],"additionalProperties":false}}},"required":["id","name","description","durationMinutes","pricePence","fieldDefaults","checklist","archived","inUse","fields"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"bookingTemplates.create","summary":"Add a booking template","tags":["Custom fields"],"x-permission":"customFields.manage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":1,"maximum":10080},{"type":"null"}]},"pricePence":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000000},{"type":"null"}]},"fieldDefaults":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"type":["string","number","boolean","null"]}},"checklist":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string","minLength":1,"maxLength":200},"instruction":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"kind":{"default":"tick","type":"string","enum":["tick","text","textarea","number","date","time","checkbox","select","photo"]},"unit":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"options":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"askComment":{"default":false,"type":"boolean"},"required":{"default":false,"type":"boolean"},"visibleToClients":{"default":false,"type":"boolean"}},"required":["label"]}}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"description":{"type":["string","null"]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"pricePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"fieldDefaults":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"checklist":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string"},"instruction":{"type":["string","null"]},"kind":{"type":"string","enum":["tick","text","textarea","number","date","time","checkbox","select","photo"]},"unit":{"type":["string","null"]},"options":{"type":"array","items":{"type":"string"}},"askComment":{"type":"boolean"},"required":{"type":"boolean"},"visibleToClients":{"type":"boolean"}},"required":["id","label","instruction","kind","unit","options","askComment","required","visibleToClients"],"additionalProperties":false}},"archived":{"type":"boolean"},"inUse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"entity":{"type":"string","enum":["client","project","booking","team_member"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"label":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string","enum":["text","textarea","number","date","checkbox","select","address"]},"options":{"type":"array","items":{"type":"string"}},"required":{"type":"boolean"},"showInList":{"type":"boolean"},"visibleToOperatives":{"type":"boolean"},"visibleToClients":{"type":"boolean"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"}},"required":["id","entity","templateId","label","slug","type","options","required","showInList","visibleToOperatives","visibleToClients","position","archived"],"additionalProperties":false}}},"required":["id","name","description","durationMinutes","pricePence","fieldDefaults","checklist","archived","inUse","fields"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/booking-templates/{id}":{"patch":{"operationId":"bookingTemplates.update","summary":"Rename or archive a booking template","tags":["Custom fields"],"x-permission":"customFields.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":1,"maximum":10080},{"type":"null"}]},"pricePence":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000000},{"type":"null"}]},"fieldDefaults":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"type":["string","number","boolean","null"]}},"checklist":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string","minLength":1,"maxLength":200},"instruction":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"kind":{"default":"tick","type":"string","enum":["tick","text","textarea","number","date","time","checkbox","select","photo"]},"unit":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"options":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"askComment":{"default":false,"type":"boolean"},"required":{"default":false,"type":"boolean"},"visibleToClients":{"default":false,"type":"boolean"}},"required":["label"]}},"archived":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"description":{"type":["string","null"]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"pricePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"fieldDefaults":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"checklist":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string"},"instruction":{"type":["string","null"]},"kind":{"type":"string","enum":["tick","text","textarea","number","date","time","checkbox","select","photo"]},"unit":{"type":["string","null"]},"options":{"type":"array","items":{"type":"string"}},"askComment":{"type":"boolean"},"required":{"type":"boolean"},"visibleToClients":{"type":"boolean"}},"required":["id","label","instruction","kind","unit","options","askComment","required","visibleToClients"],"additionalProperties":false}},"archived":{"type":"boolean"},"inUse":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"entity":{"type":"string","enum":["client","project","booking","team_member"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"label":{"type":"string"},"slug":{"type":"string"},"type":{"type":"string","enum":["text","textarea","number","date","checkbox","select","address"]},"options":{"type":"array","items":{"type":"string"}},"required":{"type":"boolean"},"showInList":{"type":"boolean"},"visibleToOperatives":{"type":"boolean"},"visibleToClients":{"type":"boolean"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"boolean"}},"required":["id","entity","templateId","label","slug","type","options","required","showInList","visibleToOperatives","visibleToClients","position","archived"],"additionalProperties":false}}},"required":["id","name","description","durationMinutes","pricePence","fieldDefaults","checklist","archived","inUse","fields"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"bookingTemplates.remove","summary":"Delete a booking template nothing uses (archive it otherwise)","tags":["Custom fields"],"x-permission":"customFields.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/teams":{"get":{"operationId":"teams.list","summary":"Teams","tags":["Team"],"x-permission":"team.view","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"description":{"type":["string","null"]},"teamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["id","name","description","teamMemberIds"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"teams.create","summary":"Add a team","tags":["Team"],"x-permission":"team.manage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"teamMemberIds":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"description":{"type":["string","null"]},"teamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["id","name","description","teamMemberIds"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/teams/{id}":{"patch":{"operationId":"teams.update","summary":"Change a team","tags":["Team"],"x-permission":"team.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"teamMemberIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"description":{"type":["string","null"]},"teamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["id","name","description","teamMemberIds"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"teams.remove","summary":"Remove a team","tags":["Team"],"x-permission":"team.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/team-members":{"get":{"operationId":"teamMembers.list","summary":"Team members","tags":["Team"],"x-permission":"team.view","parameters":[{"name":"status","in":"query","required":false,"schema":{"default":"active","type":"string","enum":["active","archived","all"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"access","in":"query","required":false,"schema":{"type":"string","enum":["login","invited","none"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"surname":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"jobTitle":{"type":["string","null"]},"notes":{"type":["string","null"]},"employmentStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"employmentEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"address":{"type":["string","null"]},"dateOfBirth":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"niNumberMasked":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"teamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"hasLogin":{"type":"boolean"},"access":{"type":"object","properties":{"state":{"type":"string","enum":["login","invited","none"]},"lastSeenAt":{"type":["string","null"]},"invitationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"invitedAt":{"type":["string","null"]}},"required":["state","lastSeenAt","invitationId","invitedAt"],"additionalProperties":false},"archived":{"type":"boolean"},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"payBasis":{"type":"string","enum":["hourly","salaried"]},"accrualRatePercent":{"type":["number","null"]},"salariedAllowanceDays":{"type":["number","null"]},"workingWeekdays":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"minutesPerDay":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"breaksPaid":{"type":"boolean"},"hoursFrom":{"type":"string","enum":["bookings","timesheets"]},"inPayroll":{"type":"boolean"},"onTrial":{"type":"boolean"},"emergencyContact":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"relationship":{"type":["string","null"]},"phone":{"type":"string"}},"required":["name","relationship","phone"],"additionalProperties":false},{"type":"null"}]},"bankMasked":{"type":["string","null"]}},"required":["id","name","surname","email","phone","jobTitle","notes","employmentStartDate","employmentEndDate","address","dateOfBirth","niNumberMasked","photoUrl","teamIds","hasLogin","access","archived","customFields","payBasis","accrualRatePercent","salariedAllowanceDays","workingWeekdays","minutesPerDay","breaksPaid","hoursFrom","inPayroll","onTrial","emergencyContact","bankMasked"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"teamMembers.create","summary":"Add a team member","tags":["Team"],"x-permission":"team.manage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"surname":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","const":""},{"type":"string"}]},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"jobTitle":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"employmentStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"employmentEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"dateOfBirth":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"niNumber":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"teamIds":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"customFields":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"type":["string","number","boolean","null"]}},"payBasis":{"type":"string","enum":["hourly","salaried"]},"accrualRatePercent":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"salariedAllowanceDays":{"anyOf":[{"type":"number","minimum":0,"maximum":366},{"type":"null"}]},"workingWeekdays":{"maxItems":7,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"minutesPerDay":{"type":"integer","minimum":15,"maximum":1440},"breaksPaid":{"type":"boolean"},"inPayroll":{"type":"boolean"},"hoursFrom":{"type":"string","enum":["bookings","timesheets"]},"hoursFromStartsOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"surname":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"jobTitle":{"type":["string","null"]},"notes":{"type":["string","null"]},"employmentStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"employmentEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"address":{"type":["string","null"]},"dateOfBirth":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"niNumberMasked":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"teamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"hasLogin":{"type":"boolean"},"access":{"type":"object","properties":{"state":{"type":"string","enum":["login","invited","none"]},"lastSeenAt":{"type":["string","null"]},"invitationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"invitedAt":{"type":["string","null"]}},"required":["state","lastSeenAt","invitationId","invitedAt"],"additionalProperties":false},"archived":{"type":"boolean"},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"payBasis":{"type":"string","enum":["hourly","salaried"]},"accrualRatePercent":{"type":["number","null"]},"salariedAllowanceDays":{"type":["number","null"]},"workingWeekdays":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"minutesPerDay":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"breaksPaid":{"type":"boolean"},"hoursFrom":{"type":"string","enum":["bookings","timesheets"]},"inPayroll":{"type":"boolean"},"onTrial":{"type":"boolean"},"emergencyContact":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"relationship":{"type":["string","null"]},"phone":{"type":"string"}},"required":["name","relationship","phone"],"additionalProperties":false},{"type":"null"}]},"bankMasked":{"type":["string","null"]}},"required":["id","name","surname","email","phone","jobTitle","notes","employmentStartDate","employmentEndDate","address","dateOfBirth","niNumberMasked","photoUrl","teamIds","hasLogin","access","archived","customFields","payBasis","accrualRatePercent","salariedAllowanceDays","workingWeekdays","minutesPerDay","breaksPaid","hoursFrom","inPayroll","onTrial","emergencyContact","bankMasked"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/team-members/{id}":{"get":{"operationId":"teamMembers.get","summary":"One team member","tags":["Team"],"x-permission":"team.view","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"surname":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"jobTitle":{"type":["string","null"]},"notes":{"type":["string","null"]},"employmentStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"employmentEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"address":{"type":["string","null"]},"dateOfBirth":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"niNumberMasked":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"teamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"hasLogin":{"type":"boolean"},"access":{"type":"object","properties":{"state":{"type":"string","enum":["login","invited","none"]},"lastSeenAt":{"type":["string","null"]},"invitationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"invitedAt":{"type":["string","null"]}},"required":["state","lastSeenAt","invitationId","invitedAt"],"additionalProperties":false},"archived":{"type":"boolean"},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"payBasis":{"type":"string","enum":["hourly","salaried"]},"accrualRatePercent":{"type":["number","null"]},"salariedAllowanceDays":{"type":["number","null"]},"workingWeekdays":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"minutesPerDay":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"breaksPaid":{"type":"boolean"},"hoursFrom":{"type":"string","enum":["bookings","timesheets"]},"inPayroll":{"type":"boolean"},"onTrial":{"type":"boolean"},"emergencyContact":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"relationship":{"type":["string","null"]},"phone":{"type":"string"}},"required":["name","relationship","phone"],"additionalProperties":false},{"type":"null"}]},"bankMasked":{"type":["string","null"]}},"required":["id","name","surname","email","phone","jobTitle","notes","employmentStartDate","employmentEndDate","address","dateOfBirth","niNumberMasked","photoUrl","teamIds","hasLogin","access","archived","customFields","payBasis","accrualRatePercent","salariedAllowanceDays","workingWeekdays","minutesPerDay","breaksPaid","hoursFrom","inPayroll","onTrial","emergencyContact","bankMasked"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"teamMembers.update","summary":"Change or archive a team member","tags":["Team"],"x-permission":"team.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"surname":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","const":""},{"type":"string"}]},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"jobTitle":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"employmentStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"employmentEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"dateOfBirth":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"niNumber":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"teamIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"customFields":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"type":["string","number","boolean","null"]}},"payBasis":{"type":"string","enum":["hourly","salaried"]},"accrualRatePercent":{"anyOf":[{"type":"number","minimum":0,"maximum":50},{"type":"null"}]},"salariedAllowanceDays":{"anyOf":[{"type":"number","minimum":0,"maximum":366},{"type":"null"}]},"workingWeekdays":{"maxItems":7,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"minutesPerDay":{"type":"integer","minimum":15,"maximum":1440},"breaksPaid":{"type":"boolean"},"inPayroll":{"type":"boolean"},"hoursFrom":{"type":"string","enum":["bookings","timesheets"]},"hoursFromStartsOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"archived":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"surname":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"jobTitle":{"type":["string","null"]},"notes":{"type":["string","null"]},"employmentStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"employmentEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"address":{"type":["string","null"]},"dateOfBirth":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"niNumberMasked":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"teamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"hasLogin":{"type":"boolean"},"access":{"type":"object","properties":{"state":{"type":"string","enum":["login","invited","none"]},"lastSeenAt":{"type":["string","null"]},"invitationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"invitedAt":{"type":["string","null"]}},"required":["state","lastSeenAt","invitationId","invitedAt"],"additionalProperties":false},"archived":{"type":"boolean"},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"payBasis":{"type":"string","enum":["hourly","salaried"]},"accrualRatePercent":{"type":["number","null"]},"salariedAllowanceDays":{"type":["number","null"]},"workingWeekdays":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"minutesPerDay":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"breaksPaid":{"type":"boolean"},"hoursFrom":{"type":"string","enum":["bookings","timesheets"]},"inPayroll":{"type":"boolean"},"onTrial":{"type":"boolean"},"emergencyContact":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"relationship":{"type":["string","null"]},"phone":{"type":"string"}},"required":["name","relationship","phone"],"additionalProperties":false},{"type":"null"}]},"bankMasked":{"type":["string","null"]}},"required":["id","name","surname","email","phone","jobTitle","notes","employmentStartDate","employmentEndDate","address","dateOfBirth","niNumberMasked","photoUrl","teamIds","hasLogin","access","archived","customFields","payBasis","accrualRatePercent","salariedAllowanceDays","workingWeekdays","minutesPerDay","breaksPaid","hoursFrom","inPayroll","onTrial","emergencyContact","bankMasked"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/team-members/import":{"post":{"operationId":"teamMembers.import","summary":"Import team members from spreadsheet rows, already matched to fields; dryRun says what would happen","tags":["Team"],"x-permission":"team.manage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"rows":{"minItems":1,"maxItems":2000,"type":"array","items":{"type":"object","properties":{"rowNumber":{"type":"integer","minimum":1,"maximum":9007199254740991},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":5000}}},"required":["rowNumber","values"]}},"onDuplicate":{"default":"skip","type":"string","enum":["skip","update"]},"dryRun":{"default":false,"type":"boolean"}},"required":["rows"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"dryRun":{"type":"boolean"},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rows":{"type":"array","items":{"type":"object","properties":{"rowNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"outcome":{"type":"string","enum":["created","updated","skipped","failed"]},"message":{"type":["string","null"]}},"required":["rowNumber","name","outcome","message"],"additionalProperties":false}}},"required":["dryRun","created","updated","skipped","failed","rows"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/team-members/{id}/access":{"get":{"operationId":"teamMembers.access","summary":"A team member's login and any open invitation","tags":["Team"],"x-permission":"users.view","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"login":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","operative","client"]},"joinedAt":{"type":"string"}},"required":["userId","name","email","role","joinedAt"],"additionalProperties":false},{"type":"null"}]},"invitation":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","operative","client"]},"expiresAt":{"type":"string"}},"required":["id","email","role","expiresAt"],"additionalProperties":false},{"type":"null"}]},"linkable":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","operative","client"]}},"required":["userId","name","email","role"],"additionalProperties":false}}},"required":["login","invitation","linkable"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/team-members/for-login":{"post":{"operationId":"teamMembers.forLogin","summary":"Put an owner or admin on the schedule: a team member record made from their login (name and email) and linked to it. Their role doesn't change, and they are left out of pay runs until someone includes them.","tags":["Team"],"x-permission":"team.manage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["userId"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"surname":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"jobTitle":{"type":["string","null"]},"notes":{"type":["string","null"]},"employmentStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"employmentEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"address":{"type":["string","null"]},"dateOfBirth":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"niNumberMasked":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"teamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"hasLogin":{"type":"boolean"},"access":{"type":"object","properties":{"state":{"type":"string","enum":["login","invited","none"]},"lastSeenAt":{"type":["string","null"]},"invitationId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"invitedAt":{"type":["string","null"]}},"required":["state","lastSeenAt","invitationId","invitedAt"],"additionalProperties":false},"archived":{"type":"boolean"},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"payBasis":{"type":"string","enum":["hourly","salaried"]},"accrualRatePercent":{"type":["number","null"]},"salariedAllowanceDays":{"type":["number","null"]},"workingWeekdays":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"minutesPerDay":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"breaksPaid":{"type":"boolean"},"hoursFrom":{"type":"string","enum":["bookings","timesheets"]},"inPayroll":{"type":"boolean"},"onTrial":{"type":"boolean"},"emergencyContact":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"relationship":{"type":["string","null"]},"phone":{"type":"string"}},"required":["name","relationship","phone"],"additionalProperties":false},{"type":"null"}]},"bankMasked":{"type":["string","null"]}},"required":["id","name","surname","email","phone","jobTitle","notes","employmentStartDate","employmentEndDate","address","dateOfBirth","niNumberMasked","photoUrl","teamIds","hasLogin","access","archived","customFields","payBasis","accrualRatePercent","salariedAllowanceDays","workingWeekdays","minutesPerDay","breaksPaid","hoursFrom","inPayroll","onTrial","emergencyContact","bankMasked"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/team-members/{id}/ni-number":{"get":{"operationId":"teamMembers.revealNiNumber","summary":"A team member's whole NI number (owners and admins; everywhere else it is masked)","tags":["Team"],"x-permission":"team.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"niNumber":{"type":["string","null"]}},"required":["niNumber"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/team-members/{id}/photo":{"post":{"operationId":"teamMembers.setPhoto","summary":"Set a team member's photo: send the image itself (JPEG, PNG, WebP; up to 5 MB). A team member may set their own.","tags":["Team"],"x-permission":["team.manage","team.self"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"photoUrl":{"type":["string","null"]}},"required":["photoUrl"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"get":{"operationId":"teamMembers.photo","summary":"A team member's photo (JPEG)","tags":["Team"],"x-permission":"team.photo","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"teamMembers.removePhoto","summary":"Remove a team member's photo. A team member may remove their own.","tags":["Team"],"x-permission":["team.manage","team.self"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"photoUrl":{"type":["string","null"]}},"required":["photoUrl"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/me/team-member":{"get":{"operationId":"teamMembers.mine","summary":"My own team member record (the app)","tags":["Team"],"x-permission":"team.self","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"surname":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"jobTitle":{"type":["string","null"]},"address":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"teamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}}},"required":["id","name","surname","email","phone","jobTitle","address","photoUrl","teamIds","customFields"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"teamMembers.updateMine","summary":"Change my own contact details: name, phone, address, job title (the app)","tags":["Team"],"x-permission":"team.self","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"surname":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"jobTitle":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"surname":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"jobTitle":{"type":["string","null"]},"address":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"teamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}}},"required":["id","name","surname","email","phone","jobTitle","address","photoUrl","teamIds","customFields"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/jobs":{"get":{"operationId":"jobs.list","summary":"Jobs (one-off and repeating)","tags":["Jobs"],"x-permission":"job.view","parameters":[{"name":"projectId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"teamMemberId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"active","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"replacesJobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"recurrence":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"none"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"unit":{"type":"string","enum":["days","weeks","months","years"]},"every":{"type":"integer","minimum":1,"maximum":366},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","unit","every"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"days_of_week"},"every":{"type":"integer","minimum":1,"maximum":52},"days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":1440},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":10080},{"type":"null"}]}},"required":["day"],"additionalProperties":false}},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","days"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"monthly_date"},"every":{"type":"integer","minimum":1,"maximum":24},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","dayOfMonth"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"monthly_weekday"},"every":{"type":"integer","minimum":1,"maximum":24},"week":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3},{"type":"number","const":4},{"type":"number","const":-1}]},"day":{"type":"integer","minimum":0,"maximum":6},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","week","day"],"additionalProperties":false}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bookedVisits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"prices":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"pricePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"day":{"anyOf":[{"type":"integer","minimum":0,"maximum":6},{"type":"null"}]}},"required":["id","effectiveFrom","pricePence","day"],"additionalProperties":false}},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"checklist":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string"},"instruction":{"type":["string","null"]},"kind":{"type":"string","enum":["tick","text","textarea","number","date","time","checkbox","select","photo"]},"unit":{"type":["string","null"]},"options":{"type":"array","items":{"type":"string"}},"askComment":{"type":"boolean"},"required":{"type":"boolean"},"visibleToClients":{"type":"boolean"}},"required":["id","label","instruction","kind","unit","options","askComment","required","visibleToClients"],"additionalProperties":false}}},"required":["id","clientId","clientName","projectId","projectName","replacesJobId","teamMemberId","name","description","notes","startDate","endDate","recurrence","start","end","breakMinutes","durationMinutes","bookedVisits","prices","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","openToTeamIds","openToTeamMemberIds","checklist"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"jobs.create","summary":"Add a job","tags":["Jobs"],"x-permission":"job.manage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"recurrence":{"default":{"type":"none"},"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"none"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"unit":{"type":"string","enum":["days","weeks","months","years"]},"every":{"type":"integer","minimum":1,"maximum":366},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","unit","every"]},{"type":"object","properties":{"type":{"type":"string","const":"days_of_week"},"every":{"type":"integer","minimum":1,"maximum":52},"days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":1440},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":10080},{"type":"null"}]}},"required":["day"]}},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","const":"monthly_date"},"every":{"type":"integer","minimum":1,"maximum":24},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","dayOfMonth"]},{"type":"object","properties":{"type":{"type":"string","const":"monthly_weekday"},"every":{"type":"integer","minimum":1,"maximum":24},"week":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3},{"type":"number","const":4},{"type":"number","const":-1}]},"day":{"type":"integer","minimum":0,"maximum":6},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","week","day"]}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":1440},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":10080},{"type":"null"}]},"pricePence":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000000},{"type":"null"}]},"dayPrices":{"anyOf":[{"minItems":1,"maxItems":7,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"pricePence":{"type":"integer","minimum":0,"maximum":100000000}},"required":["day","pricePence"]}},{"type":"null"}]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"customFields":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"type":["string","number","boolean","null"]}},"needsClockIn":{"type":["boolean","null"]},"openToTeamIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"checklist":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string","minLength":1,"maxLength":200},"instruction":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"kind":{"default":"tick","type":"string","enum":["tick","text","textarea","number","date","time","checkbox","select","photo"]},"unit":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"options":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"askComment":{"default":false,"type":"boolean"},"required":{"default":false,"type":"boolean"},"visibleToClients":{"default":false,"type":"boolean"}},"required":["label"]}},"fromQuote":{"type":"object","properties":{"quoteId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"lineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["quoteId","lineId"]}},"required":["name","startDate"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"replacesJobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"recurrence":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"none"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"unit":{"type":"string","enum":["days","weeks","months","years"]},"every":{"type":"integer","minimum":1,"maximum":366},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","unit","every"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"days_of_week"},"every":{"type":"integer","minimum":1,"maximum":52},"days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":1440},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":10080},{"type":"null"}]}},"required":["day"],"additionalProperties":false}},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","days"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"monthly_date"},"every":{"type":"integer","minimum":1,"maximum":24},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","dayOfMonth"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"monthly_weekday"},"every":{"type":"integer","minimum":1,"maximum":24},"week":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3},{"type":"number","const":4},{"type":"number","const":-1}]},"day":{"type":"integer","minimum":0,"maximum":6},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","week","day"],"additionalProperties":false}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bookedVisits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"prices":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"pricePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"day":{"anyOf":[{"type":"integer","minimum":0,"maximum":6},{"type":"null"}]}},"required":["id","effectiveFrom","pricePence","day"],"additionalProperties":false}},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"checklist":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string"},"instruction":{"type":["string","null"]},"kind":{"type":"string","enum":["tick","text","textarea","number","date","time","checkbox","select","photo"]},"unit":{"type":["string","null"]},"options":{"type":"array","items":{"type":"string"}},"askComment":{"type":"boolean"},"required":{"type":"boolean"},"visibleToClients":{"type":"boolean"}},"required":["id","label","instruction","kind","unit","options","askComment","required","visibleToClients"],"additionalProperties":false}}},"required":["id","clientId","clientName","projectId","projectName","replacesJobId","teamMemberId","name","description","notes","startDate","endDate","recurrence","start","end","breakMinutes","durationMinutes","bookedVisits","prices","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","openToTeamIds","openToTeamMemberIds","checklist"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/jobs/{id}":{"get":{"operationId":"jobs.get","summary":"One job","tags":["Jobs"],"x-permission":"job.view","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"replacesJobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"recurrence":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"none"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"unit":{"type":"string","enum":["days","weeks","months","years"]},"every":{"type":"integer","minimum":1,"maximum":366},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","unit","every"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"days_of_week"},"every":{"type":"integer","minimum":1,"maximum":52},"days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":1440},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":10080},{"type":"null"}]}},"required":["day"],"additionalProperties":false}},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","days"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"monthly_date"},"every":{"type":"integer","minimum":1,"maximum":24},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","dayOfMonth"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"monthly_weekday"},"every":{"type":"integer","minimum":1,"maximum":24},"week":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3},{"type":"number","const":4},{"type":"number","const":-1}]},"day":{"type":"integer","minimum":0,"maximum":6},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","week","day"],"additionalProperties":false}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bookedVisits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"prices":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"pricePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"day":{"anyOf":[{"type":"integer","minimum":0,"maximum":6},{"type":"null"}]}},"required":["id","effectiveFrom","pricePence","day"],"additionalProperties":false}},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"checklist":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string"},"instruction":{"type":["string","null"]},"kind":{"type":"string","enum":["tick","text","textarea","number","date","time","checkbox","select","photo"]},"unit":{"type":["string","null"]},"options":{"type":"array","items":{"type":"string"}},"askComment":{"type":"boolean"},"required":{"type":"boolean"},"visibleToClients":{"type":"boolean"}},"required":["id","label","instruction","kind","unit","options","askComment","required","visibleToClients"],"additionalProperties":false}}},"required":["id","clientId","clientName","projectId","projectName","replacesJobId","teamMemberId","name","description","notes","startDate","endDate","recurrence","start","end","breakMinutes","durationMinutes","bookedVisits","prices","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","openToTeamIds","openToTeamMemberIds","checklist"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"jobs.update","summary":"Change a job. Its pattern and start date are fixed once a visit is booked; use change to change it from a date.","tags":["Jobs"],"x-permission":"job.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"recurrence":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"none"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"unit":{"type":"string","enum":["days","weeks","months","years"]},"every":{"type":"integer","minimum":1,"maximum":366},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","unit","every"]},{"type":"object","properties":{"type":{"type":"string","const":"days_of_week"},"every":{"type":"integer","minimum":1,"maximum":52},"days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":1440},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":10080},{"type":"null"}]}},"required":["day"]}},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","const":"monthly_date"},"every":{"type":"integer","minimum":1,"maximum":24},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","dayOfMonth"]},{"type":"object","properties":{"type":{"type":"string","const":"monthly_weekday"},"every":{"type":"integer","minimum":1,"maximum":24},"week":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3},{"type":"number","const":4},{"type":"number","const":-1}]},"day":{"type":"integer","minimum":0,"maximum":6},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","week","day"]}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":1440},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":10080},{"type":"null"}]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"customFields":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"type":["string","number","boolean","null"]}},"needsClockIn":{"type":["boolean","null"]},"openToTeamIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"checklist":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string","minLength":1,"maxLength":200},"instruction":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"kind":{"default":"tick","type":"string","enum":["tick","text","textarea","number","date","time","checkbox","select","photo"]},"unit":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"options":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"askComment":{"default":false,"type":"boolean"},"required":{"default":false,"type":"boolean"},"visibleToClients":{"default":false,"type":"boolean"}},"required":["label"]}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"replacesJobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"recurrence":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"none"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"unit":{"type":"string","enum":["days","weeks","months","years"]},"every":{"type":"integer","minimum":1,"maximum":366},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","unit","every"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"days_of_week"},"every":{"type":"integer","minimum":1,"maximum":52},"days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":1440},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":10080},{"type":"null"}]}},"required":["day"],"additionalProperties":false}},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","days"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"monthly_date"},"every":{"type":"integer","minimum":1,"maximum":24},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","dayOfMonth"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"monthly_weekday"},"every":{"type":"integer","minimum":1,"maximum":24},"week":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3},{"type":"number","const":4},{"type":"number","const":-1}]},"day":{"type":"integer","minimum":0,"maximum":6},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","week","day"],"additionalProperties":false}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bookedVisits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"prices":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"pricePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"day":{"anyOf":[{"type":"integer","minimum":0,"maximum":6},{"type":"null"}]}},"required":["id","effectiveFrom","pricePence","day"],"additionalProperties":false}},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"checklist":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string"},"instruction":{"type":["string","null"]},"kind":{"type":"string","enum":["tick","text","textarea","number","date","time","checkbox","select","photo"]},"unit":{"type":["string","null"]},"options":{"type":"array","items":{"type":"string"}},"askComment":{"type":"boolean"},"required":{"type":"boolean"},"visibleToClients":{"type":"boolean"}},"required":["id","label","instruction","kind","unit","options","askComment","required","visibleToClients"],"additionalProperties":false}}},"required":["id","clientId","clientName","projectId","projectName","replacesJobId","teamMemberId","name","description","notes","startDate","endDate","recurrence","start","end","breakMinutes","durationMinutes","bookedVisits","prices","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","openToTeamIds","openToTeamMemberIds","checklist"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/jobs/{id}/prices":{"post":{"operationId":"jobs.addPrice","summary":"Set a price from a date","tags":["Jobs"],"x-permission":"price.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"pricePence":{"type":"integer","minimum":0,"maximum":100000000},"dayPrices":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"pricePence":{"type":"integer","minimum":0,"maximum":100000000}},"required":["day","pricePence"]}}},"required":["effectiveFrom"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"pricePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"day":{"anyOf":[{"type":"integer","minimum":0,"maximum":6},{"type":"null"}]}},"required":["id","effectiveFrom","pricePence","day"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/jobs/{id}/reprice":{"post":{"operationId":"jobs.reprice","summary":"Bring its finished visits from a date, not yet invoiced, in line with its price list (or a proposed price). apply false: just say what would change.","tags":["Jobs"],"x-permission":"price.unlock","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"apply":{"default":false,"type":"boolean"},"proposed":{"type":"object","properties":{"pricePence":{"type":"integer","minimum":0,"maximum":100000000},"dayPrices":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"pricePence":{"type":"integer","minimum":0,"maximum":100000000}},"required":["day","pricePence"]}}}}},"required":["from"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"changes":{"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"fromPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"toPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["bookingId","date","fromPence","toPence"],"additionalProperties":false}},"skippedInvoiced":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skippedOwnPrice":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"beforePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"afterPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"applied":{"type":"boolean"}},"required":["changes","skippedInvoiced","skippedOwnPrice","beforePence","afterPence","applied"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/jobs/{id}/prices/{priceId}":{"delete":{"operationId":"jobs.removePrice","summary":"Remove a price from the list","tags":["Jobs"],"x-permission":"price.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"priceId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"pricePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"day":{"anyOf":[{"type":"integer","minimum":0,"maximum":6},{"type":"null"}]}},"required":["id","effectiveFrom","pricePence","day"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/jobs/{id}/change/preview":{"post":{"operationId":"jobs.previewChange","summary":"What changing a repeat booking from a date would remove, keep and book. Changes nothing.","tags":["Jobs"],"x-permission":"job.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"recurrence":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"none"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"unit":{"type":"string","enum":["days","weeks","months","years"]},"every":{"type":"integer","minimum":1,"maximum":366},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","unit","every"]},{"type":"object","properties":{"type":{"type":"string","const":"days_of_week"},"every":{"type":"integer","minimum":1,"maximum":52},"days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":1440},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":10080},{"type":"null"}]}},"required":["day"]}},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","const":"monthly_date"},"every":{"type":"integer","minimum":1,"maximum":24},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","dayOfMonth"]},{"type":"object","properties":{"type":{"type":"string","const":"monthly_weekday"},"every":{"type":"integer","minimum":1,"maximum":24},"week":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3},{"type":"number","const":4},{"type":"number","const":-1}]},"day":{"type":"integer","minimum":0,"maximum":6},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","week","day"]}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":1440},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":10080},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"pricePence":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000000},{"type":"null"}]},"dayPrices":{"anyOf":[{"minItems":1,"maxItems":7,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"pricePence":{"type":"integer","minimum":0,"maximum":100000000}},"required":["day","pricePence"]}},{"type":"null"}]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"customFields":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"type":["string","number","boolean","null"]}},"openToTeamIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"rebook":{"default":true,"type":"boolean"},"repriceFinished":{"default":false,"type":"boolean"}},"required":["effectiveFrom"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"oldJobEndsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"inPlace":{"type":"boolean"},"job":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"replacesJobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"recurrence":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"none"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"unit":{"type":"string","enum":["days","weeks","months","years"]},"every":{"type":"integer","minimum":1,"maximum":366},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","unit","every"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"days_of_week"},"every":{"type":"integer","minimum":1,"maximum":52},"days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":1440},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":10080},{"type":"null"}]}},"required":["day"],"additionalProperties":false}},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","days"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"monthly_date"},"every":{"type":"integer","minimum":1,"maximum":24},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","dayOfMonth"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"monthly_weekday"},"every":{"type":"integer","minimum":1,"maximum":24},"week":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3},{"type":"number","const":4},{"type":"number","const":-1}]},"day":{"type":"integer","minimum":0,"maximum":6},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","week","day"],"additionalProperties":false}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bookedVisits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"prices":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"pricePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"day":{"anyOf":[{"type":"integer","minimum":0,"maximum":6},{"type":"null"}]}},"required":["id","effectiveFrom","pricePence","day"],"additionalProperties":false}},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"checklist":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string"},"instruction":{"type":["string","null"]},"kind":{"type":"string","enum":["tick","text","textarea","number","date","time","checkbox","select","photo"]},"unit":{"type":["string","null"]},"options":{"type":"array","items":{"type":"string"}},"askComment":{"type":"boolean"},"required":{"type":"boolean"},"visibleToClients":{"type":"boolean"}},"required":["id","label","instruction","kind","unit","options","askComment","required","visibleToClients"],"additionalProperties":false}}},"required":["id","clientId","clientName","projectId","projectName","replacesJobId","teamMemberId","name","description","notes","startDate","endDate","recurrence","start","end","breakMinutes","durationMinutes","bookedVisits","prices","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","openToTeamIds","openToTeamMemberIds","checklist"],"additionalProperties":false},{"type":"null"}]},"removed":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"startsAt":{"type":["string","null"]},"endsAt":{"type":["string","null"]},"overnight":{"type":"boolean"},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"jobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"visitNumber":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberName":{"type":["string","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openNotifyAt":{"type":["string","null"]},"price":{"anyOf":[{"type":"object","properties":{"pence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"source":{"type":"string","enum":["locked","override","list","none"]},"lockedAt":{"type":["string","null"]},"lockReason":{"anyOf":[{"type":"string","enum":["completed","signed_off","invoiced"]},{"type":"null"}]},"invoiceRef":{"type":["string","null"]}},"required":["pence","source","lockedAt","lockReason"],"additionalProperties":false},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"clockInRequired":{"type":"boolean"},"clockInMissed":{"type":"boolean"},"clockedInAt":{"type":["string","null"]},"clockedOutAt":{"type":["string","null"]},"clockInLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockOutLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockInDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockOutDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockInSetByName":{"type":["string","null"]},"clockOutSetByName":{"type":["string","null"]},"checklist":{"anyOf":[{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mustDoLeft":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total","mustDoLeft"],"additionalProperties":false},{"type":"null"}]}},"required":["id","status","date","start","end","startsAt","endsAt","overnight","breakMinutes","durationMinutes","name","description","notes","clientId","clientName","projectId","projectName","jobId","visitNumber","teamMemberId","teamMemberName","openToTeamIds","openToTeamMemberIds","openNotifyAt","price","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","clockInRequired","clockInMissed","clockedInAt","clockedOutAt","clockInLocation","clockOutLocation","clockInDevice","clockOutDevice","clockInSetByName","clockOutSetByName","checklist"],"additionalProperties":false}},"kept":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"startsAt":{"type":["string","null"]},"endsAt":{"type":["string","null"]},"overnight":{"type":"boolean"},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"jobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"visitNumber":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberName":{"type":["string","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openNotifyAt":{"type":["string","null"]},"price":{"anyOf":[{"type":"object","properties":{"pence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"source":{"type":"string","enum":["locked","override","list","none"]},"lockedAt":{"type":["string","null"]},"lockReason":{"anyOf":[{"type":"string","enum":["completed","signed_off","invoiced"]},{"type":"null"}]},"invoiceRef":{"type":["string","null"]}},"required":["pence","source","lockedAt","lockReason"],"additionalProperties":false},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"clockInRequired":{"type":"boolean"},"clockInMissed":{"type":"boolean"},"clockedInAt":{"type":["string","null"]},"clockedOutAt":{"type":["string","null"]},"clockInLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockOutLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockInDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockOutDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockInSetByName":{"type":["string","null"]},"clockOutSetByName":{"type":["string","null"]},"checklist":{"anyOf":[{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mustDoLeft":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total","mustDoLeft"],"additionalProperties":false},{"type":"null"}]},"keptBecause":{"type":"string","enum":["complete","signed_off","failed","price_locked"]}},"required":["id","status","date","start","end","startsAt","endsAt","overnight","breakMinutes","durationMinutes","name","description","notes","clientId","clientName","projectId","projectName","jobId","visitNumber","teamMemberId","teamMemberName","openToTeamIds","openToTeamMemberIds","openNotifyAt","price","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","clockInRequired","clockInMissed","clockedInAt","clockedOutAt","clockInLocation","clockOutLocation","clockInDevice","clockOutDevice","clockInSetByName","clockOutSetByName","checklist","keptBecause"],"additionalProperties":false}},"booked":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"overnight":{"type":"boolean"},"past":{"type":"boolean"}},"required":["date","start","end","overnight","past"],"additionalProperties":false}},"backdated":{"type":"boolean"},"priceOnly":{"type":"boolean"},"following":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"finished":{"anyOf":[{"type":"object","properties":{"changes":{"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"fromPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"toPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["bookingId","date","fromPence","toPence"],"additionalProperties":false}},"skippedInvoiced":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skippedOwnPrice":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"beforePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"afterPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"applied":{"type":"boolean"}},"required":["changes","skippedInvoiced","skippedOwnPrice","beforePence","afterPence","applied"],"additionalProperties":false},{"type":"null"}]}},"required":["effectiveFrom","oldJobEndsOn","inPlace","job","removed","kept","booked","backdated","priceOnly","following","finished"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/jobs/{id}/change":{"post":{"operationId":"jobs.change","summary":"Change a repeat booking from a date: end it the day before, remove its unfinished bookings from the date, and start the new version","tags":["Jobs"],"x-permission":"job.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"recurrence":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"none"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"unit":{"type":"string","enum":["days","weeks","months","years"]},"every":{"type":"integer","minimum":1,"maximum":366},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","unit","every"]},{"type":"object","properties":{"type":{"type":"string","const":"days_of_week"},"every":{"type":"integer","minimum":1,"maximum":52},"days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":1440},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":10080},{"type":"null"}]}},"required":["day"]}},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","const":"monthly_date"},"every":{"type":"integer","minimum":1,"maximum":24},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","dayOfMonth"]},{"type":"object","properties":{"type":{"type":"string","const":"monthly_weekday"},"every":{"type":"integer","minimum":1,"maximum":24},"week":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3},{"type":"number","const":4},{"type":"number","const":-1}]},"day":{"type":"integer","minimum":0,"maximum":6},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","week","day"]}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":1440},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":10080},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"pricePence":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000000},{"type":"null"}]},"dayPrices":{"anyOf":[{"minItems":1,"maxItems":7,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"pricePence":{"type":"integer","minimum":0,"maximum":100000000}},"required":["day","pricePence"]}},{"type":"null"}]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"customFields":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"type":["string","number","boolean","null"]}},"openToTeamIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"rebook":{"default":true,"type":"boolean"},"repriceFinished":{"default":false,"type":"boolean"}},"required":["effectiveFrom"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"oldJobEndsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"inPlace":{"type":"boolean"},"job":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"replacesJobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"recurrence":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"none"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"interval"},"unit":{"type":"string","enum":["days","weeks","months","years"]},"every":{"type":"integer","minimum":1,"maximum":366},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","unit","every"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"days_of_week"},"every":{"type":"integer","minimum":1,"maximum":52},"days":{"minItems":1,"maxItems":7,"type":"array","items":{"type":"object","properties":{"day":{"type":"integer","minimum":0,"maximum":6},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":1440},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":10080},{"type":"null"}]}},"required":["day"],"additionalProperties":false}},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","days"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"monthly_date"},"every":{"type":"integer","minimum":1,"maximum":24},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","dayOfMonth"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"monthly_weekday"},"every":{"type":"integer","minimum":1,"maximum":24},"week":{"anyOf":[{"type":"number","const":1},{"type":"number","const":2},{"type":"number","const":3},{"type":"number","const":4},{"type":"number","const":-1}]},"day":{"type":"integer","minimum":0,"maximum":6},"count":{"type":"integer","minimum":1,"maximum":5000}},"required":["type","week","day"],"additionalProperties":false}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bookedVisits":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"prices":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"pricePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"day":{"anyOf":[{"type":"integer","minimum":0,"maximum":6},{"type":"null"}]}},"required":["id","effectiveFrom","pricePence","day"],"additionalProperties":false}},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"checklist":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string"},"instruction":{"type":["string","null"]},"kind":{"type":"string","enum":["tick","text","textarea","number","date","time","checkbox","select","photo"]},"unit":{"type":["string","null"]},"options":{"type":"array","items":{"type":"string"}},"askComment":{"type":"boolean"},"required":{"type":"boolean"},"visibleToClients":{"type":"boolean"}},"required":["id","label","instruction","kind","unit","options","askComment","required","visibleToClients"],"additionalProperties":false}}},"required":["id","clientId","clientName","projectId","projectName","replacesJobId","teamMemberId","name","description","notes","startDate","endDate","recurrence","start","end","breakMinutes","durationMinutes","bookedVisits","prices","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","openToTeamIds","openToTeamMemberIds","checklist"],"additionalProperties":false},{"type":"null"}]},"removed":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"startsAt":{"type":["string","null"]},"endsAt":{"type":["string","null"]},"overnight":{"type":"boolean"},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"jobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"visitNumber":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberName":{"type":["string","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openNotifyAt":{"type":["string","null"]},"price":{"anyOf":[{"type":"object","properties":{"pence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"source":{"type":"string","enum":["locked","override","list","none"]},"lockedAt":{"type":["string","null"]},"lockReason":{"anyOf":[{"type":"string","enum":["completed","signed_off","invoiced"]},{"type":"null"}]},"invoiceRef":{"type":["string","null"]}},"required":["pence","source","lockedAt","lockReason"],"additionalProperties":false},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"clockInRequired":{"type":"boolean"},"clockInMissed":{"type":"boolean"},"clockedInAt":{"type":["string","null"]},"clockedOutAt":{"type":["string","null"]},"clockInLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockOutLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockInDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockOutDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockInSetByName":{"type":["string","null"]},"clockOutSetByName":{"type":["string","null"]},"checklist":{"anyOf":[{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mustDoLeft":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total","mustDoLeft"],"additionalProperties":false},{"type":"null"}]}},"required":["id","status","date","start","end","startsAt","endsAt","overnight","breakMinutes","durationMinutes","name","description","notes","clientId","clientName","projectId","projectName","jobId","visitNumber","teamMemberId","teamMemberName","openToTeamIds","openToTeamMemberIds","openNotifyAt","price","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","clockInRequired","clockInMissed","clockedInAt","clockedOutAt","clockInLocation","clockOutLocation","clockInDevice","clockOutDevice","clockInSetByName","clockOutSetByName","checklist"],"additionalProperties":false}},"kept":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"startsAt":{"type":["string","null"]},"endsAt":{"type":["string","null"]},"overnight":{"type":"boolean"},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"jobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"visitNumber":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberName":{"type":["string","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openNotifyAt":{"type":["string","null"]},"price":{"anyOf":[{"type":"object","properties":{"pence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"source":{"type":"string","enum":["locked","override","list","none"]},"lockedAt":{"type":["string","null"]},"lockReason":{"anyOf":[{"type":"string","enum":["completed","signed_off","invoiced"]},{"type":"null"}]},"invoiceRef":{"type":["string","null"]}},"required":["pence","source","lockedAt","lockReason"],"additionalProperties":false},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"clockInRequired":{"type":"boolean"},"clockInMissed":{"type":"boolean"},"clockedInAt":{"type":["string","null"]},"clockedOutAt":{"type":["string","null"]},"clockInLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockOutLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockInDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockOutDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockInSetByName":{"type":["string","null"]},"clockOutSetByName":{"type":["string","null"]},"checklist":{"anyOf":[{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mustDoLeft":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total","mustDoLeft"],"additionalProperties":false},{"type":"null"}]},"keptBecause":{"type":"string","enum":["complete","signed_off","failed","price_locked"]}},"required":["id","status","date","start","end","startsAt","endsAt","overnight","breakMinutes","durationMinutes","name","description","notes","clientId","clientName","projectId","projectName","jobId","visitNumber","teamMemberId","teamMemberName","openToTeamIds","openToTeamMemberIds","openNotifyAt","price","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","clockInRequired","clockInMissed","clockedInAt","clockedOutAt","clockInLocation","clockOutLocation","clockInDevice","clockOutDevice","clockInSetByName","clockOutSetByName","checklist","keptBecause"],"additionalProperties":false}},"booked":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"overnight":{"type":"boolean"},"past":{"type":"boolean"}},"required":["date","start","end","overnight","past"],"additionalProperties":false}},"backdated":{"type":"boolean"},"priceOnly":{"type":"boolean"},"following":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"finished":{"anyOf":[{"type":"object","properties":{"changes":{"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"fromPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"toPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["bookingId","date","fromPence","toPence"],"additionalProperties":false}},"skippedInvoiced":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skippedOwnPrice":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"beforePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"afterPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"applied":{"type":"boolean"}},"required":["changes","skippedInvoiced","skippedOwnPrice","beforePence","afterPence","applied"],"additionalProperties":false},{"type":"null"}]}},"required":["effectiveFrom","oldJobEndsOn","inPlace","job","removed","kept","booked","backdated","priceOnly","following","finished"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/jobs/{id}/visits/book":{"post":{"operationId":"jobs.bookVisits","summary":"Book planned visits by number","tags":["Jobs"],"x-permission":"booking.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"numbers":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"integer","minimum":1,"maximum":9007199254740991}}},"required":["numbers"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"startsAt":{"type":["string","null"]},"endsAt":{"type":["string","null"]},"overnight":{"type":"boolean"},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"jobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"visitNumber":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberName":{"type":["string","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openNotifyAt":{"type":["string","null"]},"price":{"anyOf":[{"type":"object","properties":{"pence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"source":{"type":"string","enum":["locked","override","list","none"]},"lockedAt":{"type":["string","null"]},"lockReason":{"anyOf":[{"type":"string","enum":["completed","signed_off","invoiced"]},{"type":"null"}]},"invoiceRef":{"type":["string","null"]}},"required":["pence","source","lockedAt","lockReason"],"additionalProperties":false},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"clockInRequired":{"type":"boolean"},"clockInMissed":{"type":"boolean"},"clockedInAt":{"type":["string","null"]},"clockedOutAt":{"type":["string","null"]},"clockInLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockOutLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockInDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockOutDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockInSetByName":{"type":["string","null"]},"clockOutSetByName":{"type":["string","null"]},"checklist":{"anyOf":[{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mustDoLeft":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total","mustDoLeft"],"additionalProperties":false},{"type":"null"}]}},"required":["id","status","date","start","end","startsAt","endsAt","overnight","breakMinutes","durationMinutes","name","description","notes","clientId","clientName","projectId","projectName","jobId","visitNumber","teamMemberId","teamMemberName","openToTeamIds","openToTeamMemberIds","openNotifyAt","price","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","clockInRequired","clockInMissed","clockedInAt","clockedOutAt","clockInLocation","clockOutLocation","clockInDevice","clockOutDevice","clockInSetByName","clockOutSetByName","checklist"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/jobs/{id}/visits/skip":{"post":{"operationId":"jobs.skipVisits","summary":"Take planned visits out of a repeat booking so they no longer show (missed visits)","tags":["Jobs"],"x-permission":"booking.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"numbers":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"integer","minimum":1,"maximum":9007199254740991}}},"required":["numbers"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/bookings":{"get":{"operationId":"bookings.list","summary":"Bookings the caller may see","tags":["Bookings"],"x-permission":["booking.viewAll","booking.viewOwn","booking.viewClient"],"parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"teamMemberId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]}},{"name":"jobId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"clientLevel","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"startsAt":{"type":["string","null"]},"endsAt":{"type":["string","null"]},"overnight":{"type":"boolean"},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"jobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"visitNumber":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberName":{"type":["string","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openNotifyAt":{"type":["string","null"]},"price":{"anyOf":[{"type":"object","properties":{"pence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"source":{"type":"string","enum":["locked","override","list","none"]},"lockedAt":{"type":["string","null"]},"lockReason":{"anyOf":[{"type":"string","enum":["completed","signed_off","invoiced"]},{"type":"null"}]},"invoiceRef":{"type":["string","null"]}},"required":["pence","source","lockedAt","lockReason"],"additionalProperties":false},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"clockInRequired":{"type":"boolean"},"clockInMissed":{"type":"boolean"},"clockedInAt":{"type":["string","null"]},"clockedOutAt":{"type":["string","null"]},"clockInLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockOutLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockInDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockOutDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockInSetByName":{"type":["string","null"]},"clockOutSetByName":{"type":["string","null"]},"checklist":{"anyOf":[{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mustDoLeft":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total","mustDoLeft"],"additionalProperties":false},{"type":"null"}]}},"required":["id","status","date","start","end","startsAt","endsAt","overnight","breakMinutes","durationMinutes","name","description","notes","clientId","clientName","projectId","projectName","jobId","visitNumber","teamMemberId","teamMemberName","openToTeamIds","openToTeamMemberIds","openNotifyAt","price","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","clockInRequired","clockInMissed","clockedInAt","clockedOutAt","clockInLocation","clockOutLocation","clockInDevice","clockOutDevice","clockInSetByName","clockOutSetByName","checklist"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"bookings.create","summary":"Add a booking not made from a job","tags":["Bookings"],"x-permission":"booking.manage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":1440},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":10080},{"type":"null"}]},"openToTeamIds":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"priceOverridePence":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000000},{"type":"null"}]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"customFields":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"type":["string","number","boolean","null"]}},"needsClockIn":{"type":["boolean","null"]},"checklist":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string","minLength":1,"maxLength":200},"instruction":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"kind":{"default":"tick","type":"string","enum":["tick","text","textarea","number","date","time","checkbox","select","photo"]},"unit":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"options":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"askComment":{"default":false,"type":"boolean"},"required":{"default":false,"type":"boolean"},"visibleToClients":{"default":false,"type":"boolean"}},"required":["label"]}},"status":{"default":"active","type":"string","enum":["draft","open","active"]},"fromQuote":{"type":"object","properties":{"quoteId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"lineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["quoteId","lineId"]},"forDeal":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"startsAt":{"type":["string","null"]},"endsAt":{"type":["string","null"]},"overnight":{"type":"boolean"},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"jobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"visitNumber":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberName":{"type":["string","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openNotifyAt":{"type":["string","null"]},"price":{"anyOf":[{"type":"object","properties":{"pence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"source":{"type":"string","enum":["locked","override","list","none"]},"lockedAt":{"type":["string","null"]},"lockReason":{"anyOf":[{"type":"string","enum":["completed","signed_off","invoiced"]},{"type":"null"}]},"invoiceRef":{"type":["string","null"]}},"required":["pence","source","lockedAt","lockReason"],"additionalProperties":false},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"clockInRequired":{"type":"boolean"},"clockInMissed":{"type":"boolean"},"clockedInAt":{"type":["string","null"]},"clockedOutAt":{"type":["string","null"]},"clockInLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockOutLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockInDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockOutDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockInSetByName":{"type":["string","null"]},"clockOutSetByName":{"type":["string","null"]},"checklist":{"anyOf":[{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mustDoLeft":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total","mustDoLeft"],"additionalProperties":false},{"type":"null"}]}},"required":["id","status","date","start","end","startsAt","endsAt","overnight","breakMinutes","durationMinutes","name","description","notes","clientId","clientName","projectId","projectName","jobId","visitNumber","teamMemberId","teamMemberName","openToTeamIds","openToTeamMemberIds","openNotifyAt","price","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","clockInRequired","clockInMissed","clockedInAt","clockedOutAt","clockInLocation","clockOutLocation","clockInDevice","clockOutDevice","clockInSetByName","clockOutSetByName","checklist"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/bookings/{id}":{"get":{"operationId":"bookings.get","summary":"One booking","tags":["Bookings"],"x-permission":["booking.viewAll","booking.viewOwn","booking.viewClient"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"startsAt":{"type":["string","null"]},"endsAt":{"type":["string","null"]},"overnight":{"type":"boolean"},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"jobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"visitNumber":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberName":{"type":["string","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openNotifyAt":{"type":["string","null"]},"price":{"anyOf":[{"type":"object","properties":{"pence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"source":{"type":"string","enum":["locked","override","list","none"]},"lockedAt":{"type":["string","null"]},"lockReason":{"anyOf":[{"type":"string","enum":["completed","signed_off","invoiced"]},{"type":"null"}]},"invoiceRef":{"type":["string","null"]}},"required":["pence","source","lockedAt","lockReason"],"additionalProperties":false},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"clockInRequired":{"type":"boolean"},"clockInMissed":{"type":"boolean"},"clockedInAt":{"type":["string","null"]},"clockedOutAt":{"type":["string","null"]},"clockInLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockOutLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockInDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockOutDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockInSetByName":{"type":["string","null"]},"clockOutSetByName":{"type":["string","null"]},"checklist":{"anyOf":[{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mustDoLeft":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total","mustDoLeft"],"additionalProperties":false},{"type":"null"}]}},"required":["id","status","date","start","end","startsAt","endsAt","overnight","breakMinutes","durationMinutes","name","description","notes","clientId","clientName","projectId","projectName","jobId","visitNumber","teamMemberId","teamMemberName","openToTeamIds","openToTeamMemberIds","openNotifyAt","price","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","clockInRequired","clockInMissed","clockedInAt","clockedOutAt","clockInLocation","clockOutLocation","clockInDevice","clockOutDevice","clockInSetByName","clockOutSetByName","checklist"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"bookings.update","summary":"Change a booking","tags":["Bookings"],"x-permission":"booking.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"breakMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":1440},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":10080},{"type":"null"}]},"openToTeamIds":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"priceOverridePence":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000000},{"type":"null"}]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"customFields":{"type":"object","propertyNames":{"type":"string","maxLength":60},"additionalProperties":{"type":["string","number","boolean","null"]}},"needsClockIn":{"type":["boolean","null"]},"checklist":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string","minLength":1,"maxLength":200},"instruction":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"kind":{"default":"tick","type":"string","enum":["tick","text","textarea","number","date","time","checkbox","select","photo"]},"unit":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"options":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"askComment":{"default":false,"type":"boolean"},"required":{"default":false,"type":"boolean"},"visibleToClients":{"default":false,"type":"boolean"}},"required":["label"]}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"startsAt":{"type":["string","null"]},"endsAt":{"type":["string","null"]},"overnight":{"type":"boolean"},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"jobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"visitNumber":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberName":{"type":["string","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openNotifyAt":{"type":["string","null"]},"price":{"anyOf":[{"type":"object","properties":{"pence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"source":{"type":"string","enum":["locked","override","list","none"]},"lockedAt":{"type":["string","null"]},"lockReason":{"anyOf":[{"type":"string","enum":["completed","signed_off","invoiced"]},{"type":"null"}]},"invoiceRef":{"type":["string","null"]}},"required":["pence","source","lockedAt","lockReason"],"additionalProperties":false},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"clockInRequired":{"type":"boolean"},"clockInMissed":{"type":"boolean"},"clockedInAt":{"type":["string","null"]},"clockedOutAt":{"type":["string","null"]},"clockInLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockOutLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockInDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockOutDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockInSetByName":{"type":["string","null"]},"clockOutSetByName":{"type":["string","null"]},"checklist":{"anyOf":[{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mustDoLeft":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total","mustDoLeft"],"additionalProperties":false},{"type":"null"}]}},"required":["id","status","date","start","end","startsAt","endsAt","overnight","breakMinutes","durationMinutes","name","description","notes","clientId","clientName","projectId","projectName","jobId","visitNumber","teamMemberId","teamMemberName","openToTeamIds","openToTeamMemberIds","openNotifyAt","price","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","clockInRequired","clockInMissed","clockedInAt","clockedOutAt","clockInLocation","clockOutLocation","clockInDevice","clockOutDevice","clockInSetByName","clockOutSetByName","checklist"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"bookings.remove","summary":"Delete a booking whose price is not locked","tags":["Bookings"],"x-permission":"booking.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/bookings/{id}/status":{"post":{"operationId":"bookings.setStatus","summary":"Move a booking to a new status. Complete and signed off lock its price.","tags":["Bookings"],"x-permission":["booking.manage","booking.updateOwnStatus"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]},"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"completeAnyway":{"type":"boolean"}},"required":["status"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"startsAt":{"type":["string","null"]},"endsAt":{"type":["string","null"]},"overnight":{"type":"boolean"},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"jobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"visitNumber":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberName":{"type":["string","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openNotifyAt":{"type":["string","null"]},"price":{"anyOf":[{"type":"object","properties":{"pence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"source":{"type":"string","enum":["locked","override","list","none"]},"lockedAt":{"type":["string","null"]},"lockReason":{"anyOf":[{"type":"string","enum":["completed","signed_off","invoiced"]},{"type":"null"}]},"invoiceRef":{"type":["string","null"]}},"required":["pence","source","lockedAt","lockReason"],"additionalProperties":false},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"clockInRequired":{"type":"boolean"},"clockInMissed":{"type":"boolean"},"clockedInAt":{"type":["string","null"]},"clockedOutAt":{"type":["string","null"]},"clockInLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockOutLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockInDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockOutDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockInSetByName":{"type":["string","null"]},"clockOutSetByName":{"type":["string","null"]},"checklist":{"anyOf":[{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mustDoLeft":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total","mustDoLeft"],"additionalProperties":false},{"type":"null"}]}},"required":["id","status","date","start","end","startsAt","endsAt","overnight","breakMinutes","durationMinutes","name","description","notes","clientId","clientName","projectId","projectName","jobId","visitNumber","teamMemberId","teamMemberName","openToTeamIds","openToTeamMemberIds","openNotifyAt","price","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","clockInRequired","clockInMissed","clockedInAt","clockedOutAt","clockInLocation","clockOutLocation","clockInDevice","clockOutDevice","clockInSetByName","clockOutSetByName","checklist"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/bookings/{id}/clock":{"post":{"operationId":"bookings.setClock","summary":"Set, correct or clear a booking's clock-in and clock-out times, with a reason kept in its history (as Xota). Setting a clock-out on an active booking that needs a clock in completes it.","tags":["Bookings"],"x-permission":"booking.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"clockedInAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"clockedOutAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["clockedInAt","clockedOutAt","reason"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"startsAt":{"type":["string","null"]},"endsAt":{"type":["string","null"]},"overnight":{"type":"boolean"},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"jobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"visitNumber":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberName":{"type":["string","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openNotifyAt":{"type":["string","null"]},"price":{"anyOf":[{"type":"object","properties":{"pence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"source":{"type":"string","enum":["locked","override","list","none"]},"lockedAt":{"type":["string","null"]},"lockReason":{"anyOf":[{"type":"string","enum":["completed","signed_off","invoiced"]},{"type":"null"}]},"invoiceRef":{"type":["string","null"]}},"required":["pence","source","lockedAt","lockReason"],"additionalProperties":false},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"clockInRequired":{"type":"boolean"},"clockInMissed":{"type":"boolean"},"clockedInAt":{"type":["string","null"]},"clockedOutAt":{"type":["string","null"]},"clockInLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockOutLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockInDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockOutDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockInSetByName":{"type":["string","null"]},"clockOutSetByName":{"type":["string","null"]},"checklist":{"anyOf":[{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mustDoLeft":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total","mustDoLeft"],"additionalProperties":false},{"type":"null"}]}},"required":["id","status","date","start","end","startsAt","endsAt","overnight","breakMinutes","durationMinutes","name","description","notes","clientId","clientName","projectId","projectName","jobId","visitNumber","teamMemberId","teamMemberName","openToTeamIds","openToTeamMemberIds","openNotifyAt","price","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","clockInRequired","clockInMissed","clockedInAt","clockedOutAt","clockInLocation","clockOutLocation","clockInDevice","clockOutDevice","clockInSetByName","clockOutSetByName","checklist"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/bookings/{id}/price":{"post":{"operationId":"bookings.setPrice","summary":"Change a booking's price (null: its repeat booking's price list). A finished one stays locked at the new price; an invoiced one can't change.","tags":["Bookings"],"x-permission":"price.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"pricePence":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000000},{"type":"null"}]}},"required":["pricePence"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"startsAt":{"type":["string","null"]},"endsAt":{"type":["string","null"]},"overnight":{"type":"boolean"},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"jobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"visitNumber":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberName":{"type":["string","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openNotifyAt":{"type":["string","null"]},"price":{"anyOf":[{"type":"object","properties":{"pence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"source":{"type":"string","enum":["locked","override","list","none"]},"lockedAt":{"type":["string","null"]},"lockReason":{"anyOf":[{"type":"string","enum":["completed","signed_off","invoiced"]},{"type":"null"}]},"invoiceRef":{"type":["string","null"]}},"required":["pence","source","lockedAt","lockReason"],"additionalProperties":false},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"clockInRequired":{"type":"boolean"},"clockInMissed":{"type":"boolean"},"clockedInAt":{"type":["string","null"]},"clockedOutAt":{"type":["string","null"]},"clockInLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockOutLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockInDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockOutDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockInSetByName":{"type":["string","null"]},"clockOutSetByName":{"type":["string","null"]},"checklist":{"anyOf":[{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mustDoLeft":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total","mustDoLeft"],"additionalProperties":false},{"type":"null"}]}},"required":["id","status","date","start","end","startsAt","endsAt","overnight","breakMinutes","durationMinutes","name","description","notes","clientId","clientName","projectId","projectName","jobId","visitNumber","teamMemberId","teamMemberName","openToTeamIds","openToTeamMemberIds","openNotifyAt","price","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","clockInRequired","clockInMissed","clockedInAt","clockedOutAt","clockInLocation","clockOutLocation","clockInDevice","clockOutDevice","clockInSetByName","clockOutSetByName","checklist"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/bookings/{id}/unlock-price":{"post":{"operationId":"bookings.unlockPrice","summary":"Unlock a locked price (never an invoiced one)","tags":["Bookings"],"x-permission":"price.unlock","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"startsAt":{"type":["string","null"]},"endsAt":{"type":["string","null"]},"overnight":{"type":"boolean"},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"jobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"visitNumber":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberName":{"type":["string","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openNotifyAt":{"type":["string","null"]},"price":{"anyOf":[{"type":"object","properties":{"pence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"source":{"type":"string","enum":["locked","override","list","none"]},"lockedAt":{"type":["string","null"]},"lockReason":{"anyOf":[{"type":"string","enum":["completed","signed_off","invoiced"]},{"type":"null"}]},"invoiceRef":{"type":["string","null"]}},"required":["pence","source","lockedAt","lockReason"],"additionalProperties":false},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"clockInRequired":{"type":"boolean"},"clockInMissed":{"type":"boolean"},"clockedInAt":{"type":["string","null"]},"clockedOutAt":{"type":["string","null"]},"clockInLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockOutLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockInDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockOutDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockInSetByName":{"type":["string","null"]},"clockOutSetByName":{"type":["string","null"]},"checklist":{"anyOf":[{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mustDoLeft":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total","mustDoLeft"],"additionalProperties":false},{"type":"null"}]}},"required":["id","status","date","start","end","startsAt","endsAt","overnight","breakMinutes","durationMinutes","name","description","notes","clientId","clientName","projectId","projectName","jobId","visitNumber","teamMemberId","teamMemberName","openToTeamIds","openToTeamMemberIds","openNotifyAt","price","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","clockInRequired","clockInMissed","clockedInAt","clockedOutAt","clockInLocation","clockOutLocation","clockInDevice","clockOutDevice","clockInSetByName","clockOutSetByName","checklist"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/bookings/unbook":{"post":{"operationId":"bookings.unbookMany","summary":"Put several repeat bookings' visits back to planned. confirm false: only say what would happen (and what can't, and why)","tags":["Bookings"],"x-permission":"booking.manage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"confirm":{"default":false,"type":"boolean"},"discardExtras":{"default":false,"type":"boolean"}},"required":["ids"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"unbook":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"name":{"type":"string"}},"required":["id","date","name"],"additionalProperties":false}},"refused":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"name":{"type":"string"},"reason":{"type":"string"}},"required":["id","date","name","reason"],"additionalProperties":false}},"extras":{"type":"object","properties":{"notes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"photos":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"documents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["notes","photos","documents"],"additionalProperties":false},"done":{"type":"boolean"}},"required":["unbook","refused","extras","done"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/bookings/{id}/unbook":{"post":{"operationId":"bookings.unbook","summary":"Put a repeat booking's visit back to planned (the booking goes; the visit shows as planned again). Refused for finished visits, and asks before deleting notes, photos or documents.","tags":["Bookings"],"x-permission":"booking.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"discardExtras":{"default":false,"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"unbook":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"name":{"type":"string"}},"required":["id","date","name"],"additionalProperties":false}},"refused":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"name":{"type":"string"},"reason":{"type":"string"}},"required":["id","date","name","reason"],"additionalProperties":false}},"extras":{"type":"object","properties":{"notes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"photos":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"documents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["notes","photos","documents"],"additionalProperties":false},"done":{"type":"boolean"}},"required":["unbook","refused","extras","done"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/bookings/open-work":{"get":{"operationId":"bookings.openWork","summary":"The app: open bookings offered to me from today on, soonest first, and whether my company lets me pick them up","tags":["Bookings"],"x-permission":"booking.updateOwnStatus","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"canPickUp":{"type":"boolean"},"bookings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"startsAt":{"type":["string","null"]},"endsAt":{"type":["string","null"]},"overnight":{"type":"boolean"},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"jobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"visitNumber":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberName":{"type":["string","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openNotifyAt":{"type":["string","null"]},"price":{"anyOf":[{"type":"object","properties":{"pence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"source":{"type":"string","enum":["locked","override","list","none"]},"lockedAt":{"type":["string","null"]},"lockReason":{"anyOf":[{"type":"string","enum":["completed","signed_off","invoiced"]},{"type":"null"}]},"invoiceRef":{"type":["string","null"]}},"required":["pence","source","lockedAt","lockReason"],"additionalProperties":false},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"clockInRequired":{"type":"boolean"},"clockInMissed":{"type":"boolean"},"clockedInAt":{"type":["string","null"]},"clockedOutAt":{"type":["string","null"]},"clockInLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockOutLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockInDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockOutDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockInSetByName":{"type":["string","null"]},"clockOutSetByName":{"type":["string","null"]},"checklist":{"anyOf":[{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mustDoLeft":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total","mustDoLeft"],"additionalProperties":false},{"type":"null"}]}},"required":["id","status","date","start","end","startsAt","endsAt","overnight","breakMinutes","durationMinutes","name","description","notes","clientId","clientName","projectId","projectName","jobId","visitNumber","teamMemberId","teamMemberName","openToTeamIds","openToTeamMemberIds","openNotifyAt","price","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","clockInRequired","clockInMissed","clockedInAt","clockedOutAt","clockInLocation","clockOutLocation","clockInDevice","clockOutDevice","clockInSetByName","clockOutSetByName","checklist"],"additionalProperties":false}}},"required":["canPickUp","bookings"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/bookings/{id}/pick-up":{"post":{"operationId":"bookings.pickUp","summary":"The app: take an open booking offered to me. It becomes mine and active. Refused if someone else got there first (409 AlreadyTaken), I'm off that day (409 OffThatDay), it clashes with my own work (409 Clash), it isn't offered to me (403 NotOffered), the day has passed (409 DayPassed) or my company doesn't allow it (403 PickUpOff)","tags":["Bookings"],"x-permission":"booking.updateOwnStatus","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"startsAt":{"type":["string","null"]},"endsAt":{"type":["string","null"]},"overnight":{"type":"boolean"},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"jobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"visitNumber":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberName":{"type":["string","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openNotifyAt":{"type":["string","null"]},"price":{"anyOf":[{"type":"object","properties":{"pence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"source":{"type":"string","enum":["locked","override","list","none"]},"lockedAt":{"type":["string","null"]},"lockReason":{"anyOf":[{"type":"string","enum":["completed","signed_off","invoiced"]},{"type":"null"}]},"invoiceRef":{"type":["string","null"]}},"required":["pence","source","lockedAt","lockReason"],"additionalProperties":false},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"clockInRequired":{"type":"boolean"},"clockInMissed":{"type":"boolean"},"clockedInAt":{"type":["string","null"]},"clockedOutAt":{"type":["string","null"]},"clockInLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockOutLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockInDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockOutDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockInSetByName":{"type":["string","null"]},"clockOutSetByName":{"type":["string","null"]},"checklist":{"anyOf":[{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mustDoLeft":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total","mustDoLeft"],"additionalProperties":false},{"type":"null"}]}},"required":["id","status","date","start","end","startsAt","endsAt","overnight","breakMinutes","durationMinutes","name","description","notes","clientId","clientName","projectId","projectName","jobId","visitNumber","teamMemberId","teamMemberName","openToTeamIds","openToTeamMemberIds","openNotifyAt","price","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","clockInRequired","clockInMissed","clockedInAt","clockedOutAt","clockInLocation","clockOutLocation","clockInDevice","clockOutDevice","clockInSetByName","clockOutSetByName","checklist"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/bookings/{id}/site":{"get":{"operationId":"bookings.site","summary":"Where the booking happens: the address to go to (project address field, else the client's), the client's contact details, and the project and client fields the caller may see","tags":["Bookings"],"x-permission":["booking.viewAll","booking.viewOwn","booking.viewClient"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"address":{"type":["string","null"]},"addressFrom":{"anyOf":[{"type":"string","enum":["project","client"]},{"type":"null"}]},"mapsUrl":{"type":["string","null"]},"client":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"address":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"website":{"type":["string","null"]},"notes":{"type":["string","null"]},"fields":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","textarea","number","date","checkbox","select","address"]},"value":{"type":["string","number","boolean"]},"text":{"type":"string"}},"required":["slug","label","type","value","text"],"additionalProperties":false}}},"required":["id","name","address","phone","email","website","notes","fields"],"additionalProperties":false},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"fields":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","textarea","number","date","checkbox","select","address"]},"value":{"type":["string","number","boolean"]},"text":{"type":"string"}},"required":["slug","label","type","value","text"],"additionalProperties":false}}},"required":["id","name","fields"],"additionalProperties":false},{"type":"null"}]}},"required":["bookingId","address","addressFrom","mapsUrl","client","project"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/bookings/{id}/details":{"get":{"operationId":"bookings.details","summary":"A booking's status history, notes and photos (each as the caller may see them)","tags":["Bookings"],"x-permission":["booking.viewAll","booking.viewOwn","booking.viewClient"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"anyOf":[{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]},{"type":"null"}]},"to":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]},"reason":{"type":["string","null"]},"byName":{"type":["string","null"]},"at":{"type":"string"}},"required":["id","from","to","reason","byName","at"],"additionalProperties":false}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string"},"text":{"type":"string"},"byName":{"type":["string","null"]},"at":{"type":"string"}},"required":["id","kind","text","byName","at"],"additionalProperties":false}},"clockChanges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"oldClockedInAt":{"type":["string","null"]},"newClockedInAt":{"type":["string","null"]},"oldClockedOutAt":{"type":["string","null"]},"newClockedOutAt":{"type":["string","null"]},"reason":{"type":"string"},"byName":{"type":["string","null"]},"at":{"type":"string"}},"required":["id","oldClockedInAt","newClockedInAt","oldClockedOutAt","newClockedOutAt","reason","byName","at"],"additionalProperties":false}},"notes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"body":{"type":"string"},"visibleToTeam":{"type":"boolean"},"visibleToClients":{"type":"boolean"},"authorName":{"type":["string","null"]},"authorRole":{"type":"string","enum":["owner","admin","operative","client"]},"mine":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","body","visibleToTeam","visibleToClients","authorName","authorRole","mine","createdAt"],"additionalProperties":false}},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"caption":{"type":["string","null"]},"visibleToTeam":{"type":"boolean"},"visibleToClients":{"type":"boolean"},"uploadedByName":{"type":["string","null"]},"createdAt":{"type":"string"},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","bytes","caption","visibleToTeam","visibleToClients","uploadedByName","createdAt","thumbUrl","fullUrl"],"additionalProperties":false}},"failedReason":{"type":["string","null"]}},"required":["history","events","clockChanges","notes","photos","failedReason"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/bookings/{id}/checklist":{"get":{"operationId":"bookingChecklist.get","summary":"A booking's checklist lines and their answers (as the caller may see them)","tags":["Bookings"],"x-permission":["booking.viewAll","booking.viewOwn","booking.viewClient"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string"},"instruction":{"type":["string","null"]},"kind":{"type":"string","enum":["tick","text","textarea","number","date","time","checkbox","select","photo"]},"unit":{"type":["string","null"]},"options":{"type":"array","items":{"type":"string"}},"askComment":{"type":"boolean"},"required":{"type":"boolean"},"visibleToClients":{"type":"boolean"},"done":{"type":"boolean"},"value":{"type":["string","number","boolean","null"]},"valueText":{"type":["string","null"]},"comment":{"type":["string","null"]},"photoId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"photoThumbUrl":{"type":["string","null"]},"photoFullUrl":{"type":["string","null"]},"doneAt":{"type":["string","null"]},"doneByName":{"type":["string","null"]}},"required":["id","label","instruction","kind","unit","options","askComment","required","visibleToClients","done","value","valueText","comment","photoId","photoThumbUrl","photoFullUrl","doneAt","doneByName"],"additionalProperties":false}},"summary":{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mustDoLeft":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total","mustDoLeft"],"additionalProperties":false},"canEdit":{"type":"boolean"}},"required":["bookingId","items","summary","canEdit"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/bookings/{id}/checklist/{itemId}":{"put":{"operationId":"bookingChecklist.answer","summary":"Answer one checklist line, or clear it (done: false). The team member doing the work until it's complete, or an owner or admin until it's signed off. The answer is checked for its kind (400 with the field). A photo line takes a photo already on the booking (upload it first)","tags":["Bookings"],"x-permission":["booking.manage","booking.updateOwnStatus"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"itemId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"done":{"type":"boolean"},"value":{"type":["string","number","boolean","null"]},"comment":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"photoId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["done"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"label":{"type":"string"},"instruction":{"type":["string","null"]},"kind":{"type":"string","enum":["tick","text","textarea","number","date","time","checkbox","select","photo"]},"unit":{"type":["string","null"]},"options":{"type":"array","items":{"type":"string"}},"askComment":{"type":"boolean"},"required":{"type":"boolean"},"visibleToClients":{"type":"boolean"},"done":{"type":"boolean"},"value":{"type":["string","number","boolean","null"]},"valueText":{"type":["string","null"]},"comment":{"type":["string","null"]},"photoId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"photoThumbUrl":{"type":["string","null"]},"photoFullUrl":{"type":["string","null"]},"doneAt":{"type":["string","null"]},"doneByName":{"type":["string","null"]}},"required":["id","label","instruction","kind","unit","options","askComment","required","visibleToClients","done","value","valueText","comment","photoId","photoThumbUrl","photoFullUrl","doneAt","doneByName"],"additionalProperties":false}},"summary":{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mustDoLeft":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total","mustDoLeft"],"additionalProperties":false},"canEdit":{"type":"boolean"}},"required":["bookingId","items","summary","canEdit"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/bookings/{id}/notes":{"post":{"operationId":"bookingNotes.create","summary":"Add a note to a booking","tags":["Bookings"],"x-permission":"booking.note","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":5000},"visibleToTeam":{"default":true,"type":"boolean"},"visibleToClients":{"default":false,"type":"boolean"}},"required":["body"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"body":{"type":"string"},"visibleToTeam":{"type":"boolean"},"visibleToClients":{"type":"boolean"},"authorName":{"type":["string","null"]},"authorRole":{"type":"string","enum":["owner","admin","operative","client"]},"mine":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","body","visibleToTeam","visibleToClients","authorName","authorRole","mine","createdAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/bookings/{id}/notes/{noteId}":{"delete":{"operationId":"bookingNotes.remove","summary":"Delete a note (your own, or any for owners and admins)","tags":["Bookings"],"x-permission":"booking.note","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"noteId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/bookings/{id}/photos":{"post":{"operationId":"bookingPhotos.upload","summary":"Add a photo: send the image itself (JPEG, PNG, WebP; up to 15 MB). Location and other metadata are removed.","tags":["Bookings"],"x-permission":"booking.photo","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}},"image/heic":{"schema":{"type":"string","format":"binary"}},"image/heif":{"schema":{"type":"string","format":"binary"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"caption":{"type":["string","null"]},"visibleToTeam":{"type":"boolean"},"visibleToClients":{"type":"boolean"},"uploadedByName":{"type":["string","null"]},"createdAt":{"type":"string"},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","bytes","caption","visibleToTeam","visibleToClients","uploadedByName","createdAt","thumbUrl","fullUrl"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/bookings/{id}/photos/{photoId}/{size}":{"get":{"operationId":"bookingPhotos.file","summary":"The photo itself (thumb or full size)","tags":["Bookings"],"x-permission":["booking.viewAll","booking.viewOwn","booking.viewClient"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"photoId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"size","in":"path","required":true,"schema":{"type":"string","enum":["thumb","full"]}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/bookings/{id}/photos/{photoId}":{"patch":{"operationId":"bookingPhotos.update","summary":"Change a photo's caption, or who can see it (team member, client)","tags":["Bookings"],"x-permission":"booking.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"photoId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"caption":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"visibleToTeam":{"type":"boolean"},"visibleToClients":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"caption":{"type":["string","null"]},"visibleToTeam":{"type":"boolean"},"visibleToClients":{"type":"boolean"},"uploadedByName":{"type":["string","null"]},"createdAt":{"type":"string"},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","bytes","caption","visibleToTeam","visibleToClients","uploadedByName","createdAt","thumbUrl","fullUrl"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"bookingPhotos.remove","summary":"Delete a photo","tags":["Bookings"],"x-permission":"booking.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"photoId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/schedule":{"get":{"operationId":"schedule.get","summary":"Bookings and planned visits between two dates","tags":["Schedule"],"x-permission":["booking.viewAll","booking.viewOwn"],"parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"teamMemberId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"work","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","clients","internal"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"bookings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"startsAt":{"type":["string","null"]},"endsAt":{"type":["string","null"]},"overnight":{"type":"boolean"},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"name":{"type":"string"},"description":{"type":["string","null"]},"notes":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"jobId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"visitNumber":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"teamMemberName":{"type":["string","null"]},"openToTeamIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openToTeamMemberIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"openNotifyAt":{"type":["string","null"]},"price":{"anyOf":[{"type":"object","properties":{"pence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"source":{"type":"string","enum":["locked","override","list","none"]},"lockedAt":{"type":["string","null"]},"lockReason":{"anyOf":[{"type":"string","enum":["completed","signed_off","invoiced"]},{"type":"null"}]},"invoiceRef":{"type":["string","null"]}},"required":["pence","source","lockedAt","lockReason"],"additionalProperties":false},{"type":"null"}]},"internal":{"type":"boolean"},"backdatedAt":{"type":["string","null"]},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"templateName":{"type":["string","null"]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}},"needsClockIn":{"type":["boolean","null"]},"clockInRequired":{"type":"boolean"},"clockInMissed":{"type":"boolean"},"clockedInAt":{"type":["string","null"]},"clockedOutAt":{"type":["string","null"]},"clockInLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockOutLocation":{"anyOf":[{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"accuracyMetres":{"anyOf":[{"type":"number","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["lat","lng","accuracyMetres"],"additionalProperties":false},{"type":"null"}]},"clockInDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockOutDevice":{"anyOf":[{"type":"object","properties":{"id":{"type":["string","null"]},"os":{"type":["string","null"]},"ip":{"type":["string","null"]}},"required":["id","os","ip"],"additionalProperties":false},{"type":"null"}]},"clockInSetByName":{"type":["string","null"]},"clockOutSetByName":{"type":["string","null"]},"checklist":{"anyOf":[{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mustDoLeft":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total","mustDoLeft"],"additionalProperties":false},{"type":"null"}]}},"required":["id","status","date","start","end","startsAt","endsAt","overnight","breakMinutes","durationMinutes","name","description","notes","clientId","clientName","projectId","projectName","jobId","visitNumber","teamMemberId","teamMemberName","openToTeamIds","openToTeamMemberIds","openNotifyAt","price","internal","backdatedAt","templateId","templateName","customFields","needsClockIn","clockInRequired","clockInMissed","clockedInAt","clockedOutAt","clockInLocation","clockOutLocation","clockInDevice","clockOutDevice","clockInSetByName","clockOutSetByName","checklist"],"additionalProperties":false}},"planned":{"type":"array","items":{"type":"object","properties":{"jobId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"unbooked":{"anyOf":[{"type":"object","properties":{"at":{"type":"string"},"byName":{"type":["string","null"]},"fromStatus":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]}},"required":["at","byName","fromStatus"],"additionalProperties":false},{"type":"null"}]},"visitNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"startsAt":{"type":["string","null"]},"endsAt":{"type":["string","null"]},"overnight":{"type":"boolean"},"breakMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"name":{"type":"string"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"pricePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"internal":{"type":"boolean"},"templateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean"]}}},"required":["jobId","unbooked","visitNumber","date","start","end","startsAt","endsAt","overnight","breakMinutes","durationMinutes","name","clientId","clientName","projectId","projectName","teamMemberId","pricePence","internal","templateId","customFields"],"additionalProperties":false}},"unavailable":{"type":"array","items":{"type":"object","properties":{"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string"},"to":{"type":"string"},"reason":{"type":"string"}},"required":["teamMemberId","from","to","reason"],"additionalProperties":false}}},"required":["bookings","planned","unavailable"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/projects/{id}/brief":{"get":{"operationId":"brief.get","summary":"A project's brief: text and images (and whether its public report link is on)","tags":["Projects"],"x-permission":"project.view","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":["string","null"]},"images":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","createdAt","thumbUrl","fullUrl"],"additionalProperties":false}},"publicToken":{"type":["string","null"]}},"required":["text","images","publicToken"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"brief.update","summary":"Change a project's brief text","tags":["Projects"],"x-permission":"project.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":["string","null"]},"images":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","createdAt","thumbUrl","fullUrl"],"additionalProperties":false}},"publicToken":{"type":["string","null"]}},"required":["text","images","publicToken"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/projects/{id}/brief/images":{"post":{"operationId":"brief.addImage","summary":"Add an image to the brief: send the image itself (JPEG, PNG, WebP; up to 15 MB). Location and other metadata are removed.","tags":["Projects"],"x-permission":"project.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}},"image/heic":{"schema":{"type":"string","format":"binary"}},"image/heif":{"schema":{"type":"string","format":"binary"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":["string","null"]},"images":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","createdAt","thumbUrl","fullUrl"],"additionalProperties":false}},"publicToken":{"type":["string","null"]}},"required":["text","images","publicToken"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/projects/{id}/brief/images/{imageId}/{size}":{"get":{"operationId":"brief.image","summary":"A brief image (thumb or full size)","tags":["Projects"],"x-permission":"project.view","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"imageId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"size","in":"path","required":true,"schema":{"type":"string","enum":["thumb","full"]}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/projects/{id}/brief/images/{imageId}":{"delete":{"operationId":"brief.removeImage","summary":"Remove a brief image","tags":["Projects"],"x-permission":"project.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"imageId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":["string","null"]},"images":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","createdAt","thumbUrl","fullUrl"],"additionalProperties":false}},"publicToken":{"type":["string","null"]}},"required":["text","images","publicToken"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/projects/{id}/public-link":{"post":{"operationId":"brief.createLink","summary":"Turn on the project's public report link, or make a new one (the old link stops working)","tags":["Projects"],"x-permission":"project.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"action":{"default":"create","type":"string","enum":["create","regenerate"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"publicToken":{"type":["string","null"]}},"required":["publicToken"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"brief.removeLink","summary":"Turn the public report link off","tags":["Projects"],"x-permission":"project.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"publicToken":{"type":["string","null"]}},"required":["publicToken"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/issues/counts":{"get":{"operationId":"issues.counts","summary":"How many issues the caller may see are open and in progress","tags":["Issues"],"x-permission":"issue.view","x-module":"issues","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"open":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"inProgress":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["open","inProgress"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/issues":{"get":{"operationId":"issues.list","summary":"Issues the caller may see (a project or client, or all)","tags":["Issues"],"x-permission":"issue.view","x-module":"issues","parameters":[{"name":"projectId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","in_progress","closed"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"reportedBy","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"assignedTo","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"unassigned","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"closedSince","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectName":{"type":"string"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"status":{"type":"string","enum":["open","in_progress","closed"]},"dateReported":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"details":{"type":"string"},"reportedByName":{"type":["string","null"]},"reportedByUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedToUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedToName":{"type":["string","null"]},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["status","assignment"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"byName":{"type":["string","null"]},"at":{"type":"string"}},"required":["id","kind","from","to","byName","at"],"additionalProperties":false}},"notes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"body":{"type":"string"},"authorName":{"type":["string","null"]},"mine":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","body","authorName","mine","createdAt"],"additionalProperties":false}},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","createdAt","thumbUrl","fullUrl"],"additionalProperties":false}},"closedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","projectName","clientId","clientName","status","dateReported","details","reportedByName","reportedByUserId","assignedToUserId","assignedToName","history","notes","photos","closedAt","createdAt","updatedAt"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"issues.create","summary":"Report an issue on a project (operatives: on a booking assigned to them)","tags":["Issues"],"x-permission":"issue.report","x-module":"issues","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"details":{"type":"string","minLength":1,"maxLength":10000},"dateReported":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"status":{"type":"string","enum":["open","in_progress","closed"]}},"required":["details"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectName":{"type":"string"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"status":{"type":"string","enum":["open","in_progress","closed"]},"dateReported":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"details":{"type":"string"},"reportedByName":{"type":["string","null"]},"reportedByUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedToUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedToName":{"type":["string","null"]},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["status","assignment"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"byName":{"type":["string","null"]},"at":{"type":"string"}},"required":["id","kind","from","to","byName","at"],"additionalProperties":false}},"notes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"body":{"type":"string"},"authorName":{"type":["string","null"]},"mine":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","body","authorName","mine","createdAt"],"additionalProperties":false}},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","createdAt","thumbUrl","fullUrl"],"additionalProperties":false}},"closedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","projectName","clientId","clientName","status","dateReported","details","reportedByName","reportedByUserId","assignedToUserId","assignedToName","history","notes","photos","closedAt","createdAt","updatedAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/issues/{id}":{"get":{"operationId":"issues.get","summary":"One issue","tags":["Issues"],"x-permission":"issue.view","x-module":"issues","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectName":{"type":"string"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"status":{"type":"string","enum":["open","in_progress","closed"]},"dateReported":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"details":{"type":"string"},"reportedByName":{"type":["string","null"]},"reportedByUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedToUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedToName":{"type":["string","null"]},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["status","assignment"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"byName":{"type":["string","null"]},"at":{"type":"string"}},"required":["id","kind","from","to","byName","at"],"additionalProperties":false}},"notes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"body":{"type":"string"},"authorName":{"type":["string","null"]},"mine":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","body","authorName","mine","createdAt"],"additionalProperties":false}},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","createdAt","thumbUrl","fullUrl"],"additionalProperties":false}},"closedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","projectName","clientId","clientName","status","dateReported","details","reportedByName","reportedByUserId","assignedToUserId","assignedToName","history","notes","photos","closedAt","createdAt","updatedAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"issues.update","summary":"Change an issue's status, date or details","tags":["Issues"],"x-permission":"issue.manage","x-module":"issues","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["open","in_progress","closed"]},"assignedToUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"dateReported":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"details":{"type":"string","minLength":1,"maxLength":10000}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectName":{"type":"string"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"status":{"type":"string","enum":["open","in_progress","closed"]},"dateReported":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"details":{"type":"string"},"reportedByName":{"type":["string","null"]},"reportedByUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedToUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedToName":{"type":["string","null"]},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["status","assignment"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"byName":{"type":["string","null"]},"at":{"type":"string"}},"required":["id","kind","from","to","byName","at"],"additionalProperties":false}},"notes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"body":{"type":"string"},"authorName":{"type":["string","null"]},"mine":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","body","authorName","mine","createdAt"],"additionalProperties":false}},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","createdAt","thumbUrl","fullUrl"],"additionalProperties":false}},"closedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","projectName","clientId","clientName","status","dateReported","details","reportedByName","reportedByUserId","assignedToUserId","assignedToName","history","notes","photos","closedAt","createdAt","updatedAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"issues.remove","summary":"Delete an issue","tags":["Issues"],"x-permission":"issue.manage","x-module":"issues","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/issues/{id}/notes":{"post":{"operationId":"issues.addNote","summary":"Add a note to an issue","tags":["Issues"],"x-permission":"issue.note","x-module":"issues","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":5000}},"required":["body"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectName":{"type":"string"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"status":{"type":"string","enum":["open","in_progress","closed"]},"dateReported":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"details":{"type":"string"},"reportedByName":{"type":["string","null"]},"reportedByUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedToUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedToName":{"type":["string","null"]},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["status","assignment"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"byName":{"type":["string","null"]},"at":{"type":"string"}},"required":["id","kind","from","to","byName","at"],"additionalProperties":false}},"notes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"body":{"type":"string"},"authorName":{"type":["string","null"]},"mine":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","body","authorName","mine","createdAt"],"additionalProperties":false}},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","createdAt","thumbUrl","fullUrl"],"additionalProperties":false}},"closedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","projectName","clientId","clientName","status","dateReported","details","reportedByName","reportedByUserId","assignedToUserId","assignedToName","history","notes","photos","closedAt","createdAt","updatedAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/issues/{id}/photos":{"post":{"operationId":"issues.addPhoto","summary":"Add a photo to an issue: send the image itself (JPEG, PNG, WebP; up to 15 MB)","tags":["Issues"],"x-permission":"issue.report","x-module":"issues","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}},"image/heic":{"schema":{"type":"string","format":"binary"}},"image/heif":{"schema":{"type":"string","format":"binary"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectName":{"type":"string"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"status":{"type":"string","enum":["open","in_progress","closed"]},"dateReported":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"details":{"type":"string"},"reportedByName":{"type":["string","null"]},"reportedByUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedToUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedToName":{"type":["string","null"]},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["status","assignment"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"byName":{"type":["string","null"]},"at":{"type":"string"}},"required":["id","kind","from","to","byName","at"],"additionalProperties":false}},"notes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"body":{"type":"string"},"authorName":{"type":["string","null"]},"mine":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","body","authorName","mine","createdAt"],"additionalProperties":false}},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","createdAt","thumbUrl","fullUrl"],"additionalProperties":false}},"closedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","projectName","clientId","clientName","status","dateReported","details","reportedByName","reportedByUserId","assignedToUserId","assignedToName","history","notes","photos","closedAt","createdAt","updatedAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/issues/{id}/photos/{photoId}/{size}":{"get":{"operationId":"issues.photo","summary":"An issue photo (thumb or full size)","tags":["Issues"],"x-permission":"issue.view","x-module":"issues","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"photoId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"size","in":"path","required":true,"schema":{"type":"string","enum":["thumb","full"]}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/issues/{id}/photos/{photoId}":{"delete":{"operationId":"issues.removePhoto","summary":"Remove an issue photo","tags":["Issues"],"x-permission":"issue.manage","x-module":"issues","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"photoId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectName":{"type":"string"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"status":{"type":"string","enum":["open","in_progress","closed"]},"dateReported":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"details":{"type":"string"},"reportedByName":{"type":["string","null"]},"reportedByUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedToUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedToName":{"type":["string","null"]},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["status","assignment"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"byName":{"type":["string","null"]},"at":{"type":"string"}},"required":["id","kind","from","to","byName","at"],"additionalProperties":false}},"notes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"body":{"type":"string"},"authorName":{"type":["string","null"]},"mine":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","body","authorName","mine","createdAt"],"additionalProperties":false}},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","createdAt","thumbUrl","fullUrl"],"additionalProperties":false}},"closedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","projectId","projectName","clientId","clientName","status","dateReported","details","reportedByName","reportedByUserId","assignedToUserId","assignedToName","history","notes","photos","closedAt","createdAt","updatedAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/documents":{"get":{"operationId":"documents.list","summary":"A client's, project's, booking's or team member's documents (as the caller may see them)","tags":["Documents"],"x-permission":"document.view","parameters":[{"name":"entity","in":"query","required":true,"schema":{"type":"string","enum":["client","project","booking","team_member"]}},{"name":"id","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"entity":{"type":"string","enum":["client","project","booking","team_member"]},"recordId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visibleToTeam":{"type":"boolean"},"visibleToClients":{"type":"boolean"},"uploadedByName":{"type":["string","null"]},"createdAt":{"type":"string"},"url":{"type":"string"}},"required":["id","entity","recordId","filename","contentType","bytes","visibleToTeam","visibleToClients","uploadedByName","createdAt","url"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"documents.upload","summary":"Upload a document: send the file itself as application/octet-stream (any kind, up to 50 MB), with its name in the query. Team members may upload to their own record only.","tags":["Documents"],"x-permission":["document.manage","document.uploadOwn"],"parameters":[{"name":"entity","in":"query","required":true,"schema":{"type":"string","enum":["client","project","booking","team_member"]}},{"name":"id","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"name","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}},{"name":"type","in":"query","required":false,"schema":{"type":"string","maxLength":150}},{"name":"visibleToTeam","in":"query","required":false,"schema":{"default":"true","type":"string","enum":["true","false"]}},{"name":"visibleToClients","in":"query","required":false,"schema":{"default":"false","type":"string","enum":["true","false"]}}],"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"entity":{"type":"string","enum":["client","project","booking","team_member"]},"recordId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visibleToTeam":{"type":"boolean"},"visibleToClients":{"type":"boolean"},"uploadedByName":{"type":["string","null"]},"createdAt":{"type":"string"},"url":{"type":"string"}},"required":["id","entity","recordId","filename","contentType","bytes","visibleToTeam","visibleToClients","uploadedByName","createdAt","url"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/documents/{id}/file":{"get":{"operationId":"documents.file","summary":"Download a document","tags":["Documents"],"x-permission":"document.view","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/documents/{id}":{"patch":{"operationId":"documents.update","summary":"Rename a document, or change who can see it (team member, client)","tags":["Documents"],"x-permission":"document.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filename":{"type":"string","minLength":1,"maxLength":255},"visibleToTeam":{"type":"boolean"},"visibleToClients":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"entity":{"type":"string","enum":["client","project","booking","team_member"]},"recordId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"visibleToTeam":{"type":"boolean"},"visibleToClients":{"type":"boolean"},"uploadedByName":{"type":["string","null"]},"createdAt":{"type":"string"},"url":{"type":"string"}},"required":["id","entity","recordId","filename","contentType","bytes","visibleToTeam","visibleToClients","uploadedByName","createdAt","url"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"documents.remove","summary":"Delete a document (team members: only ones they added to their own record)","tags":["Documents"],"x-permission":["document.manage","document.uploadOwn"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/schedule-filters":{"get":{"operationId":"scheduleFilters.list","summary":"The company's saved schedule filters (and which is the caller's default)","tags":["Schedule"],"x-permission":"scheduleFilter.manage","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"description":{"type":["string","null"]},"criteria":{"type":"object","properties":{"teamMemberIds":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"teamIds":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"clientIds":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"projectIds":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"templateIds":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"statuses":{"default":[],"maxItems":6,"type":"array","items":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]}},"work":{"default":"all","type":"string","enum":["all","clients","internal"]}},"required":["teamMemberIds","teamIds","clientIds","projectIds","templateIds","statuses","work"],"additionalProperties":false},"showOthers":{"type":"boolean"},"isDefault":{"type":"boolean"},"createdByName":{"type":["string","null"]}},"required":["id","name","description","criteria","showOthers","isDefault","createdByName"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"scheduleFilters.create","summary":"Save a schedule filter","tags":["Schedule"],"x-permission":"scheduleFilter.manage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"criteria":{"type":"object","properties":{"teamMemberIds":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"teamIds":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"clientIds":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"projectIds":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"templateIds":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"statuses":{"default":[],"maxItems":6,"type":"array","items":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]}},"work":{"default":"all","type":"string","enum":["all","clients","internal"]}}},"showOthers":{"default":false,"type":"boolean"}},"required":["name","criteria"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"description":{"type":["string","null"]},"criteria":{"type":"object","properties":{"teamMemberIds":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"teamIds":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"clientIds":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"projectIds":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"templateIds":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"statuses":{"default":[],"maxItems":6,"type":"array","items":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]}},"work":{"default":"all","type":"string","enum":["all","clients","internal"]}},"required":["teamMemberIds","teamIds","clientIds","projectIds","templateIds","statuses","work"],"additionalProperties":false},"showOthers":{"type":"boolean"},"isDefault":{"type":"boolean"},"createdByName":{"type":["string","null"]}},"required":["id","name","description","criteria","showOthers","isDefault","createdByName"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/schedule-filters/{id}":{"patch":{"operationId":"scheduleFilters.update","summary":"Change a saved schedule filter","tags":["Schedule"],"x-permission":"scheduleFilter.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"criteria":{"type":"object","properties":{"teamMemberIds":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"teamIds":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"clientIds":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"projectIds":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"templateIds":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"statuses":{"default":[],"maxItems":6,"type":"array","items":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]}},"work":{"default":"all","type":"string","enum":["all","clients","internal"]}}},"showOthers":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"description":{"type":["string","null"]},"criteria":{"type":"object","properties":{"teamMemberIds":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"teamIds":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"clientIds":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"projectIds":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"templateIds":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"statuses":{"default":[],"maxItems":6,"type":"array","items":{"type":"string","enum":["draft","open","active","complete","signed_off","failed"]}},"work":{"default":"all","type":"string","enum":["all","clients","internal"]}},"required":["teamMemberIds","teamIds","clientIds","projectIds","templateIds","statuses","work"],"additionalProperties":false},"showOthers":{"type":"boolean"},"isDefault":{"type":"boolean"},"createdByName":{"type":["string","null"]}},"required":["id","name","description","criteria","showOthers","isDefault","createdByName"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"scheduleFilters.remove","summary":"Delete a saved schedule filter","tags":["Schedule"],"x-permission":"scheduleFilter.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/schedule-filters/default":{"put":{"operationId":"scheduleFilters.setDefault","summary":"Choose the filter the schedule opens with for me (null: none)","tags":["Schedule"],"x-permission":"scheduleFilter.manage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"filterId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["filterId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/travel-time":{"get":{"operationId":"travel.list","summary":"Travel time and miles between two dates","tags":["Schedule"],"x-permission":"travel.view","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"teamMemberId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberName":{"type":"string"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"miles":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","teamMemberId","teamMemberName","date","minutes","miles","createdAt"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"travel.create","summary":"Add travel time or miles for a person on a day","tags":["Schedule"],"x-permission":"travel.manage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"minutes":{"default":0,"type":"integer","minimum":0,"maximum":1440},"miles":{"default":0,"type":"number","minimum":0,"maximum":10000}},"required":["teamMemberId","date"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberName":{"type":"string"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"miles":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","teamMemberId","teamMemberName","date","minutes","miles","createdAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/travel-time/{id}":{"patch":{"operationId":"travel.update","summary":"Change a travel time entry","tags":["Schedule"],"x-permission":"travel.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"minutes":{"type":"integer","minimum":0,"maximum":1440},"miles":{"type":"number","minimum":0,"maximum":10000}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberName":{"type":"string"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"miles":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","teamMemberId","teamMemberName","date","minutes","miles","createdAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"travel.remove","summary":"Delete a travel time entry","tags":["Schedule"],"x-permission":"travel.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/holiday/settings":{"get":{"operationId":"holiday.settings","summary":"The company's holiday settings: accrual rate, holiday year, salaried allowance, bank holidays, carry-over","tags":["Holiday"],"x-permission":"absence.view","x-module":"holiday","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accrualRatePercent":{"type":"number"},"holidayYearStart":{"type":"string","pattern":"^(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$"},"salariedAllowanceDays":{"type":"number"},"bankHolidayMode":{"type":"string","enum":["work","close_from_allowance","close_on_top"]},"bankHolidayRegion":{"type":"string","enum":["england-and-wales","scotland","northern-ireland"]},"carryOverMaxDays":{"type":"number"},"carryOverUseBy":{"anyOf":[{"type":"string","pattern":"^(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$"},{"type":"null"}]},"hourlyExpiryMonths":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["accrualRatePercent","holidayYearStart","salariedAllowanceDays","bankHolidayMode","bankHolidayRegion","carryOverMaxDays","carryOverUseBy","hourlyExpiryMonths"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"holiday.updateSettings","summary":"Change the holiday settings","tags":["Holiday"],"x-permission":"organization.update","x-module":"holiday","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accrualRatePercent":{"type":"number","minimum":0,"maximum":50},"holidayYearStart":{"type":"string","pattern":"^(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$"},"salariedAllowanceDays":{"type":"number","minimum":0,"maximum":366},"bankHolidayMode":{"type":"string","enum":["work","close_from_allowance","close_on_top"]},"bankHolidayRegion":{"type":"string","enum":["england-and-wales","scotland","northern-ireland"]},"carryOverMaxDays":{"type":"number","minimum":0,"maximum":366},"carryOverUseBy":{"anyOf":[{"type":"string","pattern":"^(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$"},{"type":"null"}]},"hourlyExpiryMonths":{"anyOf":[{"type":"integer","minimum":1,"maximum":120},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accrualRatePercent":{"type":"number"},"holidayYearStart":{"type":"string","pattern":"^(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$"},"salariedAllowanceDays":{"type":"number"},"bankHolidayMode":{"type":"string","enum":["work","close_from_allowance","close_on_top"]},"bankHolidayRegion":{"type":"string","enum":["england-and-wales","scotland","northern-ireland"]},"carryOverMaxDays":{"type":"number"},"carryOverUseBy":{"anyOf":[{"type":"string","pattern":"^(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$"},{"type":"null"}]},"hourlyExpiryMonths":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["accrualRatePercent","holidayYearStart","salariedAllowanceDays","bankHolidayMode","bankHolidayRegion","carryOverMaxDays","carryOverUseBy","hourlyExpiryMonths"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/absence-types":{"get":{"operationId":"holiday.types","summary":"Absence types (Holiday, Sickness, Unpaid leave, Other, and the company's own)","tags":["Holiday"],"x-permission":"absence.self","x-module":"holiday","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"key":{"type":["string","null"]},"name":{"type":"string"},"paid":{"type":"boolean"},"usesAllowance":{"type":"boolean"},"archived":{"type":"boolean"}},"required":["id","key","name","paid","usesAllowance","archived"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"holiday.createType","summary":"Add an absence type","tags":["Holiday"],"x-permission":"organization.update","x-module":"holiday","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"paid":{"type":"boolean"},"usesAllowance":{"type":"boolean"}},"required":["name","paid","usesAllowance"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"key":{"type":["string","null"]},"name":{"type":"string"},"paid":{"type":"boolean"},"usesAllowance":{"type":"boolean"},"archived":{"type":"boolean"}},"required":["id","key","name","paid","usesAllowance","archived"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/absence-types/{id}":{"patch":{"operationId":"holiday.updateType","summary":"Change or archive an absence type","tags":["Holiday"],"x-permission":"organization.update","x-module":"holiday","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"paid":{"type":"boolean"},"usesAllowance":{"type":"boolean"},"archived":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"key":{"type":["string","null"]},"name":{"type":"string"},"paid":{"type":"boolean"},"usesAllowance":{"type":"boolean"},"archived":{"type":"boolean"}},"required":["id","key","name","paid","usesAllowance","archived"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/bank-holidays":{"get":{"operationId":"holiday.bankHolidays","summary":"Bank holidays between two dates in the company's region (and whether it works them)","tags":["Holiday"],"x-permission":["booking.viewAll","booking.viewOwn"],"parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"region":{"type":"string","enum":["england-and-wales","scotland","northern-ireland"]},"mode":{"type":"string","enum":["work","close_from_allowance","close_on_top"]},"dates":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"title":{"type":"string"}},"required":["date","title"],"additionalProperties":false}}},"required":["region","mode","dates"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/absences":{"get":{"operationId":"absences.list","summary":"Absences between two dates (who's off), with filters","tags":["Holiday"],"x-permission":"absence.view","x-module":"holiday","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["requested","approved","declined","cancelled","pending"]}},{"name":"teamMemberId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"typeId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"teamId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"teamIds","in":"query","required":false,"schema":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberName":{"type":"string"},"type":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"paid":{"type":"boolean"},"usesAllowance":{"type":"boolean"}},"required":["id","name","paid","usesAllowance"],"additionalProperties":false},"status":{"type":"string","enum":["requested","approved","declined","cancelled"]},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"part":{"type":"string","enum":["full","am","pm","hours"]},"minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountLabel":{"type":"string"},"note":{"type":["string","null"]},"declineReason":{"type":["string","null"]},"cancelRequested":{"type":"boolean"},"requestedByName":{"type":["string","null"]},"decidedByName":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","teamMemberId","teamMemberName","type","status","startDate","endDate","part","minutes","seconds","amountLabel","note","declineReason","cancelRequested","requestedByName","decidedByName","decidedAt","createdAt"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"absences.create","summary":"Add an absence for one or more people (approved, or as a request), deciding what happens to their bookings","tags":["Holiday"],"x-permission":"absence.manage","x-module":"holiday","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"typeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"part":{"default":"full","type":"string","enum":["full","am","pm","hours"]},"minutes":{"type":"integer","minimum":1,"maximum":527040},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"teamMemberIds":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"status":{"default":"approved","type":"string","enum":["approved","requested"]},"clashes":{"default":[],"maxItems":2000,"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string","enum":["leave","open","reassign"]},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["bookingId","action"]}}},"required":["typeId","startDate","endDate","teamMemberIds"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberName":{"type":"string"},"type":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"paid":{"type":"boolean"},"usesAllowance":{"type":"boolean"}},"required":["id","name","paid","usesAllowance"],"additionalProperties":false},"status":{"type":"string","enum":["requested","approved","declined","cancelled"]},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"part":{"type":"string","enum":["full","am","pm","hours"]},"minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountLabel":{"type":"string"},"note":{"type":["string","null"]},"declineReason":{"type":["string","null"]},"cancelRequested":{"type":"boolean"},"requestedByName":{"type":["string","null"]},"decidedByName":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","teamMemberId","teamMemberName","type","status","startDate","endDate","part","minutes","seconds","amountLabel","note","declineReason","cancelRequested","requestedByName","decidedByName","decidedAt","createdAt"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/absences/{id}":{"get":{"operationId":"absences.get","summary":"One absence","tags":["Holiday"],"x-permission":"absence.view","x-module":"holiday","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberName":{"type":"string"},"type":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"paid":{"type":"boolean"},"usesAllowance":{"type":"boolean"}},"required":["id","name","paid","usesAllowance"],"additionalProperties":false},"status":{"type":"string","enum":["requested","approved","declined","cancelled"]},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"part":{"type":"string","enum":["full","am","pm","hours"]},"minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountLabel":{"type":"string"},"note":{"type":["string","null"]},"declineReason":{"type":["string","null"]},"cancelRequested":{"type":"boolean"},"requestedByName":{"type":["string","null"]},"decidedByName":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","teamMemberId","teamMemberName","type","status","startDate","endDate","part","minutes","seconds","amountLabel","note","declineReason","cancelRequested","requestedByName","decidedByName","decidedAt","createdAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"absences.update","summary":"Change an absence (an approved one is taken back and put in again)","tags":["Holiday"],"x-permission":"absence.manage","x-module":"holiday","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"typeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"part":{"default":"full","type":"string","enum":["full","am","pm","hours"]},"minutes":{"type":"integer","minimum":1,"maximum":527040},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"clashes":{"maxItems":2000,"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string","enum":["leave","open","reassign"]},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["bookingId","action"]}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberName":{"type":"string"},"type":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"paid":{"type":"boolean"},"usesAllowance":{"type":"boolean"}},"required":["id","name","paid","usesAllowance"],"additionalProperties":false},"status":{"type":"string","enum":["requested","approved","declined","cancelled"]},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"part":{"type":"string","enum":["full","am","pm","hours"]},"minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountLabel":{"type":"string"},"note":{"type":["string","null"]},"declineReason":{"type":["string","null"]},"cancelRequested":{"type":"boolean"},"requestedByName":{"type":["string","null"]},"decidedByName":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","teamMemberId","teamMemberName","type","status","startDate","endDate","part","minutes","seconds","amountLabel","note","declineReason","cancelRequested","requestedByName","decidedByName","decidedAt","createdAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/absences/preview":{"post":{"operationId":"absences.preview","summary":"Before saving: what an absence takes for each person, their balance before and after, and their bookings on those days","tags":["Holiday"],"x-permission":"absence.manage","x-module":"holiday","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"typeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"part":{"default":"full","type":"string","enum":["full","am","pm","hours"]},"minutes":{"type":"integer","minimum":1,"maximum":527040},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"teamMemberIds":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"excludeAbsenceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["typeId","startDate","endDate","teamMemberIds"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"payBasis":{"type":"string","enum":["hourly","salaried"]},"seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountLabel":{"type":"string"},"needsMinutes":{"type":"boolean"},"suggestedMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"from":{"type":"string","enum":["booked","average","none"]}},"required":["date","minutes","from"],"additionalProperties":false}},"averageDayMinutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"averageWeeks":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"usesAllowance":{"type":"boolean"},"balanceBeforeSeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"balanceAfterSeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"balanceBeforeLabel":{"type":"string"},"balanceAfterLabel":{"type":"string"},"clashes":{"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"name":{"type":"string"},"clientName":{"type":"string"},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"status":{"type":"string"}},"required":["bookingId","date","name","clientName","start","end","status"],"additionalProperties":false}}},"required":["teamMemberId","name","payBasis","seconds","amountLabel","needsMinutes","suggestedMinutes","days","averageDayMinutes","averageWeeks","usesAllowance","balanceBeforeSeconds","balanceAfterSeconds","balanceBeforeLabel","balanceAfterLabel","clashes"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/absences/{id}/approve":{"post":{"operationId":"absences.approve","summary":"Approve a request (or a request to cancel), deciding what happens to their bookings","tags":["Holiday"],"x-permission":"absence.manage","x-module":"holiday","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"clashes":{"default":[],"maxItems":2000,"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string","enum":["leave","open","reassign"]},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["bookingId","action"]}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberName":{"type":"string"},"type":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"paid":{"type":"boolean"},"usesAllowance":{"type":"boolean"}},"required":["id","name","paid","usesAllowance"],"additionalProperties":false},"status":{"type":"string","enum":["requested","approved","declined","cancelled"]},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"part":{"type":"string","enum":["full","am","pm","hours"]},"minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountLabel":{"type":"string"},"note":{"type":["string","null"]},"declineReason":{"type":["string","null"]},"cancelRequested":{"type":"boolean"},"requestedByName":{"type":["string","null"]},"decidedByName":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","teamMemberId","teamMemberName","type","status","startDate","endDate","part","minutes","seconds","amountLabel","note","declineReason","cancelRequested","requestedByName","decidedByName","decidedAt","createdAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/absences/{id}/decline":{"post":{"operationId":"absences.decline","summary":"Decline a request, saying why (or refuse a request to cancel)","tags":["Holiday"],"x-permission":"absence.manage","x-module":"holiday","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":1000}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberName":{"type":"string"},"type":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"paid":{"type":"boolean"},"usesAllowance":{"type":"boolean"}},"required":["id","name","paid","usesAllowance"],"additionalProperties":false},"status":{"type":"string","enum":["requested","approved","declined","cancelled"]},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"part":{"type":"string","enum":["full","am","pm","hours"]},"minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountLabel":{"type":"string"},"note":{"type":["string","null"]},"declineReason":{"type":["string","null"]},"cancelRequested":{"type":"boolean"},"requestedByName":{"type":["string","null"]},"decidedByName":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","teamMemberId","teamMemberName","type","status","startDate","endDate","part","minutes","seconds","amountLabel","note","declineReason","cancelRequested","requestedByName","decidedByName","decidedAt","createdAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/absences/{id}/cancel":{"post":{"operationId":"absences.cancel","summary":"Cancel an absence (its holiday goes back)","tags":["Holiday"],"x-permission":"absence.manage","x-module":"holiday","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberName":{"type":"string"},"type":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"paid":{"type":"boolean"},"usesAllowance":{"type":"boolean"}},"required":["id","name","paid","usesAllowance"],"additionalProperties":false},"status":{"type":"string","enum":["requested","approved","declined","cancelled"]},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"part":{"type":"string","enum":["full","am","pm","hours"]},"minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountLabel":{"type":"string"},"note":{"type":["string","null"]},"declineReason":{"type":["string","null"]},"cancelRequested":{"type":"boolean"},"requestedByName":{"type":["string","null"]},"decidedByName":{"type":["string","null"]},"decidedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","teamMemberId","teamMemberName","type","status","startDate","endDate","part","minutes","seconds","amountLabel","note","declineReason","cancelRequested","requestedByName","decidedByName","decidedAt","createdAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/team-members/{id}/holiday":{"get":{"operationId":"absences.balance","summary":"A team member's holiday balance, this holiday year, and the ledger","tags":["Holiday"],"x-permission":"absence.view","x-module":"holiday","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"payBasis":{"type":"string","enum":["hourly","salaried"]},"minutesPerDay":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"balanceSeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"balanceLabel":{"type":"string"},"aheadSeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"todaySeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"todayLabel":{"type":"string"},"pendingSeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"year":{"type":"object","properties":{"start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start","end"],"additionalProperties":false},"thisYear":{"type":"object","properties":{"earnedSeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"takenSeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"allowanceSeconds":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"carryInSeconds":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bankHolidaySeconds":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"adjustmentSeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expiredSeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["earnedSeconds","takenSeconds","allowanceSeconds","carryInSeconds","bankHolidaySeconds","adjustmentSeconds","expiredSeconds"],"additionalProperties":false},"ledger":{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"kind":{"type":"string","enum":["accrual","absence","adjustment","allowance","carry_over","bank_holiday","expired"]},"seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"label":{"type":"string"},"note":{"type":["string","null"]},"byName":{"type":["string","null"]},"createdAt":{"type":["string","null"]}},"required":["id","date","kind","seconds","label","note","byName","createdAt"],"additionalProperties":false}},"byType":{"type":"array","items":{"type":"object","properties":{"typeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"usesAllowance":{"type":"boolean"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"label":{"type":"string"}},"required":["typeId","name","usesAllowance","count","seconds","label"],"additionalProperties":false}}},"required":["teamMemberId","payBasis","minutesPerDay","balanceSeconds","balanceLabel","aheadSeconds","todaySeconds","todayLabel","pendingSeconds","year","thisYear","ledger","byType"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/team-members/{id}/holiday/adjustments":{"post":{"operationId":"absences.adjust","summary":"Add or take away holiday by hand, with a reason (a new ledger line)","tags":["Holiday"],"x-permission":"absence.manage","x-module":"holiday","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"amount":{"type":"number"},"unit":{"type":"string","enum":["hours","days"]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"reason":{"type":"string","minLength":3,"maxLength":500}},"required":["amount","unit","reason"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"payBasis":{"type":"string","enum":["hourly","salaried"]},"minutesPerDay":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"balanceSeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"balanceLabel":{"type":"string"},"aheadSeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"todaySeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"todayLabel":{"type":"string"},"pendingSeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"year":{"type":"object","properties":{"start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start","end"],"additionalProperties":false},"thisYear":{"type":"object","properties":{"earnedSeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"takenSeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"allowanceSeconds":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"carryInSeconds":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"bankHolidaySeconds":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"adjustmentSeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"expiredSeconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["earnedSeconds","takenSeconds","allowanceSeconds","carryInSeconds","bankHolidaySeconds","adjustmentSeconds","expiredSeconds"],"additionalProperties":false},"ledger":{"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"kind":{"type":"string","enum":["accrual","absence","adjustment","allowance","carry_over","bank_holiday","expired"]},"seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"label":{"type":"string"},"note":{"type":["string","null"]},"byName":{"type":["string","null"]},"createdAt":{"type":["string","null"]}},"required":["id","date","kind","seconds","label","note","byName","createdAt"],"additionalProperties":false}},"byType":{"type":"array","items":{"type":"object","properties":{"typeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"usesAllowance":{"type":"boolean"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"seconds":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"label":{"type":"string"}},"required":["typeId","name","usesAllowance","count","seconds","label"],"additionalProperties":false}}},"required":["teamMemberId","payBasis","minutesPerDay","balanceSeconds","balanceLabel","aheadSeconds","todaySeconds","todayLabel","pendingSeconds","year","thisYear","ledger","byType"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/reports/attendance":{"get":{"operationId":"reports.attendance","summary":"Attendance matrix (as Xota's): for each team member and day, work, breaks and net from where their hours come from, approved absence by type, and net plus paid absence, with totals","tags":["Reports"],"x-permission":"report.view","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"teamId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"teamMemberId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"teamIds","in":"query","required":false,"schema":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},{"name":"teamMemberIds","in":"query","required":false,"schema":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},{"name":"clientIds","in":"query","required":false,"schema":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},{"name":"projectIds","in":"query","required":false,"schema":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},{"name":"templateIds","in":"query","required":false,"schema":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},{"name":"work","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","clients","internal"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"days":{"type":"array","items":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"absenceTypes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"key":{"type":["string","null"]},"name":{"type":"string"},"paid":{"type":"boolean"}},"required":["id","key","name","paid"],"additionalProperties":false}},"rows":{"type":"array","items":{"type":"object","properties":{"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"breaksPaid":{"type":"boolean"},"hoursFrom":{"type":"string","enum":["bookings","timesheets"]},"days":{"type":"object","propertyNames":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"additionalProperties":{"type":"object","properties":{"work":{"type":"number"},"breaks":{"type":"number"},"net":{"type":"number"},"absence":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"absenceTotal":{"type":"number"},"paidAbsence":{"type":"number"},"total":{"type":"number"}},"required":["work","breaks","net","absence","absenceTotal","paidAbsence","total"],"additionalProperties":false}},"totals":{"type":"object","properties":{"work":{"type":"number"},"breaks":{"type":"number"},"net":{"type":"number"},"absence":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"absenceTotal":{"type":"number"},"paidAbsence":{"type":"number"},"total":{"type":"number"}},"required":["work","breaks","net","absence","absenceTotal","paidAbsence","total"],"additionalProperties":false}},"required":["teamMemberId","name","breaksPaid","hoursFrom","days","totals"],"additionalProperties":false}},"totals":{"type":"object","properties":{"days":{"type":"object","propertyNames":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"additionalProperties":{"type":"object","properties":{"work":{"type":"number"},"breaks":{"type":"number"},"net":{"type":"number"},"absence":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"absenceTotal":{"type":"number"},"paidAbsence":{"type":"number"},"total":{"type":"number"}},"required":["work","breaks","net","absence","absenceTotal","paidAbsence","total"],"additionalProperties":false}},"totals":{"type":"object","properties":{"work":{"type":"number"},"breaks":{"type":"number"},"net":{"type":"number"},"absence":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"absenceTotal":{"type":"number"},"paidAbsence":{"type":"number"},"total":{"type":"number"}},"required":["work","breaks","net","absence","absenceTotal","paidAbsence","total"],"additionalProperties":false}},"required":["days","totals"],"additionalProperties":false},"workFiltered":{"type":"boolean"}},"required":["from","to","days","absenceTypes","rows","totals","workFiltered"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/reports/attendance/export":{"get":{"operationId":"reports.attendanceExport","summary":"The attendance matrix as CSV","tags":["Reports"],"x-permission":"report.view","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"teamId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"teamMemberId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"teamIds","in":"query","required":false,"schema":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},{"name":"teamMemberIds","in":"query","required":false,"schema":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},{"name":"clientIds","in":"query","required":false,"schema":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},{"name":"projectIds","in":"query","required":false,"schema":{"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},{"name":"templateIds","in":"query","required":false,"schema":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},{"name":"work","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","clients","internal"]}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/timesheets/settings":{"get":{"operationId":"timesheets.settings","summary":"How worked minutes are rounded","tags":["Timesheets"],"x-permission":"timesheet.self","x-module":"timesheets","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"rounding":{"type":"string","enum":["5","10","15","none"]},"roundingMode":{"type":"string","enum":["nearest","favour"]},"toleranceMinutes":{"type":"integer","minimum":0,"maximum":600}},"required":["rounding","roundingMode","toleranceMinutes"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"timesheets.updateSettings","summary":"Change the timesheet settings","tags":["Timesheets"],"x-permission":"organization.update","x-module":"timesheets","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"rounding":{"type":"string","enum":["5","10","15","none"]},"roundingMode":{"type":"string","enum":["nearest","favour"]},"toleranceMinutes":{"type":"integer","minimum":0,"maximum":600}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"rounding":{"type":"string","enum":["5","10","15","none"]},"roundingMode":{"type":"string","enum":["nearest","favour"]},"toleranceMinutes":{"type":"integer","minimum":0,"maximum":600}},"required":["rounding","roundingMode","toleranceMinutes"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/timesheets":{"get":{"operationId":"timesheets.list","summary":"Timesheets between two dates (by the day they count for), with filters","tags":["Timesheets"],"x-permission":"timesheet.view","x-module":"timesheets","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"teamMemberId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"teamId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"teamIds","in":"query","required":false,"schema":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","submitted","signed_off"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberName":{"type":"string"},"status":{"type":"string","enum":["open","submitted","signed_off"]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"startsAt":{"type":"string"},"endsAt":{"type":"string"},"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"breakMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"roundedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"booking":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["id","name","date"],"additionalProperties":false},{"type":"null"}]},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"notes":{"type":["string","null"]},"submittedAt":{"type":["string","null"]},"signedOffAt":{"type":["string","null"]},"signedOffByName":{"type":["string","null"]},"payrolled":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","teamMemberId","teamMemberName","status","date","startsAt","endsAt","start","end","endDate","breakMinutes","workedMinutes","roundedMinutes","booking","client","project","notes","submittedAt","signedOffAt","signedOffByName","payrolled","createdAt","updatedAt"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"timesheets.create","summary":"Add a timesheet for someone (submitted, or signed off straight away)","tags":["Timesheets"],"x-permission":"timesheet.manage","x-module":"timesheets","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"breakMinutes":{"default":0,"type":"integer","minimum":0,"maximum":720},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"signOff":{"default":false,"type":"boolean"}},"required":["teamMemberId","date","start","end"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberName":{"type":"string"},"status":{"type":"string","enum":["open","submitted","signed_off"]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"startsAt":{"type":"string"},"endsAt":{"type":"string"},"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"breakMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"roundedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"booking":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["id","name","date"],"additionalProperties":false},{"type":"null"}]},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"notes":{"type":["string","null"]},"submittedAt":{"type":["string","null"]},"signedOffAt":{"type":["string","null"]},"signedOffByName":{"type":["string","null"]},"payrolled":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","edited","submitted","signed_off","unsigned","deleted"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}}},"required":["id","teamMemberId","teamMemberName","status","date","startsAt","endsAt","start","end","endDate","breakMinutes","workedMinutes","roundedMinutes","booking","client","project","notes","submittedAt","signedOffAt","signedOffByName","payrolled","createdAt","updatedAt","history"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/timesheets/booked":{"get":{"operationId":"timesheets.booked","summary":"For each person and day: booked work and travel, to check timesheets against (the week grid)","tags":["Timesheets"],"x-permission":"timesheet.view","x-module":"timesheets","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"teamIds","in":"query","required":false,"schema":{"maxItems":100,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"toleranceMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"days":{"type":"array","items":{"type":"object","properties":{"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"travelMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["teamMemberId","date","bookings","bookedMinutes","travelMinutes"],"additionalProperties":false}}},"required":["toleranceMinutes","days"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/timesheets/day-bookings":{"get":{"operationId":"timesheets.dayBookings","summary":"What a team member had booked on a day, with the total, to check their timesheets against (as Xota's timesheet page)","tags":["Timesheets"],"x-permission":"timesheet.view","x-module":"timesheets","parameters":[{"name":"teamMemberId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"date","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"bookings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"clientName":{"type":"string"},"projectName":{"type":["string","null"]},"status":{"type":"string"},"start":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"end":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"minutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","clientName","projectName","status","start","end","minutes"],"additionalProperties":false}},"totalMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["date","bookings","totalMinutes"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/timesheets/export":{"get":{"operationId":"timesheets.export","summary":"Download timesheets as CSV for payroll: one row per timesheet, or one row per person per week","tags":["Timesheets"],"x-permission":"timesheet.view","x-module":"timesheets","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"format","in":"query","required":false,"schema":{"default":"entries","type":"string","enum":["entries","weekly"]}},{"name":"teamMemberId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"status","in":"query","required":false,"schema":{"default":"signed_off","type":"string","enum":["signed_off","all"]}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/timesheets/{id}":{"get":{"operationId":"timesheets.get","summary":"One timesheet, with its history","tags":["Timesheets"],"x-permission":"timesheet.view","x-module":"timesheets","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberName":{"type":"string"},"status":{"type":"string","enum":["open","submitted","signed_off"]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"startsAt":{"type":"string"},"endsAt":{"type":"string"},"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"breakMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"roundedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"booking":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["id","name","date"],"additionalProperties":false},{"type":"null"}]},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"notes":{"type":["string","null"]},"submittedAt":{"type":["string","null"]},"signedOffAt":{"type":["string","null"]},"signedOffByName":{"type":["string","null"]},"payrolled":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","edited","submitted","signed_off","unsigned","deleted"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}}},"required":["id","teamMemberId","teamMemberName","status","date","startsAt","endsAt","start","end","endDate","breakMinutes","workedMinutes","roundedMinutes","booking","client","project","notes","submittedAt","signedOffAt","signedOffByName","payrolled","createdAt","updatedAt","history"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"timesheets.update","summary":"Change a timesheet. A reason is needed when it isn't your own; a timesheet in a pay run can't change.","tags":["Timesheets"],"x-permission":"timesheet.manage","x-module":"timesheets","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"breakMinutes":{"type":"integer","minimum":0,"maximum":720},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberName":{"type":"string"},"status":{"type":"string","enum":["open","submitted","signed_off"]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"startsAt":{"type":"string"},"endsAt":{"type":"string"},"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"breakMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"roundedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"booking":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["id","name","date"],"additionalProperties":false},{"type":"null"}]},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"notes":{"type":["string","null"]},"submittedAt":{"type":["string","null"]},"signedOffAt":{"type":["string","null"]},"signedOffByName":{"type":["string","null"]},"payrolled":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","edited","submitted","signed_off","unsigned","deleted"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}}},"required":["id","teamMemberId","teamMemberName","status","date","startsAt","endsAt","start","end","endDate","breakMinutes","workedMinutes","roundedMinutes","booking","client","project","notes","submittedAt","signedOffAt","signedOffByName","payrolled","createdAt","updatedAt","history"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/timesheets/{id}/delete":{"post":{"operationId":"timesheets.remove","summary":"Delete a timesheet, with a reason (kept in its history; its holiday goes back)","tags":["Timesheets"],"x-permission":"timesheet.manage","x-module":"timesheets","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/timesheets/sign-off":{"post":{"operationId":"timesheets.signOff","summary":"Sign off submitted timesheets (one or many). Open ones are skipped.","tags":["Timesheets"],"x-permission":"timesheet.manage","x-module":"timesheets","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["ids"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"signedOff":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberName":{"type":"string"},"status":{"type":"string","enum":["open","submitted","signed_off"]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"startsAt":{"type":"string"},"endsAt":{"type":"string"},"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"breakMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"roundedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"booking":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["id","name","date"],"additionalProperties":false},{"type":"null"}]},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"notes":{"type":["string","null"]},"submittedAt":{"type":["string","null"]},"signedOffAt":{"type":["string","null"]},"signedOffByName":{"type":["string","null"]},"payrolled":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","teamMemberId","teamMemberName","status","date","startsAt","endsAt","start","end","endDate","breakMinutes","workedMinutes","roundedMinutes","booking","client","project","notes","submittedAt","signedOffAt","signedOffByName","payrolled","createdAt","updatedAt"],"additionalProperties":false}},"skipped":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string"}},"required":["id","reason"],"additionalProperties":false}}},"required":["signedOff","skipped"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/timesheets/{id}/unsign":{"post":{"operationId":"timesheets.unsign","summary":"Take a signed-off timesheet back to submitted, saying why (its holiday is taken back)","tags":["Timesheets"],"x-permission":"timesheet.manage","x-module":"timesheets","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberName":{"type":"string"},"status":{"type":"string","enum":["open","submitted","signed_off"]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"startsAt":{"type":"string"},"endsAt":{"type":"string"},"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"breakMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"roundedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"booking":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["id","name","date"],"additionalProperties":false},{"type":"null"}]},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},{"type":"null"}]},"notes":{"type":["string","null"]},"submittedAt":{"type":["string","null"]},"signedOffAt":{"type":["string","null"]},"signedOffByName":{"type":["string","null"]},"payrolled":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","edited","submitted","signed_off","unsigned","deleted"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}}},"required":["id","teamMemberId","teamMemberName","status","date","startsAt","endsAt","start","end","endDate","breakMinutes","workedMinutes","roundedMinutes","booking","client","project","notes","submittedAt","signedOffAt","signedOffByName","payrolled","createdAt","updatedAt","history"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/payroll/settings":{"get":{"operationId":"payroll.settings","summary":"How often people are paid, unless a team member says otherwise","tags":["Payroll"],"x-permission":"payroll.view","x-module":"payroll","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"payFrequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},"payFrequencies":{"minItems":1,"type":"array","items":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]}},"mileageRatePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["payFrequency","payFrequencies","mileageRatePence"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"payroll.updateSettings","summary":"Change the payroll settings","tags":["Payroll"],"x-permission":"payroll.manage","x-module":"payroll","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"payFrequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},"payFrequencies":{"minItems":1,"type":"array","items":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]}},"mileageRatePence":{"type":"integer","minimum":0,"maximum":10000}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"payFrequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},"payFrequencies":{"minItems":1,"type":"array","items":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]}},"mileageRatePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["payFrequency","payFrequencies","mileageRatePence"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/team-members/{id}/pay":{"get":{"operationId":"payroll.pay","summary":"A team member's pay: how often, and their dated hourly rates or salaries","tags":["Payroll"],"x-permission":"payroll.view","x-module":"payroll","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"payBasis":{"type":"string","enum":["hourly","salaried"]},"payFrequency":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},{"type":"null"}]},"effectiveFrequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},"mileageRatePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"effectiveMileageRatePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["hourly","salary"]},"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"note":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","effectiveFrom","amountPence","note","createdAt"],"additionalProperties":false}}},"required":["teamMemberId","payBasis","payFrequency","effectiveFrequency","mileageRatePence","effectiveMileageRatePence","rates"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"payroll.setFrequency","summary":"How often a team member is paid, and their rate per mile (null: the company’s)","tags":["Payroll"],"x-permission":"payroll.manage","x-module":"payroll","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"payFrequency":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},{"type":"null"}]},"mileageRatePence":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"payBasis":{"type":"string","enum":["hourly","salaried"]},"payFrequency":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},{"type":"null"}]},"effectiveFrequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},"mileageRatePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"effectiveMileageRatePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["hourly","salary"]},"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"note":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","effectiveFrom","amountPence","note","createdAt"],"additionalProperties":false}}},"required":["teamMemberId","payBasis","payFrequency","effectiveFrequency","mileageRatePence","effectiveMileageRatePence","rates"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/team-members/{id}/pay/rates":{"post":{"operationId":"payroll.addRate","summary":"Add an hourly rate or a yearly salary from a day (replacing one from the same day)","tags":["Payroll"],"x-permission":"payroll.manage","x-module":"payroll","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["hourly","salary"]},"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"amountPence":{"type":"integer","minimum":0,"maximum":100000000},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["kind","effectiveFrom","amountPence"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"payBasis":{"type":"string","enum":["hourly","salaried"]},"payFrequency":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},{"type":"null"}]},"effectiveFrequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},"mileageRatePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"effectiveMileageRatePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["hourly","salary"]},"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"note":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","effectiveFrom","amountPence","note","createdAt"],"additionalProperties":false}}},"required":["teamMemberId","payBasis","payFrequency","effectiveFrequency","mileageRatePence","effectiveMileageRatePence","rates"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/team-members/{id}/pay/rates/{rateId}":{"delete":{"operationId":"payroll.removeRate","summary":"Remove a rate (pay already finalised keeps what it was)","tags":["Payroll"],"x-permission":"payroll.manage","x-module":"payroll","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"rateId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"payBasis":{"type":"string","enum":["hourly","salaried"]},"payFrequency":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},{"type":"null"}]},"effectiveFrequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},"mileageRatePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"effectiveMileageRatePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["hourly","salary"]},"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"note":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","effectiveFrom","amountPence","note","createdAt"],"additionalProperties":false}}},"required":["teamMemberId","payBasis","payFrequency","effectiveFrequency","mileageRatePence","effectiveMileageRatePence","rates"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/pay-runs":{"get":{"operationId":"payRuns.list","summary":"Pay runs, newest first","tags":["Payroll"],"x-permission":"payroll.view","x-module":"payroll","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","finalised","paid"]}},{"name":"frequency","in":"query","required":false,"schema":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reference":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"status":{"type":"string","enum":["draft","finalised","paid"]},"notes":{"type":["string","null"]},"people":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"finalisedAt":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","number","reference","frequency","periodStart","periodEnd","status","notes","people","grossPence","missingRates","calculatedAt","finalisedAt","paidAt","createdAt"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"payRuns.create","summary":"Start a pay run for a period (a draft, worked out straight away)","tags":["Payroll"],"x-permission":"payroll.manage","x-module":"payroll","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["periodStart"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reference":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"status":{"type":"string","enum":["draft","finalised","paid"]},"notes":{"type":["string","null"]},"people":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"finalisedAt":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"createdAt":{"type":"string"},"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"payBasis":{"type":"string","enum":["hourly","salaried"]},"hoursFrom":{"anyOf":[{"type":"string","enum":["bookings","timesheets"]},{"type":"null"}]},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"additionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deductionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidAbsenceMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"travelMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"milesX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mileagePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"adjustmentsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["work","salary","paid_absence","unpaid_absence","bonus","overtime","expenses","mileage","other_addition","advance","loan_repayment","other_deduction","travel_time"]},"manual":{"type":"boolean"},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"days":{"type":["number","null"]},"ratePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRate":{"type":"boolean"},"late":{"type":"boolean"},"holiday":{"type":"boolean"},"miles":{"type":["number","null"]},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"timesheetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"absenceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"travelTimeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["id","kind","manual","description","date","minutes","days","ratePence","amountPence","missingRate","late","holiday","miles","bookingId","timesheetId","absenceId","travelTimeId"],"additionalProperties":false}}},"required":["id","teamMemberId","name","payBasis","hoursFrom","grossPence","additionsPence","deductionsPence","workedMinutes","paidAbsenceMinutes","missingRates","workPence","workMinutes","travelMinutes","holidayPence","holidayMinutes","sickPence","sickMinutes","milesX100","mileagePence","adjustmentsPence","missingAccepted","lines"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","recalculated","finalised","reopened","paid","line_added","line_changed","line_removed","missing_accepted"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"finaliseBlocker":{"type":["string","null"]}},"required":["id","number","reference","frequency","periodStart","periodEnd","status","notes","people","grossPence","missingRates","calculatedAt","finalisedAt","paidAt","createdAt","entries","history","finaliseBlocker"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/pay-runs/next":{"get":{"operationId":"payRuns.next","summary":"The period the next pay run would cover, and how many people are paid at that frequency","tags":["Payroll"],"x-permission":"payroll.view","x-module":"payroll","parameters":[{"name":"frequency","in":"query","required":false,"schema":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"people":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["frequency","periodStart","periodEnd","people"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/pay-runs/{id}":{"get":{"operationId":"payRuns.get","summary":"One pay run: each person, their lines and totals, and its history","tags":["Payroll"],"x-permission":"payroll.view","x-module":"payroll","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reference":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"status":{"type":"string","enum":["draft","finalised","paid"]},"notes":{"type":["string","null"]},"people":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"finalisedAt":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"createdAt":{"type":"string"},"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"payBasis":{"type":"string","enum":["hourly","salaried"]},"hoursFrom":{"anyOf":[{"type":"string","enum":["bookings","timesheets"]},{"type":"null"}]},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"additionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deductionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidAbsenceMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"travelMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"milesX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mileagePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"adjustmentsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["work","salary","paid_absence","unpaid_absence","bonus","overtime","expenses","mileage","other_addition","advance","loan_repayment","other_deduction","travel_time"]},"manual":{"type":"boolean"},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"days":{"type":["number","null"]},"ratePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRate":{"type":"boolean"},"late":{"type":"boolean"},"holiday":{"type":"boolean"},"miles":{"type":["number","null"]},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"timesheetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"absenceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"travelTimeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["id","kind","manual","description","date","minutes","days","ratePence","amountPence","missingRate","late","holiday","miles","bookingId","timesheetId","absenceId","travelTimeId"],"additionalProperties":false}}},"required":["id","teamMemberId","name","payBasis","hoursFrom","grossPence","additionsPence","deductionsPence","workedMinutes","paidAbsenceMinutes","missingRates","workPence","workMinutes","travelMinutes","holidayPence","holidayMinutes","sickPence","sickMinutes","milesX100","mileagePence","adjustmentsPence","missingAccepted","lines"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","recalculated","finalised","reopened","paid","line_added","line_changed","line_removed","missing_accepted"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"finaliseBlocker":{"type":["string","null"]}},"required":["id","number","reference","frequency","periodStart","periodEnd","status","notes","people","grossPence","missingRates","calculatedAt","finalisedAt","paidAt","createdAt","entries","history","finaliseBlocker"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"payRuns.update","summary":"Change a pay run's notes","tags":["Payroll"],"x-permission":"payroll.manage","x-module":"payroll","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reference":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"status":{"type":"string","enum":["draft","finalised","paid"]},"notes":{"type":["string","null"]},"people":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"finalisedAt":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"createdAt":{"type":"string"},"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"payBasis":{"type":"string","enum":["hourly","salaried"]},"hoursFrom":{"anyOf":[{"type":"string","enum":["bookings","timesheets"]},{"type":"null"}]},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"additionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deductionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidAbsenceMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"travelMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"milesX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mileagePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"adjustmentsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["work","salary","paid_absence","unpaid_absence","bonus","overtime","expenses","mileage","other_addition","advance","loan_repayment","other_deduction","travel_time"]},"manual":{"type":"boolean"},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"days":{"type":["number","null"]},"ratePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRate":{"type":"boolean"},"late":{"type":"boolean"},"holiday":{"type":"boolean"},"miles":{"type":["number","null"]},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"timesheetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"absenceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"travelTimeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["id","kind","manual","description","date","minutes","days","ratePence","amountPence","missingRate","late","holiday","miles","bookingId","timesheetId","absenceId","travelTimeId"],"additionalProperties":false}}},"required":["id","teamMemberId","name","payBasis","hoursFrom","grossPence","additionsPence","deductionsPence","workedMinutes","paidAbsenceMinutes","missingRates","workPence","workMinutes","travelMinutes","holidayPence","holidayMinutes","sickPence","sickMinutes","milesX100","mileagePence","adjustmentsPence","missingAccepted","lines"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","recalculated","finalised","reopened","paid","line_added","line_changed","line_removed","missing_accepted"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"finaliseBlocker":{"type":["string","null"]}},"required":["id","number","reference","frequency","periodStart","periodEnd","status","notes","people","grossPence","missingRates","calculatedAt","finalisedAt","paidAt","createdAt","entries","history","finaliseBlocker"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"payRuns.remove","summary":"Delete a draft pay run (what it held is free again)","tags":["Payroll"],"x-permission":"payroll.manage","x-module":"payroll","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/pay-runs/{id}/recalculate":{"post":{"operationId":"payRuns.recalculate","summary":"Work a draft out again from bookings, timesheets, absences and rates (lines added by hand stay)","tags":["Payroll"],"x-permission":"payroll.manage","x-module":"payroll","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reference":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"status":{"type":"string","enum":["draft","finalised","paid"]},"notes":{"type":["string","null"]},"people":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"finalisedAt":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"createdAt":{"type":"string"},"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"payBasis":{"type":"string","enum":["hourly","salaried"]},"hoursFrom":{"anyOf":[{"type":"string","enum":["bookings","timesheets"]},{"type":"null"}]},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"additionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deductionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidAbsenceMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"travelMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"milesX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mileagePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"adjustmentsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["work","salary","paid_absence","unpaid_absence","bonus","overtime","expenses","mileage","other_addition","advance","loan_repayment","other_deduction","travel_time"]},"manual":{"type":"boolean"},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"days":{"type":["number","null"]},"ratePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRate":{"type":"boolean"},"late":{"type":"boolean"},"holiday":{"type":"boolean"},"miles":{"type":["number","null"]},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"timesheetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"absenceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"travelTimeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["id","kind","manual","description","date","minutes","days","ratePence","amountPence","missingRate","late","holiday","miles","bookingId","timesheetId","absenceId","travelTimeId"],"additionalProperties":false}}},"required":["id","teamMemberId","name","payBasis","hoursFrom","grossPence","additionsPence","deductionsPence","workedMinutes","paidAbsenceMinutes","missingRates","workPence","workMinutes","travelMinutes","holidayPence","holidayMinutes","sickPence","sickMinutes","milesX100","mileagePence","adjustmentsPence","missingAccepted","lines"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","recalculated","finalised","reopened","paid","line_added","line_changed","line_removed","missing_accepted"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"finaliseBlocker":{"type":["string","null"]}},"required":["id","number","reference","frequency","periodStart","periodEnd","status","notes","people","grossPence","missingRates","calculatedAt","finalisedAt","paidAt","createdAt","entries","history","finaliseBlocker"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/pay-runs/{id}/finalise":{"post":{"operationId":"payRuns.finalise","summary":"Finalise a draft: worked out one last time, then it and everything in it is locked","tags":["Payroll"],"x-permission":"payroll.manage","x-module":"payroll","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reference":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"status":{"type":"string","enum":["draft","finalised","paid"]},"notes":{"type":["string","null"]},"people":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"finalisedAt":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"createdAt":{"type":"string"},"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"payBasis":{"type":"string","enum":["hourly","salaried"]},"hoursFrom":{"anyOf":[{"type":"string","enum":["bookings","timesheets"]},{"type":"null"}]},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"additionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deductionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidAbsenceMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"travelMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"milesX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mileagePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"adjustmentsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["work","salary","paid_absence","unpaid_absence","bonus","overtime","expenses","mileage","other_addition","advance","loan_repayment","other_deduction","travel_time"]},"manual":{"type":"boolean"},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"days":{"type":["number","null"]},"ratePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRate":{"type":"boolean"},"late":{"type":"boolean"},"holiday":{"type":"boolean"},"miles":{"type":["number","null"]},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"timesheetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"absenceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"travelTimeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["id","kind","manual","description","date","minutes","days","ratePence","amountPence","missingRate","late","holiday","miles","bookingId","timesheetId","absenceId","travelTimeId"],"additionalProperties":false}}},"required":["id","teamMemberId","name","payBasis","hoursFrom","grossPence","additionsPence","deductionsPence","workedMinutes","paidAbsenceMinutes","missingRates","workPence","workMinutes","travelMinutes","holidayPence","holidayMinutes","sickPence","sickMinutes","milesX100","mileagePence","adjustmentsPence","missingAccepted","lines"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","recalculated","finalised","reopened","paid","line_added","line_changed","line_removed","missing_accepted"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"finaliseBlocker":{"type":["string","null"]}},"required":["id","number","reference","frequency","periodStart","periodEnd","status","notes","people","grossPence","missingRates","calculatedAt","finalisedAt","paidAt","createdAt","entries","history","finaliseBlocker"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/pay-runs/{id}/reopen":{"post":{"operationId":"payRuns.reopen","summary":"Take a finalised run back to draft, saying why (not once paid)","tags":["Payroll"],"x-permission":"payroll.manage","x-module":"payroll","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reference":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"status":{"type":"string","enum":["draft","finalised","paid"]},"notes":{"type":["string","null"]},"people":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"finalisedAt":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"createdAt":{"type":"string"},"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"payBasis":{"type":"string","enum":["hourly","salaried"]},"hoursFrom":{"anyOf":[{"type":"string","enum":["bookings","timesheets"]},{"type":"null"}]},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"additionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deductionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidAbsenceMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"travelMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"milesX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mileagePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"adjustmentsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["work","salary","paid_absence","unpaid_absence","bonus","overtime","expenses","mileage","other_addition","advance","loan_repayment","other_deduction","travel_time"]},"manual":{"type":"boolean"},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"days":{"type":["number","null"]},"ratePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRate":{"type":"boolean"},"late":{"type":"boolean"},"holiday":{"type":"boolean"},"miles":{"type":["number","null"]},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"timesheetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"absenceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"travelTimeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["id","kind","manual","description","date","minutes","days","ratePence","amountPence","missingRate","late","holiday","miles","bookingId","timesheetId","absenceId","travelTimeId"],"additionalProperties":false}}},"required":["id","teamMemberId","name","payBasis","hoursFrom","grossPence","additionsPence","deductionsPence","workedMinutes","paidAbsenceMinutes","missingRates","workPence","workMinutes","travelMinutes","holidayPence","holidayMinutes","sickPence","sickMinutes","milesX100","mileagePence","adjustmentsPence","missingAccepted","lines"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","recalculated","finalised","reopened","paid","line_added","line_changed","line_removed","missing_accepted"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"finaliseBlocker":{"type":["string","null"]}},"required":["id","number","reference","frequency","periodStart","periodEnd","status","notes","people","grossPence","missingRates","calculatedAt","finalisedAt","paidAt","createdAt","entries","history","finaliseBlocker"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/pay-runs/{id}/paid":{"post":{"operationId":"payRuns.markPaid","summary":"Mark a finalised run as paid (final)","tags":["Payroll"],"x-permission":"payroll.manage","x-module":"payroll","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reference":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"status":{"type":"string","enum":["draft","finalised","paid"]},"notes":{"type":["string","null"]},"people":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"finalisedAt":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"createdAt":{"type":"string"},"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"payBasis":{"type":"string","enum":["hourly","salaried"]},"hoursFrom":{"anyOf":[{"type":"string","enum":["bookings","timesheets"]},{"type":"null"}]},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"additionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deductionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidAbsenceMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"travelMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"milesX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mileagePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"adjustmentsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["work","salary","paid_absence","unpaid_absence","bonus","overtime","expenses","mileage","other_addition","advance","loan_repayment","other_deduction","travel_time"]},"manual":{"type":"boolean"},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"days":{"type":["number","null"]},"ratePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRate":{"type":"boolean"},"late":{"type":"boolean"},"holiday":{"type":"boolean"},"miles":{"type":["number","null"]},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"timesheetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"absenceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"travelTimeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["id","kind","manual","description","date","minutes","days","ratePence","amountPence","missingRate","late","holiday","miles","bookingId","timesheetId","absenceId","travelTimeId"],"additionalProperties":false}}},"required":["id","teamMemberId","name","payBasis","hoursFrom","grossPence","additionsPence","deductionsPence","workedMinutes","paidAbsenceMinutes","missingRates","workPence","workMinutes","travelMinutes","holidayPence","holidayMinutes","sickPence","sickMinutes","milesX100","mileagePence","adjustmentsPence","missingAccepted","lines"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","recalculated","finalised","reopened","paid","line_added","line_changed","line_removed","missing_accepted"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"finaliseBlocker":{"type":["string","null"]}},"required":["id","number","reference","frequency","periodStart","periodEnd","status","notes","people","grossPence","missingRates","calculatedAt","finalisedAt","paidAt","createdAt","entries","history","finaliseBlocker"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/pay-runs/{id}/lines":{"post":{"operationId":"payRuns.addLine","summary":"Add an addition (bonus, expenses …) or a deduction (advance …) for someone in a draft","tags":["Payroll"],"x-permission":"payroll.manage","x-module":"payroll","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["bonus","overtime","expenses","other_addition","advance","loan_repayment","other_deduction"]},"description":{"type":"string","minLength":1,"maxLength":300},"amountPence":{"type":"integer","minimum":0,"maximum":100000000},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["teamMemberId","kind","description","amountPence"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reference":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"status":{"type":"string","enum":["draft","finalised","paid"]},"notes":{"type":["string","null"]},"people":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"finalisedAt":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"createdAt":{"type":"string"},"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"payBasis":{"type":"string","enum":["hourly","salaried"]},"hoursFrom":{"anyOf":[{"type":"string","enum":["bookings","timesheets"]},{"type":"null"}]},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"additionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deductionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidAbsenceMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"travelMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"milesX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mileagePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"adjustmentsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["work","salary","paid_absence","unpaid_absence","bonus","overtime","expenses","mileage","other_addition","advance","loan_repayment","other_deduction","travel_time"]},"manual":{"type":"boolean"},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"days":{"type":["number","null"]},"ratePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRate":{"type":"boolean"},"late":{"type":"boolean"},"holiday":{"type":"boolean"},"miles":{"type":["number","null"]},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"timesheetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"absenceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"travelTimeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["id","kind","manual","description","date","minutes","days","ratePence","amountPence","missingRate","late","holiday","miles","bookingId","timesheetId","absenceId","travelTimeId"],"additionalProperties":false}}},"required":["id","teamMemberId","name","payBasis","hoursFrom","grossPence","additionsPence","deductionsPence","workedMinutes","paidAbsenceMinutes","missingRates","workPence","workMinutes","travelMinutes","holidayPence","holidayMinutes","sickPence","sickMinutes","milesX100","mileagePence","adjustmentsPence","missingAccepted","lines"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","recalculated","finalised","reopened","paid","line_added","line_changed","line_removed","missing_accepted"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"finaliseBlocker":{"type":["string","null"]}},"required":["id","number","reference","frequency","periodStart","periodEnd","status","notes","people","grossPence","missingRates","calculatedAt","finalisedAt","paidAt","createdAt","entries","history","finaliseBlocker"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/pay-runs/{id}/lines/{lineId}":{"patch":{"operationId":"payRuns.updateLine","summary":"Change a line added by hand","tags":["Payroll"],"x-permission":"payroll.manage","x-module":"payroll","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"lineId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["bonus","overtime","expenses","other_addition","advance","loan_repayment","other_deduction"]},"description":{"type":"string","minLength":1,"maxLength":300},"amountPence":{"type":"integer","minimum":0,"maximum":100000000},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reference":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"status":{"type":"string","enum":["draft","finalised","paid"]},"notes":{"type":["string","null"]},"people":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"finalisedAt":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"createdAt":{"type":"string"},"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"payBasis":{"type":"string","enum":["hourly","salaried"]},"hoursFrom":{"anyOf":[{"type":"string","enum":["bookings","timesheets"]},{"type":"null"}]},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"additionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deductionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidAbsenceMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"travelMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"milesX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mileagePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"adjustmentsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["work","salary","paid_absence","unpaid_absence","bonus","overtime","expenses","mileage","other_addition","advance","loan_repayment","other_deduction","travel_time"]},"manual":{"type":"boolean"},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"days":{"type":["number","null"]},"ratePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRate":{"type":"boolean"},"late":{"type":"boolean"},"holiday":{"type":"boolean"},"miles":{"type":["number","null"]},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"timesheetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"absenceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"travelTimeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["id","kind","manual","description","date","minutes","days","ratePence","amountPence","missingRate","late","holiday","miles","bookingId","timesheetId","absenceId","travelTimeId"],"additionalProperties":false}}},"required":["id","teamMemberId","name","payBasis","hoursFrom","grossPence","additionsPence","deductionsPence","workedMinutes","paidAbsenceMinutes","missingRates","workPence","workMinutes","travelMinutes","holidayPence","holidayMinutes","sickPence","sickMinutes","milesX100","mileagePence","adjustmentsPence","missingAccepted","lines"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","recalculated","finalised","reopened","paid","line_added","line_changed","line_removed","missing_accepted"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"finaliseBlocker":{"type":["string","null"]}},"required":["id","number","reference","frequency","periodStart","periodEnd","status","notes","people","grossPence","missingRates","calculatedAt","finalisedAt","paidAt","createdAt","entries","history","finaliseBlocker"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"payRuns.removeLine","summary":"Remove a line added by hand","tags":["Payroll"],"x-permission":"payroll.manage","x-module":"payroll","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"lineId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reference":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"status":{"type":"string","enum":["draft","finalised","paid"]},"notes":{"type":["string","null"]},"people":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"finalisedAt":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"createdAt":{"type":"string"},"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"payBasis":{"type":"string","enum":["hourly","salaried"]},"hoursFrom":{"anyOf":[{"type":"string","enum":["bookings","timesheets"]},{"type":"null"}]},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"additionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deductionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidAbsenceMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"travelMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"milesX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mileagePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"adjustmentsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["work","salary","paid_absence","unpaid_absence","bonus","overtime","expenses","mileage","other_addition","advance","loan_repayment","other_deduction","travel_time"]},"manual":{"type":"boolean"},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"days":{"type":["number","null"]},"ratePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRate":{"type":"boolean"},"late":{"type":"boolean"},"holiday":{"type":"boolean"},"miles":{"type":["number","null"]},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"timesheetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"absenceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"travelTimeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["id","kind","manual","description","date","minutes","days","ratePence","amountPence","missingRate","late","holiday","miles","bookingId","timesheetId","absenceId","travelTimeId"],"additionalProperties":false}}},"required":["id","teamMemberId","name","payBasis","hoursFrom","grossPence","additionsPence","deductionsPence","workedMinutes","paidAbsenceMinutes","missingRates","workPence","workMinutes","travelMinutes","holidayPence","holidayMinutes","sickPence","sickMinutes","milesX100","mileagePence","adjustmentsPence","missingAccepted","lines"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","recalculated","finalised","reopened","paid","line_added","line_changed","line_removed","missing_accepted"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"finaliseBlocker":{"type":["string","null"]}},"required":["id","number","reference","frequency","periodStart","periodEnd","status","notes","people","grossPence","missingRates","calculatedAt","finalisedAt","paidAt","createdAt","entries","history","finaliseBlocker"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/pay-runs/{id}/entries/{entryId}/accept-missing":{"post":{"operationId":"payRuns.acceptMissing","summary":"Accept someone's pay with a missing rate as it is (or take that back), so the run can be finalised","tags":["Payroll"],"x-permission":"payroll.manage","x-module":"payroll","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"entryId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accepted":{"type":"boolean"}},"required":["accepted"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reference":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"status":{"type":"string","enum":["draft","finalised","paid"]},"notes":{"type":["string","null"]},"people":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"finalisedAt":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"createdAt":{"type":"string"},"entries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"payBasis":{"type":"string","enum":["hourly","salaried"]},"hoursFrom":{"anyOf":[{"type":"string","enum":["bookings","timesheets"]},{"type":"null"}]},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"additionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"deductionsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workedMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidAbsenceMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"workMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"travelMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holidayMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sickMinutes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"milesX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"mileagePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"adjustmentsPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["work","salary","paid_absence","unpaid_absence","bonus","overtime","expenses","mileage","other_addition","advance","loan_repayment","other_deduction","travel_time"]},"manual":{"type":"boolean"},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"minutes":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"days":{"type":["number","null"]},"ratePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingRate":{"type":"boolean"},"late":{"type":"boolean"},"holiday":{"type":"boolean"},"miles":{"type":["number","null"]},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"timesheetId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"absenceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"travelTimeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["id","kind","manual","description","date","minutes","days","ratePence","amountPence","missingRate","late","holiday","miles","bookingId","timesheetId","absenceId","travelTimeId"],"additionalProperties":false}}},"required":["id","teamMemberId","name","payBasis","hoursFrom","grossPence","additionsPence","deductionsPence","workedMinutes","paidAbsenceMinutes","missingRates","workPence","workMinutes","travelMinutes","holidayPence","holidayMinutes","sickPence","sickMinutes","milesX100","mileagePence","adjustmentsPence","missingAccepted","lines"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","recalculated","finalised","reopened","paid","line_added","line_changed","line_removed","missing_accepted"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"finaliseBlocker":{"type":["string","null"]}},"required":["id","number","reference","frequency","periodStart","periodEnd","status","notes","people","grossPence","missingRates","calculatedAt","finalisedAt","paidAt","createdAt","entries","history","finaliseBlocker"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/pay-runs/{id}/export":{"get":{"operationId":"payRuns.export","summary":"Download a pay run as CSV for a payroll provider or accountant: one row per person, or every line","tags":["Payroll"],"x-permission":"payroll.view","x-module":"payroll","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"format","in":"query","required":false,"schema":{"default":"people","type":"string","enum":["people","lines"]}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoicing/frequencies":{"get":{"operationId":"invoicing.frequenciesInUse","summary":"The billing frequencies in use: the company's, clients billed differently, and invoices made","tags":["Invoicing"],"x-permission":"invoice.view","x-module":"invoicing","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"frequencies":{"type":"array","items":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]}}},"required":["frequencies"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoicing/settings":{"get":{"operationId":"invoicing.settings","summary":"How clients are billed unless they say otherwise, VAT, numbering, payment terms and details","tags":["Invoicing"],"x-permission":"invoice.view","x-module":"invoicing","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"billingFrequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"billingBasis":{"type":"string","enum":["bookings","fixed"]},"vatRegistered":{"type":"boolean"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invoicePrefix":{"type":"string"},"nextInvoiceNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paymentTermsDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paymentDetails":{"type":["string","null"]},"invoiceTerms":{"type":"string"},"invoicePhotos":{"type":"boolean"},"invoiceSignedOffOnly":{"type":"boolean"},"creditPrefix":{"type":"string"},"nextCreditNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["billingFrequency","billingBasis","vatRegistered","vatRateBp","invoicePrefix","nextInvoiceNumber","paymentTermsDays","paymentDetails","invoiceTerms","invoicePhotos","invoiceSignedOffOnly","creditPrefix","nextCreditNumber"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"invoicing.updateSettings","summary":"Change the invoicing settings","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"billingFrequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"billingBasis":{"type":"string","enum":["bookings","fixed"]},"vatRegistered":{"type":"boolean"},"vatRateBp":{"type":"integer","minimum":0,"maximum":10000},"invoicePrefix":{"type":"string","maxLength":20,"pattern":"^[A-Za-z0-9/_.-]*$"},"nextInvoiceNumber":{"type":"integer","minimum":1,"maximum":99999999},"paymentTermsDays":{"type":"integer","minimum":0,"maximum":365},"paymentDetails":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"invoiceTerms":{"type":"string","maxLength":5000},"invoicePhotos":{"type":"boolean"},"invoiceSignedOffOnly":{"type":"boolean"},"creditPrefix":{"type":"string","maxLength":20,"pattern":"^[A-Za-z0-9/_.-]*$"},"nextCreditNumber":{"type":"integer","minimum":1,"maximum":99999999}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"billingFrequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"billingBasis":{"type":"string","enum":["bookings","fixed"]},"vatRegistered":{"type":"boolean"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invoicePrefix":{"type":"string"},"nextInvoiceNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paymentTermsDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paymentDetails":{"type":["string","null"]},"invoiceTerms":{"type":"string"},"invoicePhotos":{"type":"boolean"},"invoiceSignedOffOnly":{"type":"boolean"},"creditPrefix":{"type":"string"},"nextCreditNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["billingFrequency","billingBasis","vatRegistered","vatRateBp","invoicePrefix","nextInvoiceNumber","paymentTermsDays","paymentDetails","invoiceTerms","invoicePhotos","invoiceSignedOffOnly","creditPrefix","nextCreditNumber"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clients/{id}/billing":{"get":{"operationId":"invoicing.billing","summary":"A client's billing: how often, on what basis, when its next period starts, and its dated fixed amounts","tags":["Invoicing"],"x-permission":"invoice.view","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"billingFrequency":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},{"type":"null"}]},"billingBasis":{"anyOf":[{"type":"string","enum":["bookings","fixed"]},{"type":"null"}]},"effectiveFrequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"effectiveBasis":{"type":"string","enum":["bookings","fixed"]},"nextPeriodStart":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"billingCycleEnd":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextPeriod":{"anyOf":[{"type":"object","properties":{"start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start","end"],"additionalProperties":false},{"type":"null"}]},"fixedAmounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"note":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","effectiveFrom","amountPence","note","createdAt"],"additionalProperties":false}},"listCoveredVisits":{"type":"boolean"}},"required":["clientId","billingFrequency","billingBasis","effectiveFrequency","effectiveBasis","nextPeriodStart","billingCycleEnd","nextPeriod","fixedAmounts","listCoveredVisits"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"invoicing.updateBilling","summary":"Change how a client is billed (null: the company's) and when its next period starts","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"billingFrequency":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},{"type":"null"}]},"billingBasis":{"anyOf":[{"type":"string","enum":["bookings","fixed"]},{"type":"null"}]},"nextPeriodStart":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"billingCycleEnd":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"listCoveredVisits":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"billingFrequency":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},{"type":"null"}]},"billingBasis":{"anyOf":[{"type":"string","enum":["bookings","fixed"]},{"type":"null"}]},"effectiveFrequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"effectiveBasis":{"type":"string","enum":["bookings","fixed"]},"nextPeriodStart":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"billingCycleEnd":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextPeriod":{"anyOf":[{"type":"object","properties":{"start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start","end"],"additionalProperties":false},{"type":"null"}]},"fixedAmounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"note":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","effectiveFrom","amountPence","note","createdAt"],"additionalProperties":false}},"listCoveredVisits":{"type":"boolean"}},"required":["clientId","billingFrequency","billingBasis","effectiveFrequency","effectiveBasis","nextPeriodStart","billingCycleEnd","nextPeriod","fixedAmounts","listCoveredVisits"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoicing/billing-cycle":{"post":{"operationId":"invoicing.setBillingCycle","summary":"Give several fortnightly or 4-weekly clients the same billing date (the last day of one of their periods), or clear it (null). Clients billed otherwise are skipped.","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"clientIds":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"billingCycleEnd":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["clientIds","billingCycleEnd"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"updated":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"array","items":{"type":"object","properties":{"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"reason":{"type":"string"}},"required":["clientId","name","reason"],"additionalProperties":false}}},"required":["updated","skipped"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clients/{id}/billing/amounts":{"post":{"operationId":"invoicing.addFixedAmount","summary":"Add a fixed amount a period from a day (replacing one from the same day)","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"amountPence":{"type":"integer","minimum":0,"maximum":100000000},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["effectiveFrom","amountPence"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"billingFrequency":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},{"type":"null"}]},"billingBasis":{"anyOf":[{"type":"string","enum":["bookings","fixed"]},{"type":"null"}]},"effectiveFrequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"effectiveBasis":{"type":"string","enum":["bookings","fixed"]},"nextPeriodStart":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"billingCycleEnd":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextPeriod":{"anyOf":[{"type":"object","properties":{"start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start","end"],"additionalProperties":false},{"type":"null"}]},"fixedAmounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"note":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","effectiveFrom","amountPence","note","createdAt"],"additionalProperties":false}},"listCoveredVisits":{"type":"boolean"}},"required":["clientId","billingFrequency","billingBasis","effectiveFrequency","effectiveBasis","nextPeriodStart","billingCycleEnd","nextPeriod","fixedAmounts","listCoveredVisits"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clients/{id}/billing/amounts/{amountId}":{"delete":{"operationId":"invoicing.removeFixedAmount","summary":"Remove a fixed amount (issued invoices keep what they were)","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"amountId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"billingFrequency":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},{"type":"null"}]},"billingBasis":{"anyOf":[{"type":"string","enum":["bookings","fixed"]},{"type":"null"}]},"effectiveFrequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"effectiveBasis":{"type":"string","enum":["bookings","fixed"]},"nextPeriodStart":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"billingCycleEnd":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextPeriod":{"anyOf":[{"type":"object","properties":{"start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start","end"],"additionalProperties":false},{"type":"null"}]},"fixedAmounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"note":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","effectiveFrom","amountPence","note","createdAt"],"additionalProperties":false}},"listCoveredVisits":{"type":"boolean"}},"required":["clientId","billingFrequency","billingBasis","effectiveFrequency","effectiveBasis","nextPeriodStart","billingCycleEnd","nextPeriod","fixedAmounts","listCoveredVisits"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices":{"get":{"operationId":"invoices.list","summary":"Invoices, newest first","tags":["Invoicing"],"x-permission":"invoice.view","x-module":"invoicing","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","issued","paid","void"]}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"frequency","in":"query","required":false,"schema":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","paid","void"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"manual":{"default":false,"type":"boolean"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"default":null,"type":["string","null"]},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"paidOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"coveredBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"notes":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"creditedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","number","reference","status","clientId","clientName","frequency","basis","periodStart","periodEnd","manual","projectId","projectName","issueDate","dueDate","paidOn","netPence","vatPence","grossPence","missingPrices","bookings","coveredBookings","lateBookings","bookedPence","fixedPence","manualPence","missingAccepted","notes","voidReason","creditedPence","amountDuePence","calculatedAt","createdAt"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"invoices.create","summary":"Start an invoice for a client and period (a draft, worked out straight away)","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"chargeIds":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"manual":{"default":false,"type":"boolean"},"bookingIds":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["clientId","periodStart"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","paid","void"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"manual":{"default":false,"type":"boolean"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"default":null,"type":["string","null"]},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"paidOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"coveredBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"notes":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"creditedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["booking","fixed","manual","product"]},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"quantity":{"type":"number"},"unitPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrice":{"type":"boolean"},"late":{"type":"boolean"},"covered":{"type":"boolean"},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateOverrideBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"photoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hiddenPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsignedPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","kind","description","date","projectId","projectName","quantity","unitPence","netPence","vatRateBp","vatPence","missingPrice","late","covered","bookingId","chargePence","vatRateOverrideBp","photoCount","hiddenPhotoCount","unsignedPhotoCount"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","issued","paid","voided","line_added","line_changed","line_removed","missing_accepted","notes","credit_raised","credit_issued","credit_voided","credit_deleted","refunded","refund_removed"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"issueBlocker":{"type":["string","null"]},"unsignedBookings":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"listCoveredVisits":{"default":true,"type":"boolean"},"from":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"paymentDetails":{"type":["string","null"]},"hasLogo":{"type":"boolean"}},"required":["name","address","email","phone","website","companyNumber","vatNumber","paymentDetails","hasLogo"],"additionalProperties":false},"to":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","address","email","phone"],"additionalProperties":false},"vatRegistered":{"type":"boolean"},"terms":{"type":["string","null"]},"includePhotos":{"default":false,"type":"boolean"},"photos":{"default":[],"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":"string"},"projectName":{"type":["string","null"]},"teamMemberName":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"caption":{"type":["string","null"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","caption","width","height","thumbUrl","fullUrl"],"additionalProperties":false}}},"required":["bookingId","date","start","end","name","projectName","teamMemberName","photos"],"additionalProperties":false}},"credits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt"],"additionalProperties":false}},"refunds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"type":["string","null"]},"note":{"type":["string","null"]},"byName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","amountPence","refundedOn","method","note","byName","createdAt"],"additionalProperties":false}},"refundedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditLeftPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditableLines":{"type":"array","items":{"type":"object","properties":{"invoiceLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingNetPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingVatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoiceLineId","description","vatRateBp","netPence","vatPence","remainingNetPence","remainingVatPence"],"additionalProperties":false}}},"required":["id","number","reference","status","clientId","clientName","frequency","basis","periodStart","periodEnd","manual","projectId","projectName","issueDate","dueDate","paidOn","netPence","vatPence","grossPence","missingPrices","bookings","coveredBookings","lateBookings","bookedPence","fixedPence","manualPence","missingAccepted","notes","voidReason","creditedPence","amountDuePence","calculatedAt","createdAt","lines","history","issueBlocker","unsignedBookings","listCoveredVisits","from","to","vatRegistered","terms","includePhotos","photos","credits","refunds","refundedPence","refundDuePence","creditLeftPence","creditableLines"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/export":{"get":{"operationId":"invoices.export","summary":"Download invoices as CSV for an accounts package: one row per invoice, or every line","tags":["Invoicing"],"x-permission":"invoice.view","x-module":"invoicing","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","issued","paid","void"]}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"frequency","in":"query","required":false,"schema":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"format","in":"query","required":false,"schema":{"default":"invoices","type":"string","enum":["invoices","lines","credits"]}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/run":{"get":{"operationId":"invoices.run","summary":"The invoice run: each client billed at a frequency, its period, what it would be charged, and any invoice already made for it","tags":["Invoicing"],"x-permission":"invoice.view","x-module":"invoicing","parameters":[{"name":"frequency","in":"query","required":false,"schema":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]}},{"name":"dueBy","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"dueBy":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"rows":{"type":"array","items":{"type":"object","properties":{"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"periodEnd":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"due":{"type":"boolean"},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"products":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"productPence":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ordersToRecharge":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"waitingSignOff":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"waitingSignOffFrom":{"default":null,"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"toChargePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invoice":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","issued","paid","void"]},"reference":{"type":["string","null"]},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","status","reference","grossPence"],"additionalProperties":false},{"type":"null"}]}},"required":["clientId","clientName","frequency","basis","periodStart","periodEnd","due","bookings","lateBookings","bookedPence","fixedPence","products","productPence","ordersToRecharge","waitingSignOff","waitingSignOffFrom","toChargePence","missingPrices","invoice"],"additionalProperties":false}}},"required":["dueBy","rows"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"invoices.createDrafts","summary":"Make draft invoices for chosen clients for their due periods","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"clientIds":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"dueBy":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"includeCharges":{"default":true,"type":"boolean"},"skipChargeIds":{"default":[],"maxItems":5000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["clientIds"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"created":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","paid","void"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"manual":{"default":false,"type":"boolean"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"default":null,"type":["string","null"]},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"paidOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"coveredBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"notes":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"creditedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","number","reference","status","clientId","clientName","frequency","basis","periodStart","periodEnd","manual","projectId","projectName","issueDate","dueDate","paidOn","netPence","vatPence","grossPence","missingPrices","bookings","coveredBookings","lateBookings","bookedPence","fixedPence","manualPence","missingAccepted","notes","voidReason","creditedPence","amountDuePence","calculatedAt","createdAt"],"additionalProperties":false}},"skipped":{"type":"array","items":{"type":"object","properties":{"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"reason":{"type":"string"}},"required":["clientId","clientName","reason"],"additionalProperties":false}}},"required":["created","skipped"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/run/preview":{"get":{"operationId":"invoices.runPreview","summary":"One client's due period in the run, line by line, before a draft is made","tags":["Invoicing"],"x-permission":"invoice.view","x-module":"invoicing","parameters":[{"name":"clientId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"dueBy","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"periodEnd":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"due":{"type":"boolean"},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"products":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"productPence":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ordersToRecharge":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"waitingSignOff":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"waitingSignOffFrom":{"default":null,"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"toChargePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"invoice":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","issued","paid","void"]},"reference":{"type":["string","null"]},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","status","reference","grossPence"],"additionalProperties":false},{"type":"null"}]},"dueBy":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"lines":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["booking","fixed","manual","product"]},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"unitPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrice":{"type":"boolean"},"late":{"type":"boolean"},"covered":{"type":"boolean"},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["kind","description","date","projectName","unitPence","netPence","vatRateBp","vatPence","missingPrice","late","covered","bookingId"],"additionalProperties":false}},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"charges":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"projectName":{"type":["string","null"]}},"required":["id","date","description","quantityX100","unitPence","netPence","projectName"],"additionalProperties":false}}},"required":["clientId","clientName","frequency","basis","periodStart","periodEnd","due","bookings","lateBookings","bookedPence","fixedPence","products","productPence","ordersToRecharge","waitingSignOff","waitingSignOffFrom","toChargePence","missingPrices","invoice","dueBy","lines","netPence","vatPence","grossPence","charges"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/run/export":{"get":{"operationId":"invoices.runExport","summary":"The invoice run as CSV","tags":["Invoicing"],"x-permission":"invoice.view","x-module":"invoicing","parameters":[{"name":"frequency","in":"query","required":false,"schema":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]}},{"name":"dueBy","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/issue":{"post":{"operationId":"invoices.issueMany","summary":"Issue several drafts at once (each worked out one last time); says which could not be issued and why","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"send":{"default":false,"type":"boolean"}},"required":["ids"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"issued":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","paid","void"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"manual":{"default":false,"type":"boolean"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"default":null,"type":["string","null"]},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"paidOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"coveredBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"notes":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"creditedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","number","reference","status","clientId","clientName","frequency","basis","periodStart","periodEnd","manual","projectId","projectName","issueDate","dueDate","paidOn","netPence","vatPence","grossPence","missingPrices","bookings","coveredBookings","lateBookings","bookedPence","fixedPence","manualPence","missingAccepted","notes","voidReason","creditedPence","amountDuePence","calculatedAt","createdAt"],"additionalProperties":false}},"refused":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"reason":{"type":"string"}},"required":["id","clientName","reason"],"additionalProperties":false}},"emailed":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"to":{"type":"string"},"status":{"type":"string"}},"required":["id","to","status"],"additionalProperties":false}},"notEmailed":{"default":[],"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"reason":{"type":"string"}},"required":["id","clientName","reason"],"additionalProperties":false}}},"required":["issued","refused","emailed","notEmailed"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/uninvoiced":{"get":{"operationId":"invoices.uninvoiced","summary":"Finished bookings not on an issued invoice: the check that nothing is missed","tags":["Invoicing"],"x-permission":"invoice.view","x-module":"invoicing","parameters":[{"name":"clientId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"includeSkipped","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"name":{"type":"string"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"teamMemberName":{"type":["string","null"]},"status":{"type":"string"},"pricePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"ageDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"draftInvoiceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"skippedReason":{"type":["string","null"]}},"required":["id","date","name","clientId","clientName","projectId","projectName","teamMemberName","status","pricePence","ageDays","draftInvoiceId","skippedReason"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/uninvoiced/skip":{"post":{"operationId":"invoices.skip","summary":"Mark bookings as not to be invoiced (for example, covered by a fixed amount), saying why","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"bookingIds":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"reason":{"type":"string","minLength":1,"maxLength":300}},"required":["bookingIds","reason"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/uninvoiced/unskip":{"post":{"operationId":"invoices.unskip","summary":"Take back \"not to be invoiced\" so bookings are invoiced again","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"bookingIds":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["bookingIds"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/{id}":{"get":{"operationId":"invoices.get","summary":"One invoice: its lines, totals, history, and who it is from and to","tags":["Invoicing"],"x-permission":"invoice.view","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","paid","void"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"manual":{"default":false,"type":"boolean"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"default":null,"type":["string","null"]},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"paidOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"coveredBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"notes":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"creditedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["booking","fixed","manual","product"]},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"quantity":{"type":"number"},"unitPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrice":{"type":"boolean"},"late":{"type":"boolean"},"covered":{"type":"boolean"},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateOverrideBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"photoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hiddenPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsignedPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","kind","description","date","projectId","projectName","quantity","unitPence","netPence","vatRateBp","vatPence","missingPrice","late","covered","bookingId","chargePence","vatRateOverrideBp","photoCount","hiddenPhotoCount","unsignedPhotoCount"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","issued","paid","voided","line_added","line_changed","line_removed","missing_accepted","notes","credit_raised","credit_issued","credit_voided","credit_deleted","refunded","refund_removed"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"issueBlocker":{"type":["string","null"]},"unsignedBookings":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"listCoveredVisits":{"default":true,"type":"boolean"},"from":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"paymentDetails":{"type":["string","null"]},"hasLogo":{"type":"boolean"}},"required":["name","address","email","phone","website","companyNumber","vatNumber","paymentDetails","hasLogo"],"additionalProperties":false},"to":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","address","email","phone"],"additionalProperties":false},"vatRegistered":{"type":"boolean"},"terms":{"type":["string","null"]},"includePhotos":{"default":false,"type":"boolean"},"photos":{"default":[],"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":"string"},"projectName":{"type":["string","null"]},"teamMemberName":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"caption":{"type":["string","null"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","caption","width","height","thumbUrl","fullUrl"],"additionalProperties":false}}},"required":["bookingId","date","start","end","name","projectName","teamMemberName","photos"],"additionalProperties":false}},"credits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt"],"additionalProperties":false}},"refunds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"type":["string","null"]},"note":{"type":["string","null"]},"byName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","amountPence","refundedOn","method","note","byName","createdAt"],"additionalProperties":false}},"refundedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditLeftPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditableLines":{"type":"array","items":{"type":"object","properties":{"invoiceLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingNetPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingVatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoiceLineId","description","vatRateBp","netPence","vatPence","remainingNetPence","remainingVatPence"],"additionalProperties":false}}},"required":["id","number","reference","status","clientId","clientName","frequency","basis","periodStart","periodEnd","manual","projectId","projectName","issueDate","dueDate","paidOn","netPence","vatPence","grossPence","missingPrices","bookings","coveredBookings","lateBookings","bookedPence","fixedPence","manualPence","missingAccepted","notes","voidReason","creditedPence","amountDuePence","calculatedAt","createdAt","lines","history","issueBlocker","unsignedBookings","listCoveredVisits","from","to","vatRegistered","terms","includePhotos","photos","credits","refunds","refundedPence","refundDuePence","creditLeftPence","creditableLines"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"invoices.update","summary":"Change an invoice's notes","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"terms":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","paid","void"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"manual":{"default":false,"type":"boolean"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"default":null,"type":["string","null"]},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"paidOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"coveredBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"notes":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"creditedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["booking","fixed","manual","product"]},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"quantity":{"type":"number"},"unitPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrice":{"type":"boolean"},"late":{"type":"boolean"},"covered":{"type":"boolean"},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateOverrideBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"photoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hiddenPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsignedPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","kind","description","date","projectId","projectName","quantity","unitPence","netPence","vatRateBp","vatPence","missingPrice","late","covered","bookingId","chargePence","vatRateOverrideBp","photoCount","hiddenPhotoCount","unsignedPhotoCount"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","issued","paid","voided","line_added","line_changed","line_removed","missing_accepted","notes","credit_raised","credit_issued","credit_voided","credit_deleted","refunded","refund_removed"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"issueBlocker":{"type":["string","null"]},"unsignedBookings":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"listCoveredVisits":{"default":true,"type":"boolean"},"from":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"paymentDetails":{"type":["string","null"]},"hasLogo":{"type":"boolean"}},"required":["name","address","email","phone","website","companyNumber","vatNumber","paymentDetails","hasLogo"],"additionalProperties":false},"to":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","address","email","phone"],"additionalProperties":false},"vatRegistered":{"type":"boolean"},"terms":{"type":["string","null"]},"includePhotos":{"default":false,"type":"boolean"},"photos":{"default":[],"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":"string"},"projectName":{"type":["string","null"]},"teamMemberName":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"caption":{"type":["string","null"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","caption","width","height","thumbUrl","fullUrl"],"additionalProperties":false}}},"required":["bookingId","date","start","end","name","projectName","teamMemberName","photos"],"additionalProperties":false}},"credits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt"],"additionalProperties":false}},"refunds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"type":["string","null"]},"note":{"type":["string","null"]},"byName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","amountPence","refundedOn","method","note","byName","createdAt"],"additionalProperties":false}},"refundedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditLeftPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditableLines":{"type":"array","items":{"type":"object","properties":{"invoiceLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingNetPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingVatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoiceLineId","description","vatRateBp","netPence","vatPence","remainingNetPence","remainingVatPence"],"additionalProperties":false}}},"required":["id","number","reference","status","clientId","clientName","frequency","basis","periodStart","periodEnd","manual","projectId","projectName","issueDate","dueDate","paidOn","netPence","vatPence","grossPence","missingPrices","bookings","coveredBookings","lateBookings","bookedPence","fixedPence","manualPence","missingAccepted","notes","voidReason","creditedPence","amountDuePence","calculatedAt","createdAt","lines","history","issueBlocker","unsignedBookings","listCoveredVisits","from","to","vatRegistered","terms","includePhotos","photos","credits","refunds","refundedPence","refundDuePence","creditLeftPence","creditableLines"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"invoices.remove","summary":"Delete a draft invoice (its bookings are free again)","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/{id}/recalculate":{"post":{"operationId":"invoices.recalculate","summary":"Work a draft out again from bookings, prices and fixed amounts (lines added by hand stay)","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","paid","void"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"manual":{"default":false,"type":"boolean"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"default":null,"type":["string","null"]},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"paidOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"coveredBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"notes":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"creditedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["booking","fixed","manual","product"]},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"quantity":{"type":"number"},"unitPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrice":{"type":"boolean"},"late":{"type":"boolean"},"covered":{"type":"boolean"},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateOverrideBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"photoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hiddenPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsignedPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","kind","description","date","projectId","projectName","quantity","unitPence","netPence","vatRateBp","vatPence","missingPrice","late","covered","bookingId","chargePence","vatRateOverrideBp","photoCount","hiddenPhotoCount","unsignedPhotoCount"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","issued","paid","voided","line_added","line_changed","line_removed","missing_accepted","notes","credit_raised","credit_issued","credit_voided","credit_deleted","refunded","refund_removed"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"issueBlocker":{"type":["string","null"]},"unsignedBookings":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"listCoveredVisits":{"default":true,"type":"boolean"},"from":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"paymentDetails":{"type":["string","null"]},"hasLogo":{"type":"boolean"}},"required":["name","address","email","phone","website","companyNumber","vatNumber","paymentDetails","hasLogo"],"additionalProperties":false},"to":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","address","email","phone"],"additionalProperties":false},"vatRegistered":{"type":"boolean"},"terms":{"type":["string","null"]},"includePhotos":{"default":false,"type":"boolean"},"photos":{"default":[],"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":"string"},"projectName":{"type":["string","null"]},"teamMemberName":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"caption":{"type":["string","null"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","caption","width","height","thumbUrl","fullUrl"],"additionalProperties":false}}},"required":["bookingId","date","start","end","name","projectName","teamMemberName","photos"],"additionalProperties":false}},"credits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt"],"additionalProperties":false}},"refunds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"type":["string","null"]},"note":{"type":["string","null"]},"byName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","amountPence","refundedOn","method","note","byName","createdAt"],"additionalProperties":false}},"refundedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditLeftPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditableLines":{"type":"array","items":{"type":"object","properties":{"invoiceLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingNetPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingVatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoiceLineId","description","vatRateBp","netPence","vatPence","remainingNetPence","remainingVatPence"],"additionalProperties":false}}},"required":["id","number","reference","status","clientId","clientName","frequency","basis","periodStart","periodEnd","manual","projectId","projectName","issueDate","dueDate","paidOn","netPence","vatPence","grossPence","missingPrices","bookings","coveredBookings","lateBookings","bookedPence","fixedPence","manualPence","missingAccepted","notes","voidReason","creditedPence","amountDuePence","calculatedAt","createdAt","lines","history","issueBlocker","unsignedBookings","listCoveredVisits","from","to","vatRegistered","terms","includePhotos","photos","credits","refunds","refundedPence","refundDuePence","creditLeftPence","creditableLines"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/{id}/issue":{"post":{"operationId":"invoices.issue","summary":"Issue a draft: worked out one last time, given the next number, and its bookings' prices locked as invoiced","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","paid","void"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"manual":{"default":false,"type":"boolean"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"default":null,"type":["string","null"]},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"paidOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"coveredBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"notes":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"creditedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["booking","fixed","manual","product"]},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"quantity":{"type":"number"},"unitPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrice":{"type":"boolean"},"late":{"type":"boolean"},"covered":{"type":"boolean"},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateOverrideBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"photoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hiddenPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsignedPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","kind","description","date","projectId","projectName","quantity","unitPence","netPence","vatRateBp","vatPence","missingPrice","late","covered","bookingId","chargePence","vatRateOverrideBp","photoCount","hiddenPhotoCount","unsignedPhotoCount"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","issued","paid","voided","line_added","line_changed","line_removed","missing_accepted","notes","credit_raised","credit_issued","credit_voided","credit_deleted","refunded","refund_removed"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"issueBlocker":{"type":["string","null"]},"unsignedBookings":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"listCoveredVisits":{"default":true,"type":"boolean"},"from":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"paymentDetails":{"type":["string","null"]},"hasLogo":{"type":"boolean"}},"required":["name","address","email","phone","website","companyNumber","vatNumber","paymentDetails","hasLogo"],"additionalProperties":false},"to":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","address","email","phone"],"additionalProperties":false},"vatRegistered":{"type":"boolean"},"terms":{"type":["string","null"]},"includePhotos":{"default":false,"type":"boolean"},"photos":{"default":[],"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":"string"},"projectName":{"type":["string","null"]},"teamMemberName":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"caption":{"type":["string","null"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","caption","width","height","thumbUrl","fullUrl"],"additionalProperties":false}}},"required":["bookingId","date","start","end","name","projectName","teamMemberName","photos"],"additionalProperties":false}},"credits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt"],"additionalProperties":false}},"refunds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"type":["string","null"]},"note":{"type":["string","null"]},"byName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","amountPence","refundedOn","method","note","byName","createdAt"],"additionalProperties":false}},"refundedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditLeftPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditableLines":{"type":"array","items":{"type":"object","properties":{"invoiceLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingNetPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingVatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoiceLineId","description","vatRateBp","netPence","vatPence","remainingNetPence","remainingVatPence"],"additionalProperties":false}}},"required":["id","number","reference","status","clientId","clientName","frequency","basis","periodStart","periodEnd","manual","projectId","projectName","issueDate","dueDate","paidOn","netPence","vatPence","grossPence","missingPrices","bookings","coveredBookings","lateBookings","bookedPence","fixedPence","manualPence","missingAccepted","notes","voidReason","creditedPence","amountDuePence","calculatedAt","createdAt","lines","history","issueBlocker","unsignedBookings","listCoveredVisits","from","to","vatRegistered","terms","includePhotos","photos","credits","refunds","refundedPence","refundDuePence","creditLeftPence","creditableLines"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/{id}/paid":{"post":{"operationId":"invoices.markPaid","summary":"Mark an issued invoice as paid on a day","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"paidOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["paidOn"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","paid","void"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"manual":{"default":false,"type":"boolean"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"default":null,"type":["string","null"]},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"paidOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"coveredBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"notes":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"creditedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["booking","fixed","manual","product"]},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"quantity":{"type":"number"},"unitPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrice":{"type":"boolean"},"late":{"type":"boolean"},"covered":{"type":"boolean"},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateOverrideBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"photoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hiddenPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsignedPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","kind","description","date","projectId","projectName","quantity","unitPence","netPence","vatRateBp","vatPence","missingPrice","late","covered","bookingId","chargePence","vatRateOverrideBp","photoCount","hiddenPhotoCount","unsignedPhotoCount"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","issued","paid","voided","line_added","line_changed","line_removed","missing_accepted","notes","credit_raised","credit_issued","credit_voided","credit_deleted","refunded","refund_removed"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"issueBlocker":{"type":["string","null"]},"unsignedBookings":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"listCoveredVisits":{"default":true,"type":"boolean"},"from":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"paymentDetails":{"type":["string","null"]},"hasLogo":{"type":"boolean"}},"required":["name","address","email","phone","website","companyNumber","vatNumber","paymentDetails","hasLogo"],"additionalProperties":false},"to":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","address","email","phone"],"additionalProperties":false},"vatRegistered":{"type":"boolean"},"terms":{"type":["string","null"]},"includePhotos":{"default":false,"type":"boolean"},"photos":{"default":[],"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":"string"},"projectName":{"type":["string","null"]},"teamMemberName":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"caption":{"type":["string","null"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","caption","width","height","thumbUrl","fullUrl"],"additionalProperties":false}}},"required":["bookingId","date","start","end","name","projectName","teamMemberName","photos"],"additionalProperties":false}},"credits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt"],"additionalProperties":false}},"refunds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"type":["string","null"]},"note":{"type":["string","null"]},"byName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","amountPence","refundedOn","method","note","byName","createdAt"],"additionalProperties":false}},"refundedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditLeftPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditableLines":{"type":"array","items":{"type":"object","properties":{"invoiceLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingNetPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingVatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoiceLineId","description","vatRateBp","netPence","vatPence","remainingNetPence","remainingVatPence"],"additionalProperties":false}}},"required":["id","number","reference","status","clientId","clientName","frequency","basis","periodStart","periodEnd","manual","projectId","projectName","issueDate","dueDate","paidOn","netPence","vatPence","grossPence","missingPrices","bookings","coveredBookings","lateBookings","bookedPence","fixedPence","manualPence","missingAccepted","notes","voidReason","creditedPence","amountDuePence","calculatedAt","createdAt","lines","history","issueBlocker","unsignedBookings","listCoveredVisits","from","to","vatRegistered","terms","includePhotos","photos","credits","refunds","refundedPence","refundDuePence","creditLeftPence","creditableLines"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/{id}/void":{"post":{"operationId":"invoices.void","summary":"Void an issued or paid invoice, saying why: it keeps its number and its bookings are free to invoice again","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","paid","void"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"manual":{"default":false,"type":"boolean"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"default":null,"type":["string","null"]},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"paidOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"coveredBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"notes":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"creditedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["booking","fixed","manual","product"]},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"quantity":{"type":"number"},"unitPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrice":{"type":"boolean"},"late":{"type":"boolean"},"covered":{"type":"boolean"},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateOverrideBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"photoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hiddenPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsignedPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","kind","description","date","projectId","projectName","quantity","unitPence","netPence","vatRateBp","vatPence","missingPrice","late","covered","bookingId","chargePence","vatRateOverrideBp","photoCount","hiddenPhotoCount","unsignedPhotoCount"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","issued","paid","voided","line_added","line_changed","line_removed","missing_accepted","notes","credit_raised","credit_issued","credit_voided","credit_deleted","refunded","refund_removed"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"issueBlocker":{"type":["string","null"]},"unsignedBookings":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"listCoveredVisits":{"default":true,"type":"boolean"},"from":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"paymentDetails":{"type":["string","null"]},"hasLogo":{"type":"boolean"}},"required":["name","address","email","phone","website","companyNumber","vatNumber","paymentDetails","hasLogo"],"additionalProperties":false},"to":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","address","email","phone"],"additionalProperties":false},"vatRegistered":{"type":"boolean"},"terms":{"type":["string","null"]},"includePhotos":{"default":false,"type":"boolean"},"photos":{"default":[],"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":"string"},"projectName":{"type":["string","null"]},"teamMemberName":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"caption":{"type":["string","null"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","caption","width","height","thumbUrl","fullUrl"],"additionalProperties":false}}},"required":["bookingId","date","start","end","name","projectName","teamMemberName","photos"],"additionalProperties":false}},"credits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt"],"additionalProperties":false}},"refunds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"type":["string","null"]},"note":{"type":["string","null"]},"byName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","amountPence","refundedOn","method","note","byName","createdAt"],"additionalProperties":false}},"refundedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditLeftPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditableLines":{"type":"array","items":{"type":"object","properties":{"invoiceLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingNetPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingVatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoiceLineId","description","vatRateBp","netPence","vatPence","remainingNetPence","remainingVatPence"],"additionalProperties":false}}},"required":["id","number","reference","status","clientId","clientName","frequency","basis","periodStart","periodEnd","manual","projectId","projectName","issueDate","dueDate","paidOn","netPence","vatPence","grossPence","missingPrices","bookings","coveredBookings","lateBookings","bookedPence","fixedPence","manualPence","missingAccepted","notes","voidReason","creditedPence","amountDuePence","calculatedAt","createdAt","lines","history","issueBlocker","unsignedBookings","listCoveredVisits","from","to","vatRegistered","terms","includePhotos","photos","credits","refunds","refundedPence","refundDuePence","creditLeftPence","creditableLines"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/charges":{"get":{"operationId":"invoices.uninvoicedCharges","summary":"A client's products and materials not on any invoice yet (up to a day), to choose from","tags":["Invoicing"],"x-permission":"invoice.view","x-module":"invoicing","parameters":[{"name":"clientId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"upTo","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"projectName":{"type":["string","null"]},"groupKey":{"default":"","type":"string"},"groupLabel":{"default":"","type":"string"},"orderId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["id","date","description","quantityX100","unitPence","netPence","projectName","groupKey","groupLabel","orderId"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/{id}/charges":{"post":{"operationId":"invoices.addCharges","summary":"Put some of the client's products and materials on a draft (take one off by removing its line)","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"chargeIds":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["chargeIds"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","paid","void"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"manual":{"default":false,"type":"boolean"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"default":null,"type":["string","null"]},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"paidOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"coveredBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"notes":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"creditedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["booking","fixed","manual","product"]},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"quantity":{"type":"number"},"unitPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrice":{"type":"boolean"},"late":{"type":"boolean"},"covered":{"type":"boolean"},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateOverrideBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"photoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hiddenPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsignedPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","kind","description","date","projectId","projectName","quantity","unitPence","netPence","vatRateBp","vatPence","missingPrice","late","covered","bookingId","chargePence","vatRateOverrideBp","photoCount","hiddenPhotoCount","unsignedPhotoCount"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","issued","paid","voided","line_added","line_changed","line_removed","missing_accepted","notes","credit_raised","credit_issued","credit_voided","credit_deleted","refunded","refund_removed"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"issueBlocker":{"type":["string","null"]},"unsignedBookings":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"listCoveredVisits":{"default":true,"type":"boolean"},"from":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"paymentDetails":{"type":["string","null"]},"hasLogo":{"type":"boolean"}},"required":["name","address","email","phone","website","companyNumber","vatNumber","paymentDetails","hasLogo"],"additionalProperties":false},"to":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","address","email","phone"],"additionalProperties":false},"vatRegistered":{"type":"boolean"},"terms":{"type":["string","null"]},"includePhotos":{"default":false,"type":"boolean"},"photos":{"default":[],"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":"string"},"projectName":{"type":["string","null"]},"teamMemberName":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"caption":{"type":["string","null"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","caption","width","height","thumbUrl","fullUrl"],"additionalProperties":false}}},"required":["bookingId","date","start","end","name","projectName","teamMemberName","photos"],"additionalProperties":false}},"credits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt"],"additionalProperties":false}},"refunds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"type":["string","null"]},"note":{"type":["string","null"]},"byName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","amountPence","refundedOn","method","note","byName","createdAt"],"additionalProperties":false}},"refundedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditLeftPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditableLines":{"type":"array","items":{"type":"object","properties":{"invoiceLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingNetPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingVatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoiceLineId","description","vatRateBp","netPence","vatPence","remainingNetPence","remainingVatPence"],"additionalProperties":false}}},"required":["id","number","reference","status","clientId","clientName","frequency","basis","periodStart","periodEnd","manual","projectId","projectName","issueDate","dueDate","paidOn","netPence","vatPence","grossPence","missingPrices","bookings","coveredBookings","lateBookings","bookedPence","fixedPence","manualPence","missingAccepted","notes","voidReason","creditedPence","amountDuePence","calculatedAt","createdAt","lines","history","issueBlocker","unsignedBookings","listCoveredVisits","from","to","vatRegistered","terms","includePhotos","photos","credits","refunds","refundedPence","refundDuePence","creditLeftPence","creditableLines"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/{id}/stock":{"post":{"operationId":"invoices.addStock","summary":"Take products from stock for the client and put them on this draft (taking the line off puts the stock back)","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"quantityX100":{"type":"integer","minimum":1,"maximum":100000000}},"required":["productId","quantityX100"]}}},"required":["items"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","paid","void"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"manual":{"default":false,"type":"boolean"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"default":null,"type":["string","null"]},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"paidOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"coveredBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"notes":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"creditedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["booking","fixed","manual","product"]},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"quantity":{"type":"number"},"unitPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrice":{"type":"boolean"},"late":{"type":"boolean"},"covered":{"type":"boolean"},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateOverrideBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"photoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hiddenPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsignedPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","kind","description","date","projectId","projectName","quantity","unitPence","netPence","vatRateBp","vatPence","missingPrice","late","covered","bookingId","chargePence","vatRateOverrideBp","photoCount","hiddenPhotoCount","unsignedPhotoCount"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","issued","paid","voided","line_added","line_changed","line_removed","missing_accepted","notes","credit_raised","credit_issued","credit_voided","credit_deleted","refunded","refund_removed"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"issueBlocker":{"type":["string","null"]},"unsignedBookings":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"listCoveredVisits":{"default":true,"type":"boolean"},"from":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"paymentDetails":{"type":["string","null"]},"hasLogo":{"type":"boolean"}},"required":["name","address","email","phone","website","companyNumber","vatNumber","paymentDetails","hasLogo"],"additionalProperties":false},"to":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","address","email","phone"],"additionalProperties":false},"vatRegistered":{"type":"boolean"},"terms":{"type":["string","null"]},"includePhotos":{"default":false,"type":"boolean"},"photos":{"default":[],"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":"string"},"projectName":{"type":["string","null"]},"teamMemberName":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"caption":{"type":["string","null"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","caption","width","height","thumbUrl","fullUrl"],"additionalProperties":false}}},"required":["bookingId","date","start","end","name","projectName","teamMemberName","photos"],"additionalProperties":false}},"credits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt"],"additionalProperties":false}},"refunds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"type":["string","null"]},"note":{"type":["string","null"]},"byName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","amountPence","refundedOn","method","note","byName","createdAt"],"additionalProperties":false}},"refundedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditLeftPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditableLines":{"type":"array","items":{"type":"object","properties":{"invoiceLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingNetPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingVatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoiceLineId","description","vatRateBp","netPence","vatPence","remainingNetPence","remainingVatPence"],"additionalProperties":false}}},"required":["id","number","reference","status","clientId","clientName","frequency","basis","periodStart","periodEnd","manual","projectId","projectName","issueDate","dueDate","paidOn","netPence","vatPence","grossPence","missingPrices","bookings","coveredBookings","lateBookings","bookedPence","fixedPence","manualPence","missingAccepted","notes","voidReason","creditedPence","amountDuePence","calculatedAt","createdAt","lines","history","issueBlocker","unsignedBookings","listCoveredVisits","from","to","vatRegistered","terms","includePhotos","photos","credits","refunds","refundedPence","refundDuePence","creditLeftPence","creditableLines"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/{id}/bookings":{"post":{"operationId":"invoices.addBookings","summary":"Put some of the client's finished bookings on a one-off draft (take one off by removing its line)","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"bookingIds":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["bookingIds"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","paid","void"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"manual":{"default":false,"type":"boolean"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"default":null,"type":["string","null"]},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"paidOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"coveredBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"notes":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"creditedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["booking","fixed","manual","product"]},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"quantity":{"type":"number"},"unitPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrice":{"type":"boolean"},"late":{"type":"boolean"},"covered":{"type":"boolean"},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateOverrideBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"photoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hiddenPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsignedPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","kind","description","date","projectId","projectName","quantity","unitPence","netPence","vatRateBp","vatPence","missingPrice","late","covered","bookingId","chargePence","vatRateOverrideBp","photoCount","hiddenPhotoCount","unsignedPhotoCount"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","issued","paid","voided","line_added","line_changed","line_removed","missing_accepted","notes","credit_raised","credit_issued","credit_voided","credit_deleted","refunded","refund_removed"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"issueBlocker":{"type":["string","null"]},"unsignedBookings":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"listCoveredVisits":{"default":true,"type":"boolean"},"from":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"paymentDetails":{"type":["string","null"]},"hasLogo":{"type":"boolean"}},"required":["name","address","email","phone","website","companyNumber","vatNumber","paymentDetails","hasLogo"],"additionalProperties":false},"to":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","address","email","phone"],"additionalProperties":false},"vatRegistered":{"type":"boolean"},"terms":{"type":["string","null"]},"includePhotos":{"default":false,"type":"boolean"},"photos":{"default":[],"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":"string"},"projectName":{"type":["string","null"]},"teamMemberName":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"caption":{"type":["string","null"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","caption","width","height","thumbUrl","fullUrl"],"additionalProperties":false}}},"required":["bookingId","date","start","end","name","projectName","teamMemberName","photos"],"additionalProperties":false}},"credits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt"],"additionalProperties":false}},"refunds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"type":["string","null"]},"note":{"type":["string","null"]},"byName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","amountPence","refundedOn","method","note","byName","createdAt"],"additionalProperties":false}},"refundedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditLeftPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditableLines":{"type":"array","items":{"type":"object","properties":{"invoiceLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingNetPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingVatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoiceLineId","description","vatRateBp","netPence","vatPence","remainingNetPence","remainingVatPence"],"additionalProperties":false}}},"required":["id","number","reference","status","clientId","clientName","frequency","basis","periodStart","periodEnd","manual","projectId","projectName","issueDate","dueDate","paidOn","netPence","vatPence","grossPence","missingPrices","bookings","coveredBookings","lateBookings","bookedPence","fixedPence","manualPence","missingAccepted","notes","voidReason","creditedPence","amountDuePence","calculatedAt","createdAt","lines","history","issueBlocker","unsignedBookings","listCoveredVisits","from","to","vatRegistered","terms","includePhotos","photos","credits","refunds","refundedPence","refundDuePence","creditLeftPence","creditableLines"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/{id}/lines":{"post":{"operationId":"invoices.addLine","summary":"Add a line by hand to a draft: an extra, an adjustment, or a credit (a negative price)","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":2000},"quantityX100":{"default":100,"type":"integer","minimum":1,"maximum":1000000},"unitPence":{"type":"integer","minimum":-100000000,"maximum":100000000},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"vatRateBp":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]}},"required":["description","unitPence"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","paid","void"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"manual":{"default":false,"type":"boolean"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"default":null,"type":["string","null"]},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"paidOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"coveredBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"notes":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"creditedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["booking","fixed","manual","product"]},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"quantity":{"type":"number"},"unitPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrice":{"type":"boolean"},"late":{"type":"boolean"},"covered":{"type":"boolean"},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateOverrideBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"photoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hiddenPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsignedPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","kind","description","date","projectId","projectName","quantity","unitPence","netPence","vatRateBp","vatPence","missingPrice","late","covered","bookingId","chargePence","vatRateOverrideBp","photoCount","hiddenPhotoCount","unsignedPhotoCount"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","issued","paid","voided","line_added","line_changed","line_removed","missing_accepted","notes","credit_raised","credit_issued","credit_voided","credit_deleted","refunded","refund_removed"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"issueBlocker":{"type":["string","null"]},"unsignedBookings":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"listCoveredVisits":{"default":true,"type":"boolean"},"from":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"paymentDetails":{"type":["string","null"]},"hasLogo":{"type":"boolean"}},"required":["name","address","email","phone","website","companyNumber","vatNumber","paymentDetails","hasLogo"],"additionalProperties":false},"to":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","address","email","phone"],"additionalProperties":false},"vatRegistered":{"type":"boolean"},"terms":{"type":["string","null"]},"includePhotos":{"default":false,"type":"boolean"},"photos":{"default":[],"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":"string"},"projectName":{"type":["string","null"]},"teamMemberName":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"caption":{"type":["string","null"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","caption","width","height","thumbUrl","fullUrl"],"additionalProperties":false}}},"required":["bookingId","date","start","end","name","projectName","teamMemberName","photos"],"additionalProperties":false}},"credits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt"],"additionalProperties":false}},"refunds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"type":["string","null"]},"note":{"type":["string","null"]},"byName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","amountPence","refundedOn","method","note","byName","createdAt"],"additionalProperties":false}},"refundedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditLeftPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditableLines":{"type":"array","items":{"type":"object","properties":{"invoiceLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingNetPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingVatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoiceLineId","description","vatRateBp","netPence","vatPence","remainingNetPence","remainingVatPence"],"additionalProperties":false}}},"required":["id","number","reference","status","clientId","clientName","frequency","basis","periodStart","periodEnd","manual","projectId","projectName","issueDate","dueDate","paidOn","netPence","vatPence","grossPence","missingPrices","bookings","coveredBookings","lateBookings","bookedPence","fixedPence","manualPence","missingAccepted","notes","voidReason","creditedPence","amountDuePence","calculatedAt","createdAt","lines","history","issueBlocker","unsignedBookings","listCoveredVisits","from","to","vatRegistered","terms","includePhotos","photos","credits","refunds","refundedPence","refundDuePence","creditLeftPence","creditableLines"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/{id}/lines/{lineId}":{"patch":{"operationId":"invoices.updateLine","summary":"Change a line on a draft: a hand-added line's details, or the price and VAT rate of a booking or fixed line","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"lineId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":2000},"quantityX100":{"type":"integer","minimum":1,"maximum":1000000},"unitPence":{"type":"integer","minimum":-100000000,"maximum":100000000},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"chargePence":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000000},{"type":"null"}]},"vatRateBp":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","paid","void"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"manual":{"default":false,"type":"boolean"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"default":null,"type":["string","null"]},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"paidOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"coveredBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"notes":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"creditedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["booking","fixed","manual","product"]},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"quantity":{"type":"number"},"unitPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrice":{"type":"boolean"},"late":{"type":"boolean"},"covered":{"type":"boolean"},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateOverrideBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"photoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hiddenPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsignedPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","kind","description","date","projectId","projectName","quantity","unitPence","netPence","vatRateBp","vatPence","missingPrice","late","covered","bookingId","chargePence","vatRateOverrideBp","photoCount","hiddenPhotoCount","unsignedPhotoCount"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","issued","paid","voided","line_added","line_changed","line_removed","missing_accepted","notes","credit_raised","credit_issued","credit_voided","credit_deleted","refunded","refund_removed"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"issueBlocker":{"type":["string","null"]},"unsignedBookings":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"listCoveredVisits":{"default":true,"type":"boolean"},"from":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"paymentDetails":{"type":["string","null"]},"hasLogo":{"type":"boolean"}},"required":["name","address","email","phone","website","companyNumber","vatNumber","paymentDetails","hasLogo"],"additionalProperties":false},"to":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","address","email","phone"],"additionalProperties":false},"vatRegistered":{"type":"boolean"},"terms":{"type":["string","null"]},"includePhotos":{"default":false,"type":"boolean"},"photos":{"default":[],"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":"string"},"projectName":{"type":["string","null"]},"teamMemberName":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"caption":{"type":["string","null"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","caption","width","height","thumbUrl","fullUrl"],"additionalProperties":false}}},"required":["bookingId","date","start","end","name","projectName","teamMemberName","photos"],"additionalProperties":false}},"credits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt"],"additionalProperties":false}},"refunds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"type":["string","null"]},"note":{"type":["string","null"]},"byName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","amountPence","refundedOn","method","note","byName","createdAt"],"additionalProperties":false}},"refundedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditLeftPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditableLines":{"type":"array","items":{"type":"object","properties":{"invoiceLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingNetPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingVatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoiceLineId","description","vatRateBp","netPence","vatPence","remainingNetPence","remainingVatPence"],"additionalProperties":false}}},"required":["id","number","reference","status","clientId","clientName","frequency","basis","periodStart","periodEnd","manual","projectId","projectName","issueDate","dueDate","paidOn","netPence","vatPence","grossPence","missingPrices","bookings","coveredBookings","lateBookings","bookedPence","fixedPence","manualPence","missingAccepted","notes","voidReason","creditedPence","amountDuePence","calculatedAt","createdAt","lines","history","issueBlocker","unsignedBookings","listCoveredVisits","from","to","vatRegistered","terms","includePhotos","photos","credits","refunds","refundedPence","refundDuePence","creditLeftPence","creditableLines"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"invoices.removeLine","summary":"Remove a line added by hand","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"lineId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","paid","void"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"manual":{"default":false,"type":"boolean"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"default":null,"type":["string","null"]},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"paidOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"coveredBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"notes":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"creditedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["booking","fixed","manual","product"]},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"quantity":{"type":"number"},"unitPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrice":{"type":"boolean"},"late":{"type":"boolean"},"covered":{"type":"boolean"},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateOverrideBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"photoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hiddenPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsignedPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","kind","description","date","projectId","projectName","quantity","unitPence","netPence","vatRateBp","vatPence","missingPrice","late","covered","bookingId","chargePence","vatRateOverrideBp","photoCount","hiddenPhotoCount","unsignedPhotoCount"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","issued","paid","voided","line_added","line_changed","line_removed","missing_accepted","notes","credit_raised","credit_issued","credit_voided","credit_deleted","refunded","refund_removed"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"issueBlocker":{"type":["string","null"]},"unsignedBookings":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"listCoveredVisits":{"default":true,"type":"boolean"},"from":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"paymentDetails":{"type":["string","null"]},"hasLogo":{"type":"boolean"}},"required":["name","address","email","phone","website","companyNumber","vatNumber","paymentDetails","hasLogo"],"additionalProperties":false},"to":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","address","email","phone"],"additionalProperties":false},"vatRegistered":{"type":"boolean"},"terms":{"type":["string","null"]},"includePhotos":{"default":false,"type":"boolean"},"photos":{"default":[],"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":"string"},"projectName":{"type":["string","null"]},"teamMemberName":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"caption":{"type":["string","null"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","caption","width","height","thumbUrl","fullUrl"],"additionalProperties":false}}},"required":["bookingId","date","start","end","name","projectName","teamMemberName","photos"],"additionalProperties":false}},"credits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt"],"additionalProperties":false}},"refunds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"type":["string","null"]},"note":{"type":["string","null"]},"byName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","amountPence","refundedOn","method","note","byName","createdAt"],"additionalProperties":false}},"refundedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditLeftPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditableLines":{"type":"array","items":{"type":"object","properties":{"invoiceLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingNetPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingVatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoiceLineId","description","vatRateBp","netPence","vatPence","remainingNetPence","remainingVatPence"],"additionalProperties":false}}},"required":["id","number","reference","status","clientId","clientName","frequency","basis","periodStart","periodEnd","manual","projectId","projectName","issueDate","dueDate","paidOn","netPence","vatPence","grossPence","missingPrices","bookings","coveredBookings","lateBookings","bookedPence","fixedPence","manualPence","missingAccepted","notes","voidReason","creditedPence","amountDuePence","calculatedAt","createdAt","lines","history","issueBlocker","unsignedBookings","listCoveredVisits","from","to","vatRegistered","terms","includePhotos","photos","credits","refunds","refundedPence","refundDuePence","creditLeftPence","creditableLines"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/{id}/photos":{"post":{"operationId":"invoices.photos","summary":"Show or leave out its bookings' photos (those clients may see) on pages after a draft invoice","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"include":{"type":"boolean"}},"required":["include"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","paid","void"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"manual":{"default":false,"type":"boolean"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"default":null,"type":["string","null"]},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"paidOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"coveredBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"notes":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"creditedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["booking","fixed","manual","product"]},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"quantity":{"type":"number"},"unitPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrice":{"type":"boolean"},"late":{"type":"boolean"},"covered":{"type":"boolean"},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateOverrideBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"photoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hiddenPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsignedPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","kind","description","date","projectId","projectName","quantity","unitPence","netPence","vatRateBp","vatPence","missingPrice","late","covered","bookingId","chargePence","vatRateOverrideBp","photoCount","hiddenPhotoCount","unsignedPhotoCount"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","issued","paid","voided","line_added","line_changed","line_removed","missing_accepted","notes","credit_raised","credit_issued","credit_voided","credit_deleted","refunded","refund_removed"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"issueBlocker":{"type":["string","null"]},"unsignedBookings":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"listCoveredVisits":{"default":true,"type":"boolean"},"from":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"paymentDetails":{"type":["string","null"]},"hasLogo":{"type":"boolean"}},"required":["name","address","email","phone","website","companyNumber","vatNumber","paymentDetails","hasLogo"],"additionalProperties":false},"to":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","address","email","phone"],"additionalProperties":false},"vatRegistered":{"type":"boolean"},"terms":{"type":["string","null"]},"includePhotos":{"default":false,"type":"boolean"},"photos":{"default":[],"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":"string"},"projectName":{"type":["string","null"]},"teamMemberName":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"caption":{"type":["string","null"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","caption","width","height","thumbUrl","fullUrl"],"additionalProperties":false}}},"required":["bookingId","date","start","end","name","projectName","teamMemberName","photos"],"additionalProperties":false}},"credits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt"],"additionalProperties":false}},"refunds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"type":["string","null"]},"note":{"type":["string","null"]},"byName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","amountPence","refundedOn","method","note","byName","createdAt"],"additionalProperties":false}},"refundedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditLeftPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditableLines":{"type":"array","items":{"type":"object","properties":{"invoiceLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingNetPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingVatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoiceLineId","description","vatRateBp","netPence","vatPence","remainingNetPence","remainingVatPence"],"additionalProperties":false}}},"required":["id","number","reference","status","clientId","clientName","frequency","basis","periodStart","periodEnd","manual","projectId","projectName","issueDate","dueDate","paidOn","netPence","vatPence","grossPence","missingPrices","bookings","coveredBookings","lateBookings","bookedPence","fixedPence","manualPence","missingAccepted","notes","voidReason","creditedPence","amountDuePence","calculatedAt","createdAt","lines","history","issueBlocker","unsignedBookings","listCoveredVisits","from","to","vatRegistered","terms","includePhotos","photos","credits","refunds","refundedPence","refundDuePence","creditLeftPence","creditableLines"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/{id}/accept-missing":{"post":{"operationId":"invoices.acceptMissing","summary":"Accept lines with no price as they are (or take that back), so the invoice can be issued","tags":["Invoicing"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"accepted":{"type":"boolean"}},"required":["accepted"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","paid","void"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"manual":{"default":false,"type":"boolean"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"default":null,"type":["string","null"]},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"paidOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"coveredBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"notes":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"creditedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["booking","fixed","manual","product"]},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"quantity":{"type":"number"},"unitPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrice":{"type":"boolean"},"late":{"type":"boolean"},"covered":{"type":"boolean"},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateOverrideBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"photoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hiddenPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsignedPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","kind","description","date","projectId","projectName","quantity","unitPence","netPence","vatRateBp","vatPence","missingPrice","late","covered","bookingId","chargePence","vatRateOverrideBp","photoCount","hiddenPhotoCount","unsignedPhotoCount"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","issued","paid","voided","line_added","line_changed","line_removed","missing_accepted","notes","credit_raised","credit_issued","credit_voided","credit_deleted","refunded","refund_removed"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"issueBlocker":{"type":["string","null"]},"unsignedBookings":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"listCoveredVisits":{"default":true,"type":"boolean"},"from":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"paymentDetails":{"type":["string","null"]},"hasLogo":{"type":"boolean"}},"required":["name","address","email","phone","website","companyNumber","vatNumber","paymentDetails","hasLogo"],"additionalProperties":false},"to":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","address","email","phone"],"additionalProperties":false},"vatRegistered":{"type":"boolean"},"terms":{"type":["string","null"]},"includePhotos":{"default":false,"type":"boolean"},"photos":{"default":[],"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":"string"},"projectName":{"type":["string","null"]},"teamMemberName":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"caption":{"type":["string","null"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","caption","width","height","thumbUrl","fullUrl"],"additionalProperties":false}}},"required":["bookingId","date","start","end","name","projectName","teamMemberName","photos"],"additionalProperties":false}},"credits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt"],"additionalProperties":false}},"refunds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"type":["string","null"]},"note":{"type":["string","null"]},"byName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","amountPence","refundedOn","method","note","byName","createdAt"],"additionalProperties":false}},"refundedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditLeftPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditableLines":{"type":"array","items":{"type":"object","properties":{"invoiceLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingNetPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingVatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoiceLineId","description","vatRateBp","netPence","vatPence","remainingNetPence","remainingVatPence"],"additionalProperties":false}}},"required":["id","number","reference","status","clientId","clientName","frequency","basis","periodStart","periodEnd","manual","projectId","projectName","issueDate","dueDate","paidOn","netPence","vatPence","grossPence","missingPrices","bookings","coveredBookings","lateBookings","bookedPence","fixedPence","manualPence","missingAccepted","notes","voidReason","creditedPence","amountDuePence","calculatedAt","createdAt","lines","history","issueBlocker","unsignedBookings","listCoveredVisits","from","to","vatRegistered","terms","includePhotos","photos","credits","refunds","refundedPence","refundDuePence","creditLeftPence","creditableLines"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/{id}/pdf":{"get":{"operationId":"invoices.pdf","summary":"The invoice as a PDF (kept once issued; a draft is made fresh, marked DRAFT)","tags":["Invoices"],"x-permission":"invoice.view","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/{id}/email":{"get":{"operationId":"invoices.emailDraft","summary":"A ready-to-send email for an invoice, in the company's wording: who it could go to, subject and message","tags":["Invoices"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"kind","in":"query","required":false,"schema":{"default":"invoice","type":"string","enum":["invoice","invoice_reminder","payment_received"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"to":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":["string","null"]}},"required":["email","name"],"additionalProperties":false}},"subject":{"type":"string"},"message":{"type":"string"},"pdf":{"type":"boolean"},"link":{"type":["string","null"]}},"required":["to","subject","message","pdf","link"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/{id}/send":{"post":{"operationId":"invoices.send","summary":"Email an issued invoice (or a reminder) with its PDF and link; logged on the invoice","tags":["Invoices"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"kind","in":"query","required":false,"schema":{"default":"invoice","type":"string","enum":["invoice","invoice_reminder","payment_received"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"to":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"subject":{"type":"string","minLength":1,"maxLength":300},"message":{"type":"string","minLength":1,"maxLength":10000}},"required":["to","subject","message"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","paid","void"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"manual":{"default":false,"type":"boolean"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"default":null,"type":["string","null"]},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"paidOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"coveredBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"notes":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"creditedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["booking","fixed","manual","product"]},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"quantity":{"type":"number"},"unitPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrice":{"type":"boolean"},"late":{"type":"boolean"},"covered":{"type":"boolean"},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateOverrideBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"photoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hiddenPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsignedPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","kind","description","date","projectId","projectName","quantity","unitPence","netPence","vatRateBp","vatPence","missingPrice","late","covered","bookingId","chargePence","vatRateOverrideBp","photoCount","hiddenPhotoCount","unsignedPhotoCount"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","issued","paid","voided","line_added","line_changed","line_removed","missing_accepted","notes","credit_raised","credit_issued","credit_voided","credit_deleted","refunded","refund_removed"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"issueBlocker":{"type":["string","null"]},"unsignedBookings":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"listCoveredVisits":{"default":true,"type":"boolean"},"from":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"paymentDetails":{"type":["string","null"]},"hasLogo":{"type":"boolean"}},"required":["name","address","email","phone","website","companyNumber","vatNumber","paymentDetails","hasLogo"],"additionalProperties":false},"to":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","address","email","phone"],"additionalProperties":false},"vatRegistered":{"type":"boolean"},"terms":{"type":["string","null"]},"includePhotos":{"default":false,"type":"boolean"},"photos":{"default":[],"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":"string"},"projectName":{"type":["string","null"]},"teamMemberName":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"caption":{"type":["string","null"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","caption","width","height","thumbUrl","fullUrl"],"additionalProperties":false}}},"required":["bookingId","date","start","end","name","projectName","teamMemberName","photos"],"additionalProperties":false}},"credits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt"],"additionalProperties":false}},"refunds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"type":["string","null"]},"note":{"type":["string","null"]},"byName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","amountPence","refundedOn","method","note","byName","createdAt"],"additionalProperties":false}},"refundedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditLeftPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditableLines":{"type":"array","items":{"type":"object","properties":{"invoiceLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingNetPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingVatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoiceLineId","description","vatRateBp","netPence","vatPence","remainingNetPence","remainingVatPence"],"additionalProperties":false}}},"required":["id","number","reference","status","clientId","clientName","frequency","basis","periodStart","periodEnd","manual","projectId","projectName","issueDate","dueDate","paidOn","netPence","vatPence","grossPence","missingPrices","bookings","coveredBookings","lateBookings","bookedPence","fixedPence","manualPence","missingAccepted","notes","voidReason","creditedPence","amountDuePence","calculatedAt","createdAt","lines","history","issueBlocker","unsignedBookings","listCoveredVisits","from","to","vatRegistered","terms","includePhotos","photos","credits","refunds","refundedPence","refundDuePence","creditLeftPence","creditableLines"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/{id}/credits":{"post":{"operationId":"invoices.credit","summary":"Raise a credit note from an issued invoice: the whole of it, chosen lines, or an amount, with a reason (a draft, or issued straight away)","tags":["Invoices"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"whole"},"reason":{"type":"string","minLength":1,"maxLength":500},"uninvoiceBookings":{"default":false,"type":"boolean"},"issue":{"default":false,"type":"boolean"}},"required":["kind","reason"]},{"type":"object","properties":{"kind":{"type":"string","const":"lines"},"reason":{"type":"string","minLength":1,"maxLength":500},"lines":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"object","properties":{"invoiceLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"netPence":{"type":"integer","minimum":0,"maximum":100000000}},"required":["invoiceLineId","netPence"]}},"issue":{"default":false,"type":"boolean"}},"required":["kind","reason","lines"]},{"type":"object","properties":{"kind":{"type":"string","const":"amount"},"reason":{"type":"string","minLength":1,"maxLength":500},"grossPence":{"type":"integer","minimum":0,"maximum":100000000},"description":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"issue":{"default":false,"type":"boolean"}},"required":["kind","reason","grossPence"]}]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceLineId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string"},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","invoiceLineId","description","netPence","vatRateBp","vatPence"],"additionalProperties":false}},"vatRegistered":{"type":"boolean"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt","lines","vatRegistered"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/{id}/refunds":{"post":{"operationId":"invoices.refund","summary":"Record money paid back to the client on a paid invoice with credits","tags":["Invoices"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"amountPence":{"type":"integer","minimum":0,"maximum":100000000},"refundedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["amountPence","refundedOn"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","paid","void"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"manual":{"default":false,"type":"boolean"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"default":null,"type":["string","null"]},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"paidOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"coveredBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"notes":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"creditedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["booking","fixed","manual","product"]},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"quantity":{"type":"number"},"unitPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrice":{"type":"boolean"},"late":{"type":"boolean"},"covered":{"type":"boolean"},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateOverrideBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"photoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hiddenPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsignedPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","kind","description","date","projectId","projectName","quantity","unitPence","netPence","vatRateBp","vatPence","missingPrice","late","covered","bookingId","chargePence","vatRateOverrideBp","photoCount","hiddenPhotoCount","unsignedPhotoCount"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","issued","paid","voided","line_added","line_changed","line_removed","missing_accepted","notes","credit_raised","credit_issued","credit_voided","credit_deleted","refunded","refund_removed"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"issueBlocker":{"type":["string","null"]},"unsignedBookings":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"listCoveredVisits":{"default":true,"type":"boolean"},"from":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"paymentDetails":{"type":["string","null"]},"hasLogo":{"type":"boolean"}},"required":["name","address","email","phone","website","companyNumber","vatNumber","paymentDetails","hasLogo"],"additionalProperties":false},"to":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","address","email","phone"],"additionalProperties":false},"vatRegistered":{"type":"boolean"},"terms":{"type":["string","null"]},"includePhotos":{"default":false,"type":"boolean"},"photos":{"default":[],"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":"string"},"projectName":{"type":["string","null"]},"teamMemberName":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"caption":{"type":["string","null"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","caption","width","height","thumbUrl","fullUrl"],"additionalProperties":false}}},"required":["bookingId","date","start","end","name","projectName","teamMemberName","photos"],"additionalProperties":false}},"credits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt"],"additionalProperties":false}},"refunds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"type":["string","null"]},"note":{"type":["string","null"]},"byName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","amountPence","refundedOn","method","note","byName","createdAt"],"additionalProperties":false}},"refundedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditLeftPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditableLines":{"type":"array","items":{"type":"object","properties":{"invoiceLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingNetPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingVatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoiceLineId","description","vatRateBp","netPence","vatPence","remainingNetPence","remainingVatPence"],"additionalProperties":false}}},"required":["id","number","reference","status","clientId","clientName","frequency","basis","periodStart","periodEnd","manual","projectId","projectName","issueDate","dueDate","paidOn","netPence","vatPence","grossPence","missingPrices","bookings","coveredBookings","lateBookings","bookedPence","fixedPence","manualPence","missingAccepted","notes","voidReason","creditedPence","amountDuePence","calculatedAt","createdAt","lines","history","issueBlocker","unsignedBookings","listCoveredVisits","from","to","vatRegistered","terms","includePhotos","photos","credits","refunds","refundedPence","refundDuePence","creditLeftPence","creditableLines"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/invoices/{id}/refunds/{refundId}":{"delete":{"operationId":"invoices.removeRefund","summary":"Take back a refund recorded by mistake","tags":["Invoices"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"refundId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","paid","void"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"frequency":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","ad_hoc"]},"basis":{"type":"string","enum":["bookings","fixed"]},"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"manual":{"default":false,"type":"boolean"},"projectId":{"default":null,"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"default":null,"type":["string","null"]},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"paidOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"coveredBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lateBookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fixedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingAccepted":{"type":"boolean"},"notes":{"type":["string","null"]},"voidReason":{"type":["string","null"]},"creditedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"calculatedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["booking","fixed","manual","product"]},"description":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"quantity":{"type":"number"},"unitPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingPrice":{"type":"boolean"},"late":{"type":"boolean"},"covered":{"type":"boolean"},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"chargePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateOverrideBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"photoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hiddenPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unsignedPhotoCount":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","kind","description","date","projectId","projectName","quantity","unitPence","netPence","vatRateBp","vatPence","missingPrice","late","covered","bookingId","chargePence","vatRateOverrideBp","photoCount","hiddenPhotoCount","unsignedPhotoCount"],"additionalProperties":false}},"history":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","issued","paid","voided","line_added","line_changed","line_removed","missing_accepted","notes","credit_raised","credit_issued","credit_voided","credit_deleted","refunded","refund_removed"]},"byName":{"type":["string","null"]},"at":{"type":"string"},"reason":{"type":["string","null"]},"summary":{"type":["string","null"]}},"required":["id","kind","byName","at","reason","summary"],"additionalProperties":false}},"issueBlocker":{"type":["string","null"]},"unsignedBookings":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"listCoveredVisits":{"default":true,"type":"boolean"},"from":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"paymentDetails":{"type":["string","null"]},"hasLogo":{"type":"boolean"}},"required":["name","address","email","phone","website","companyNumber","vatNumber","paymentDetails","hasLogo"],"additionalProperties":false},"to":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]}},"required":["name","address","email","phone"],"additionalProperties":false},"vatRegistered":{"type":"boolean"},"terms":{"type":["string","null"]},"includePhotos":{"default":false,"type":"boolean"},"photos":{"default":[],"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"name":{"type":"string"},"projectName":{"type":["string","null"]},"teamMemberName":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"caption":{"type":["string","null"]},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","caption","width","height","thumbUrl","fullUrl"],"additionalProperties":false}}},"required":["bookingId","date","start","end","name","projectName","teamMemberName","photos"],"additionalProperties":false}},"credits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt"],"additionalProperties":false}},"refunds":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amountPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"type":["string","null"]},"note":{"type":["string","null"]},"byName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","amountPence","refundedOn","method","note","byName","createdAt"],"additionalProperties":false}},"refundedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundDuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditLeftPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditableLines":{"type":"array","items":{"type":"object","properties":{"invoiceLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingNetPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"remainingVatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["invoiceLineId","description","vatRateBp","netPence","vatPence","remainingNetPence","remainingVatPence"],"additionalProperties":false}}},"required":["id","number","reference","status","clientId","clientName","frequency","basis","periodStart","periodEnd","manual","projectId","projectName","issueDate","dueDate","paidOn","netPence","vatPence","grossPence","missingPrices","bookings","coveredBookings","lateBookings","bookedPence","fixedPence","manualPence","missingAccepted","notes","voidReason","creditedPence","amountDuePence","calculatedAt","createdAt","lines","history","issueBlocker","unsignedBookings","listCoveredVisits","from","to","vatRegistered","terms","includePhotos","photos","credits","refunds","refundedPence","refundDuePence","creditLeftPence","creditableLines"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/credit-notes":{"get":{"operationId":"creditNotes.list","summary":"Credit notes, newest first","tags":["Invoices"],"x-permission":"invoice.view","x-module":"invoicing","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","issued","void"]}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"invoiceId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/credit-notes/{id}":{"get":{"operationId":"creditNotes.get","summary":"One credit note and its lines","tags":["Invoices"],"x-permission":"invoice.view","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceLineId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string"},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","invoiceLineId","description","netPence","vatRateBp","vatPence"],"additionalProperties":false}},"vatRegistered":{"type":"boolean"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt","lines","vatRegistered"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"creditNotes.remove","summary":"Delete a draft credit note","tags":["Invoices"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/credit-notes/{id}/issue":{"post":{"operationId":"creditNotes.issue","summary":"Issue a draft credit note: it gets the next credit number and comes off the invoice's amount due","tags":["Invoices"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceLineId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string"},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","invoiceLineId","description","netPence","vatRateBp","vatPence"],"additionalProperties":false}},"vatRegistered":{"type":"boolean"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt","lines","vatRegistered"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/credit-notes/{id}/void":{"post":{"operationId":"creditNotes.void","summary":"Void an issued credit note, saying why (it keeps its number)","tags":["Invoices"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceLineId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string"},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","invoiceLineId","description","netPence","vatRateBp","vatPence"],"additionalProperties":false}},"vatRegistered":{"type":"boolean"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt","lines","vatRegistered"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/credit-notes/{id}/pdf":{"get":{"operationId":"creditNotes.pdf","summary":"The credit note as a PDF","tags":["Invoices"],"x-permission":"invoice.view","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/credit-notes/{id}/email":{"get":{"operationId":"creditNotes.emailDraft","summary":"A ready-to-send email for a credit note, in the company's wording","tags":["Invoices"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"to":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":["string","null"]}},"required":["email","name"],"additionalProperties":false}},"subject":{"type":"string"},"message":{"type":"string"},"pdf":{"type":"boolean"},"link":{"type":["string","null"]}},"required":["to","subject","message","pdf","link"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/credit-notes/{id}/send":{"post":{"operationId":"creditNotes.send","summary":"Email an issued credit note with its PDF and the invoice's link","tags":["Invoices"],"x-permission":"invoice.manage","x-module":"invoicing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"to":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"subject":{"type":"string","minLength":1,"maxLength":300},"message":{"type":"string","minLength":1,"maxLength":10000}},"required":["to","subject","message"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceReference":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","issued","void"]},"kind":{"type":"string","enum":["whole","lines","amount"]},"reason":{"type":"string"},"issueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoiceBookings":{"type":"boolean"},"voidReason":{"type":["string","null"]},"createdAt":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invoiceLineId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string"},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","invoiceLineId","description","netPence","vatRateBp","vatPence"],"additionalProperties":false}},"vatRegistered":{"type":"boolean"}},"required":["id","invoiceId","invoiceReference","clientId","clientName","number","reference","status","kind","reason","issueDate","netPence","vatPence","grossPence","uninvoiceBookings","voidReason","createdAt","lines","vatRegistered"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/purchasing/settings":{"get":{"operationId":"purchasing.settings","summary":"The markup, order numbering, when client purchases are charged, and where orders are delivered","tags":["Purchasing"],"x-permission":"purchase.view","x-module":"purchases","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"markupBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"poPrefix":{"type":"string"},"nextPoNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"chargeOn":{"type":"string","enum":["receipt","order"]},"deliverTo":{"type":["string","null"]}},"required":["markupBp","poPrefix","nextPoNumber","chargeOn","deliverTo"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"purchasing.updateSettings","summary":"Change the purchasing settings","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"markupBp":{"type":"integer","minimum":0,"maximum":100000},"poPrefix":{"type":"string","minLength":1,"maxLength":10},"nextPoNumber":{"type":"integer","minimum":1,"maximum":10000000},"chargeOn":{"type":"string","enum":["receipt","order"]},"deliverTo":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"markupBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"poPrefix":{"type":"string"},"nextPoNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"chargeOn":{"type":"string","enum":["receipt","order"]},"deliverTo":{"type":["string","null"]}},"required":["markupBp","poPrefix","nextPoNumber","chargeOn","deliverTo"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/purchasing/low-stock-orders":{"post":{"operationId":"purchasing.lowStockOrders","summary":"Draft an order to each product's supplier for everything at or below its reorder level","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"orders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"supplierName":{"type":"string"},"lines":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","supplierName","lines"],"additionalProperties":false}},"skipped":{"type":"array","items":{"type":"string"}}},"required":["orders","skipped"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/purchasing/to-recharge":{"get":{"operationId":"purchasing.toRecharge","summary":"Client orders, and stock given to clients, not invoiced in full yet","tags":["Purchasing"],"x-permission":"purchase.view","x-module":"purchases","parameters":[{"name":"clientId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"rows":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["order","stock"]},"key":{"type":"string"},"orderId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"reference":{"type":["string","null"]},"fromStock":{"type":"boolean"},"supplierName":{"type":["string","null"]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"uninvoicedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoicedCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"partlyInvoiced":{"type":"boolean"},"onDraft":{"type":"boolean"}},"required":["kind","key","orderId","reference","fromStock","supplierName","clientId","clientName","date","uninvoicedPence","uninvoicedCount","partlyInvoiced","onDraft"],"additionalProperties":false}},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"pence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["rows","count","pence"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/purchasing/reports/purchases":{"get":{"operationId":"purchasing.purchasesCsv","summary":"Download what was received, by supplier and month, as CSV","tags":["Purchasing"],"x-permission":"purchase.view","x-module":"purchases","parameters":[],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/purchasing/reports/stock":{"get":{"operationId":"purchasing.stockCsv","summary":"Download the stock on hand and its value as CSV","tags":["Purchasing"],"x-permission":"purchase.view","x-module":"purchases","parameters":[],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/suppliers":{"get":{"operationId":"suppliers.list","summary":"Suppliers by name (archived ones with archived=true)","tags":["Purchasing"],"x-permission":"purchase.view","x-module":"purchases","parameters":[{"name":"archived","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"contactName":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"address":{"type":["string","null"]},"accountRef":{"type":["string","null"]},"notes":{"type":["string","null"]},"archived":{"type":"boolean"},"orders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","contactName","email","phone","address","accountRef","notes","archived","orders"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"suppliers.create","summary":"Add a supplier","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"contactName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"accountRef":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"contactName":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"address":{"type":["string","null"]},"accountRef":{"type":["string","null"]},"notes":{"type":["string","null"]},"archived":{"type":"boolean"},"orders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","contactName","email","phone","address","accountRef","notes","archived","orders"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/suppliers/{id}":{"patch":{"operationId":"suppliers.update","summary":"Change or archive a supplier","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"contactName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"accountRef":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"archived":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"contactName":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"address":{"type":["string","null"]},"accountRef":{"type":["string","null"]},"notes":{"type":["string","null"]},"archived":{"type":"boolean"},"orders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","contactName","email","phone","address","accountRef","notes","archived","orders"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"suppliers.remove","summary":"Delete a supplier with no orders (archive it otherwise)","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/products":{"get":{"operationId":"products.list","summary":"Products by name, with stock on hand (archived ones with archived=true)","tags":["Purchasing"],"x-permission":"purchase.view","x-module":"purchases","parameters":[{"name":"archived","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"code":{"type":["string","null"]},"unit":{"type":"string"},"supplierId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"supplierName":{"type":["string","null"]},"costPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sellPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sellAtMarkupPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"trackStock":{"type":"boolean"},"reorderLevelX100":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"onHandX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"avgCostPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"low":{"type":"boolean"},"archived":{"type":"boolean"}},"required":["id","name","code","unit","supplierId","supplierName","costPence","sellPence","sellAtMarkupPence","vatRateBp","trackStock","reorderLevelX100","onHandX100","avgCostPence","low","archived"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"products.create","summary":"Add a product","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"code":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"unit":{"default":"each","type":"string","minLength":1,"maxLength":30},"supplierId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"costPence":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000000},{"type":"null"}]},"sellPence":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000000},{"type":"null"}]},"vatRateBp":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]},"trackStock":{"default":false,"type":"boolean"},"reorderLevelX100":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000000},{"type":"null"}]}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"code":{"type":["string","null"]},"unit":{"type":"string"},"supplierId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"supplierName":{"type":["string","null"]},"costPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sellPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sellAtMarkupPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"trackStock":{"type":"boolean"},"reorderLevelX100":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"onHandX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"avgCostPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"low":{"type":"boolean"},"archived":{"type":"boolean"}},"required":["id","name","code","unit","supplierId","supplierName","costPence","sellPence","sellAtMarkupPence","vatRateBp","trackStock","reorderLevelX100","onHandX100","avgCostPence","low","archived"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/products/{id}":{"patch":{"operationId":"products.update","summary":"Change or archive a product","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"code":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"unit":{"default":"each","type":"string","minLength":1,"maxLength":30},"supplierId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"costPence":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000000},{"type":"null"}]},"sellPence":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000000},{"type":"null"}]},"vatRateBp":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]},"trackStock":{"default":false,"type":"boolean"},"reorderLevelX100":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000000},{"type":"null"}]},"archived":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"code":{"type":["string","null"]},"unit":{"type":"string"},"supplierId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"supplierName":{"type":["string","null"]},"costPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sellPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sellAtMarkupPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"trackStock":{"type":"boolean"},"reorderLevelX100":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"onHandX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"avgCostPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"low":{"type":"boolean"},"archived":{"type":"boolean"}},"required":["id","name","code","unit","supplierId","supplierName","costPence","sellPence","sellAtMarkupPence","vatRateBp","trackStock","reorderLevelX100","onHandX100","avgCostPence","low","archived"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"products.remove","summary":"Delete a product never ordered or stocked (archive it otherwise)","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/products/{id}/movements":{"get":{"operationId":"products.movements","summary":"A product's stock movements, newest first","tags":["Purchasing"],"x-permission":"purchase.view","x-module":"purchases","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["received","issued","adjusted","returned"]},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitCostPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reason":{"type":["string","null"]},"reference":{"type":["string","null"]},"clientName":{"type":["string","null"]},"byName":{"type":["string","null"]},"at":{"type":"string"}},"required":["id","kind","quantityX100","unitCostPence","reason","reference","clientName","byName","at"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/products/{id}/adjust":{"post":{"operationId":"products.adjust","summary":"Count the stock of a product, or add or take some away, saying why","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"type":"string","enum":["count","change"]},"quantityX100":{"type":"integer","minimum":-100000000,"maximum":100000000},"reason":{"type":"string","minLength":1,"maxLength":500},"unitCostPence":{"type":"integer","minimum":0,"maximum":100000000}},"required":["mode","quantityX100","reason"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"code":{"type":["string","null"]},"unit":{"type":"string"},"supplierId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"supplierName":{"type":["string","null"]},"costPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sellPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sellAtMarkupPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"trackStock":{"type":"boolean"},"reorderLevelX100":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"onHandX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"avgCostPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"low":{"type":"boolean"},"archived":{"type":"boolean"}},"required":["id","name","code","unit","supplierId","supplierName","costPence","sellPence","sellAtMarkupPence","vatRateBp","trackStock","reorderLevelX100","onHandX100","avgCostPence","low","archived"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/products/{id}/issue":{"post":{"operationId":"products.issue","summary":"Take some from stock for a client: it becomes a charge on their next invoice","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"quantityX100":{"type":"integer","minimum":1,"maximum":100000000},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"unitSellPence":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000000},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["quantityX100","clientId"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitCostPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitSellPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"source":{"type":"string","enum":["order","stock"]},"orderId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"orderReference":{"type":["string","null"]},"productId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"invoice":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reference":{"type":["string","null"]},"status":{"type":"string"}},"required":["id","reference","status"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","clientId","clientName","projectId","projectName","bookingId","date","description","quantityX100","unitCostPence","unitSellPence","netPence","vatRateBp","source","orderId","orderReference","productId","invoice","createdAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/purchase-orders":{"get":{"operationId":"purchaseOrders.list","summary":"Purchase orders, newest first","tags":["Purchasing"],"x-permission":"purchase.view","x-module":"purchases","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","ordered","part_received","received","cancelled","open"]}},{"name":"supplierId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","ordered","part_received","received","cancelled"]},"supplierId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"supplierName":{"type":"string"},"fromStock":{"type":"boolean"},"destination":{"type":"string","enum":["stock","client"]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientName":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"mixed":{"type":"boolean"},"orderDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"expectedDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"supplierRef":{"type":["string","null"]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lineCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"destinations":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","reference","status","supplierId","supplierName","fromStock","destination","clientId","clientName","projectId","projectName","mixed","orderDate","expectedDate","supplierRef","netPence","vatPence","grossPence","lineCount","destinations","createdAt"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"purchaseOrders.create","summary":"Start an order (a draft, no number yet)","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"supplierId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"newSupplier":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]}},"required":["name"]},"fromStock":{"default":false,"type":"boolean"},"destination":{"type":"string","enum":["stock","client"]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"orderDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"expectedDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"deliverTo":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"lines":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"productId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string","minLength":1,"maxLength":500},"supplierCode":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"unit":{"default":"each","type":"string","minLength":1,"maxLength":30},"quantityX100":{"type":"integer","minimum":1,"maximum":100000000},"unitCostPence":{"default":0,"type":"integer","minimum":0,"maximum":100000000},"vatRateBp":{"default":2000,"type":"integer","minimum":0,"maximum":10000},"destination":{"type":"string","enum":["stock","client"]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"markupBp":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000},{"type":"null"}]},"saveAsProduct":{"default":false,"type":"boolean"}},"required":["description","quantityX100"]}}},"required":["lines"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","ordered","part_received","received","cancelled"]},"supplierId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"supplierName":{"type":"string"},"fromStock":{"type":"boolean"},"destination":{"type":"string","enum":["stock","client"]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientName":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"mixed":{"type":"boolean"},"orderDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"expectedDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"supplierRef":{"type":["string","null"]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lineCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"destinations":{"type":"string"},"createdAt":{"type":"string"},"supplierEmail":{"type":["string","null"]},"deliverTo":{"type":["string","null"]},"notes":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"productId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"code":{"type":["string","null"]},"supplierCode":{"type":["string","null"]},"description":{"type":"string"},"unit":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"receivedX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitCostPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"destination":{"type":"string","enum":["stock","client"]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientName":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"markupBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"unitSellPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lockedBy":{"type":["string","null"]}},"required":["id","productId","code","supplierCode","description","unit","quantityX100","receivedX100","unitCostPence","vatRateBp","netPence","destination","clientId","clientName","projectId","projectName","markupBp","unitSellPence","lockedBy"],"additionalProperties":false}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"receivedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"supplierRef":{"type":["string","null"]},"byName":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitCostPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["description","quantityX100","unitCostPence"],"additionalProperties":false}}},"required":["id","receivedOn","supplierRef","byName","lines"],"additionalProperties":false}},"sentAt":{"type":["string","null"]},"cancelReason":{"type":["string","null"]}},"required":["id","reference","status","supplierId","supplierName","fromStock","destination","clientId","clientName","projectId","projectName","mixed","orderDate","expectedDate","supplierRef","netPence","vatPence","grossPence","lineCount","destinations","createdAt","supplierEmail","deliverTo","notes","lines","receipts","sentAt","cancelReason"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/purchase-orders/suggest":{"get":{"operationId":"purchaseOrders.suggest","summary":"Products, and things bought before, matching what is typed on an order line (the same supplier first)","tags":["Purchasing"],"x-permission":"purchase.view","x-module":"purchases","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"supplierId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["product","history"]},"productId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string"},"supplierCode":{"type":["string","null"]},"unit":{"type":"string"},"supplierId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"supplierName":{"type":["string","null"]},"unitCostPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"trackStock":{"type":"boolean"},"onHandX100":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["source","productId","description","supplierCode","unit","supplierId","supplierName","unitCostPence","vatRateBp","lastDate","trackStock","onHandX100"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/purchase-orders/{id}":{"get":{"operationId":"purchaseOrders.get","summary":"One order, its lines and what has arrived","tags":["Purchasing"],"x-permission":"purchase.view","x-module":"purchases","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","ordered","part_received","received","cancelled"]},"supplierId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"supplierName":{"type":"string"},"fromStock":{"type":"boolean"},"destination":{"type":"string","enum":["stock","client"]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientName":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"mixed":{"type":"boolean"},"orderDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"expectedDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"supplierRef":{"type":["string","null"]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lineCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"destinations":{"type":"string"},"createdAt":{"type":"string"},"supplierEmail":{"type":["string","null"]},"deliverTo":{"type":["string","null"]},"notes":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"productId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"code":{"type":["string","null"]},"supplierCode":{"type":["string","null"]},"description":{"type":"string"},"unit":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"receivedX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitCostPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"destination":{"type":"string","enum":["stock","client"]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientName":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"markupBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"unitSellPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lockedBy":{"type":["string","null"]}},"required":["id","productId","code","supplierCode","description","unit","quantityX100","receivedX100","unitCostPence","vatRateBp","netPence","destination","clientId","clientName","projectId","projectName","markupBp","unitSellPence","lockedBy"],"additionalProperties":false}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"receivedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"supplierRef":{"type":["string","null"]},"byName":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitCostPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["description","quantityX100","unitCostPence"],"additionalProperties":false}}},"required":["id","receivedOn","supplierRef","byName","lines"],"additionalProperties":false}},"sentAt":{"type":["string","null"]},"cancelReason":{"type":["string","null"]}},"required":["id","reference","status","supplierId","supplierName","fromStock","destination","clientId","clientName","projectId","projectName","mixed","orderDate","expectedDate","supplierRef","netPence","vatPence","grossPence","lineCount","destinations","createdAt","supplierEmail","deliverTo","notes","lines","receipts","sentAt","cancelReason"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"purchaseOrders.update","summary":"Change an order. A draft's lines are replaced as a whole; a placed or arrived order's lines are amended in place (send each line's id), with stock and client charges following","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"supplierId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"newSupplier":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"anyOf":[{"anyOf":[{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]}},"required":["name"]},"destination":{"type":"string","enum":["stock","client"]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"orderDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"expectedDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"deliverTo":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"lines":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"productId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string","minLength":1,"maxLength":500},"supplierCode":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"unit":{"default":"each","type":"string","minLength":1,"maxLength":30},"quantityX100":{"type":"integer","minimum":1,"maximum":100000000},"unitCostPence":{"default":0,"type":"integer","minimum":0,"maximum":100000000},"vatRateBp":{"default":2000,"type":"integer","minimum":0,"maximum":10000},"destination":{"type":"string","enum":["stock","client"]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"markupBp":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000},{"type":"null"}]},"saveAsProduct":{"default":false,"type":"boolean"}},"required":["description","quantityX100"]}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","ordered","part_received","received","cancelled"]},"supplierId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"supplierName":{"type":"string"},"fromStock":{"type":"boolean"},"destination":{"type":"string","enum":["stock","client"]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientName":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"mixed":{"type":"boolean"},"orderDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"expectedDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"supplierRef":{"type":["string","null"]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lineCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"destinations":{"type":"string"},"createdAt":{"type":"string"},"supplierEmail":{"type":["string","null"]},"deliverTo":{"type":["string","null"]},"notes":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"productId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"code":{"type":["string","null"]},"supplierCode":{"type":["string","null"]},"description":{"type":"string"},"unit":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"receivedX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitCostPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"destination":{"type":"string","enum":["stock","client"]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientName":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"markupBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"unitSellPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lockedBy":{"type":["string","null"]}},"required":["id","productId","code","supplierCode","description","unit","quantityX100","receivedX100","unitCostPence","vatRateBp","netPence","destination","clientId","clientName","projectId","projectName","markupBp","unitSellPence","lockedBy"],"additionalProperties":false}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"receivedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"supplierRef":{"type":["string","null"]},"byName":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitCostPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["description","quantityX100","unitCostPence"],"additionalProperties":false}}},"required":["id","receivedOn","supplierRef","byName","lines"],"additionalProperties":false}},"sentAt":{"type":["string","null"]},"cancelReason":{"type":["string","null"]}},"required":["id","reference","status","supplierId","supplierName","fromStock","destination","clientId","clientName","projectId","projectName","mixed","orderDate","expectedDate","supplierRef","netPence","vatPence","grossPence","lineCount","destinations","createdAt","supplierEmail","deliverTo","notes","lines","receipts","sentAt","cancelReason"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"purchaseOrders.remove","summary":"Delete a draft order","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/purchase-orders/{id}/order":{"post":{"operationId":"purchaseOrders.order","summary":"Mark a draft as placed with the supplier (on its order date, or today): it gets its number","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","ordered","part_received","received","cancelled"]},"supplierId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"supplierName":{"type":"string"},"fromStock":{"type":"boolean"},"destination":{"type":"string","enum":["stock","client"]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientName":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"mixed":{"type":"boolean"},"orderDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"expectedDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"supplierRef":{"type":["string","null"]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lineCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"destinations":{"type":"string"},"createdAt":{"type":"string"},"supplierEmail":{"type":["string","null"]},"deliverTo":{"type":["string","null"]},"notes":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"productId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"code":{"type":["string","null"]},"supplierCode":{"type":["string","null"]},"description":{"type":"string"},"unit":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"receivedX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitCostPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"destination":{"type":"string","enum":["stock","client"]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientName":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"markupBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"unitSellPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lockedBy":{"type":["string","null"]}},"required":["id","productId","code","supplierCode","description","unit","quantityX100","receivedX100","unitCostPence","vatRateBp","netPence","destination","clientId","clientName","projectId","projectName","markupBp","unitSellPence","lockedBy"],"additionalProperties":false}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"receivedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"supplierRef":{"type":["string","null"]},"byName":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitCostPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["description","quantityX100","unitCostPence"],"additionalProperties":false}}},"required":["id","receivedOn","supplierRef","byName","lines"],"additionalProperties":false}},"sentAt":{"type":["string","null"]},"cancelReason":{"type":["string","null"]}},"required":["id","reference","status","supplierId","supplierName","fromStock","destination","clientId","clientName","projectId","projectName","mixed","orderDate","expectedDate","supplierRef","netPence","vatPence","grossPence","lineCount","destinations","createdAt","supplierEmail","deliverTo","notes","lines","receipts","sentAt","cancelReason"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/purchase-orders/{id}/receive":{"post":{"operationId":"purchaseOrders.receive","summary":"Record what arrived (at what it actually cost): stock lines go into stock, clients' lines become charges to them","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"receivedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"supplierRef":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"lines":{"minItems":1,"type":"array","items":{"type":"object","properties":{"lineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"quantityX100":{"type":"integer","minimum":0,"maximum":100000000},"unitCostPence":{"type":"integer","minimum":0,"maximum":100000000}},"required":["lineId","quantityX100"]}}},"required":["lines"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","ordered","part_received","received","cancelled"]},"supplierId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"supplierName":{"type":"string"},"fromStock":{"type":"boolean"},"destination":{"type":"string","enum":["stock","client"]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientName":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"mixed":{"type":"boolean"},"orderDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"expectedDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"supplierRef":{"type":["string","null"]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lineCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"destinations":{"type":"string"},"createdAt":{"type":"string"},"supplierEmail":{"type":["string","null"]},"deliverTo":{"type":["string","null"]},"notes":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"productId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"code":{"type":["string","null"]},"supplierCode":{"type":["string","null"]},"description":{"type":"string"},"unit":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"receivedX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitCostPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"destination":{"type":"string","enum":["stock","client"]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientName":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"markupBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"unitSellPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lockedBy":{"type":["string","null"]}},"required":["id","productId","code","supplierCode","description","unit","quantityX100","receivedX100","unitCostPence","vatRateBp","netPence","destination","clientId","clientName","projectId","projectName","markupBp","unitSellPence","lockedBy"],"additionalProperties":false}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"receivedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"supplierRef":{"type":["string","null"]},"byName":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitCostPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["description","quantityX100","unitCostPence"],"additionalProperties":false}}},"required":["id","receivedOn","supplierRef","byName","lines"],"additionalProperties":false}},"sentAt":{"type":["string","null"]},"cancelReason":{"type":["string","null"]}},"required":["id","reference","status","supplierId","supplierName","fromStock","destination","clientId","clientName","projectId","projectName","mixed","orderDate","expectedDate","supplierRef","netPence","vatPence","grossPence","lineCount","destinations","createdAt","supplierEmail","deliverTo","notes","lines","receipts","sentAt","cancelReason"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/purchase-orders/{id}/arrived":{"post":{"operationId":"purchaseOrders.arrived","summary":"Mark the order as arrived (on a date, today if not given), at the costs on it; a draft is placed first","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"receivedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"supplierRef":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","ordered","part_received","received","cancelled"]},"supplierId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"supplierName":{"type":"string"},"fromStock":{"type":"boolean"},"destination":{"type":"string","enum":["stock","client"]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientName":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"mixed":{"type":"boolean"},"orderDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"expectedDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"supplierRef":{"type":["string","null"]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lineCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"destinations":{"type":"string"},"createdAt":{"type":"string"},"supplierEmail":{"type":["string","null"]},"deliverTo":{"type":["string","null"]},"notes":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"productId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"code":{"type":["string","null"]},"supplierCode":{"type":["string","null"]},"description":{"type":"string"},"unit":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"receivedX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitCostPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"destination":{"type":"string","enum":["stock","client"]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientName":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"markupBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"unitSellPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lockedBy":{"type":["string","null"]}},"required":["id","productId","code","supplierCode","description","unit","quantityX100","receivedX100","unitCostPence","vatRateBp","netPence","destination","clientId","clientName","projectId","projectName","markupBp","unitSellPence","lockedBy"],"additionalProperties":false}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"receivedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"supplierRef":{"type":["string","null"]},"byName":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitCostPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["description","quantityX100","unitCostPence"],"additionalProperties":false}}},"required":["id","receivedOn","supplierRef","byName","lines"],"additionalProperties":false}},"sentAt":{"type":["string","null"]},"cancelReason":{"type":["string","null"]}},"required":["id","reference","status","supplierId","supplierName","fromStock","destination","clientId","clientName","projectId","projectName","mixed","orderDate","expectedDate","supplierRef","netPence","vatPence","grossPence","lineCount","destinations","createdAt","supplierEmail","deliverTo","notes","lines","receipts","sentAt","cancelReason"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/purchase-orders/{id}/cancel":{"post":{"operationId":"purchaseOrders.cancel","summary":"Cancel a whole order: stock it brought in comes back out and its clients' charges go (none may be on an issued invoice)","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","ordered","part_received","received","cancelled"]},"supplierId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"supplierName":{"type":"string"},"fromStock":{"type":"boolean"},"destination":{"type":"string","enum":["stock","client"]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientName":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"mixed":{"type":"boolean"},"orderDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"expectedDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"supplierRef":{"type":["string","null"]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lineCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"destinations":{"type":"string"},"createdAt":{"type":"string"},"supplierEmail":{"type":["string","null"]},"deliverTo":{"type":["string","null"]},"notes":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"productId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"code":{"type":["string","null"]},"supplierCode":{"type":["string","null"]},"description":{"type":"string"},"unit":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"receivedX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitCostPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"destination":{"type":"string","enum":["stock","client"]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientName":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"markupBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"unitSellPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lockedBy":{"type":["string","null"]}},"required":["id","productId","code","supplierCode","description","unit","quantityX100","receivedX100","unitCostPence","vatRateBp","netPence","destination","clientId","clientName","projectId","projectName","markupBp","unitSellPence","lockedBy"],"additionalProperties":false}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"receivedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"supplierRef":{"type":["string","null"]},"byName":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitCostPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["description","quantityX100","unitCostPence"],"additionalProperties":false}}},"required":["id","receivedOn","supplierRef","byName","lines"],"additionalProperties":false}},"sentAt":{"type":["string","null"]},"cancelReason":{"type":["string","null"]}},"required":["id","reference","status","supplierId","supplierName","fromStock","destination","clientId","clientName","projectId","projectName","mixed","orderDate","expectedDate","supplierRef","netPence","vatPence","grossPence","lineCount","destinations","createdAt","supplierEmail","deliverTo","notes","lines","receipts","sentAt","cancelReason"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/purchase-orders/{id}/pdf":{"get":{"operationId":"purchaseOrders.pdf","summary":"The order as a PDF, as the supplier sees it","tags":["Purchasing"],"x-permission":"purchase.view","x-module":"purchases","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/purchase-orders/{id}/email":{"get":{"operationId":"purchaseOrders.emailDraft","summary":"A ready-to-send email of the order to its supplier, in the company's wording","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"to":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":["string","null"]}},"required":["email","name"],"additionalProperties":false}},"subject":{"type":"string"},"message":{"type":"string"},"pdf":{"type":"boolean"},"link":{"type":["string","null"]}},"required":["to","subject","message","pdf","link"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/purchase-orders/{id}/send":{"post":{"operationId":"purchaseOrders.send","summary":"Email the order to the supplier with its PDF (a draft is marked ordered and numbered first)","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"to":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"subject":{"type":"string","minLength":1,"maxLength":300},"message":{"type":"string","minLength":1,"maxLength":10000}},"required":["to","subject","message"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reference":{"type":["string","null"]},"status":{"type":"string","enum":["draft","ordered","part_received","received","cancelled"]},"supplierId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"supplierName":{"type":"string"},"fromStock":{"type":"boolean"},"destination":{"type":"string","enum":["stock","client"]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientName":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"mixed":{"type":"boolean"},"orderDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"expectedDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"supplierRef":{"type":["string","null"]},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"grossPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lineCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"destinations":{"type":"string"},"createdAt":{"type":"string"},"supplierEmail":{"type":["string","null"]},"deliverTo":{"type":["string","null"]},"notes":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"productId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"code":{"type":["string","null"]},"supplierCode":{"type":["string","null"]},"description":{"type":"string"},"unit":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"receivedX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitCostPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"destination":{"type":"string","enum":["stock","client"]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientName":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"markupBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"unitSellPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"lockedBy":{"type":["string","null"]}},"required":["id","productId","code","supplierCode","description","unit","quantityX100","receivedX100","unitCostPence","vatRateBp","netPence","destination","clientId","clientName","projectId","projectName","markupBp","unitSellPence","lockedBy"],"additionalProperties":false}},"receipts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"receivedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"supplierRef":{"type":["string","null"]},"byName":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitCostPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["description","quantityX100","unitCostPence"],"additionalProperties":false}}},"required":["id","receivedOn","supplierRef","byName","lines"],"additionalProperties":false}},"sentAt":{"type":["string","null"]},"cancelReason":{"type":["string","null"]}},"required":["id","reference","status","supplierId","supplierName","fromStock","destination","clientId","clientName","projectId","projectName","mixed","orderDate","expectedDate","supplierRef","netPence","vatPence","grossPence","lineCount","destinations","createdAt","supplierEmail","deliverTo","notes","lines","receipts","sentAt","cancelReason"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/client-charges":{"get":{"operationId":"clientCharges.list","summary":"Products and materials charged to clients, newest first, with what is not invoiced yet","tags":["Purchasing"],"x-permission":"purchase.view","x-module":"purchases","parameters":[{"name":"clientId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"uninvoiced","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"charges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitCostPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitSellPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"source":{"type":"string","enum":["order","stock"]},"orderId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"orderReference":{"type":["string","null"]},"productId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"invoice":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reference":{"type":["string","null"]},"status":{"type":"string"}},"required":["id","reference","status"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","clientId","clientName","projectId","projectName","bookingId","date","description","quantityX100","unitCostPence","unitSellPence","netPence","vatRateBp","source","orderId","orderReference","productId","invoice","createdAt"],"additionalProperties":false}},"uninvoicedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"uninvoicedCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["charges","uninvoicedPence","uninvoicedCount"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/client-charges/{id}":{"patch":{"operationId":"clientCharges.update","summary":"Change a charge that is not on an invoice yet","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":500},"quantityX100":{"type":"integer","minimum":1,"maximum":100000000},"unitSellPence":{"type":"integer","minimum":0,"maximum":100000000},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"bookingId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitCostPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitSellPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"vatRateBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"source":{"type":"string","enum":["order","stock"]},"orderId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"orderReference":{"type":["string","null"]},"productId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"invoice":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reference":{"type":["string","null"]},"status":{"type":"string"}},"required":["id","reference","status"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","clientId","clientName","projectId","projectName","bookingId","date","description","quantityX100","unitCostPence","unitSellPence","netPence","vatRateBp","source","orderId","orderReference","productId","invoice","createdAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"clientCharges.remove","summary":"Take off a charge that is not on an invoice (one from stock goes back into stock)","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/clients/{id}/markup":{"get":{"operationId":"clientCharges.markup","summary":"A client's own markup on purchases (null: the company's)","tags":["Purchasing"],"x-permission":"purchase.view","x-module":"purchases","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"markupBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["markupBp"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"put":{"operationId":"clientCharges.setMarkup","summary":"Set a client's own markup, or null for the company's","tags":["Purchasing"],"x-permission":"purchase.manage","x-module":"purchases","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"markupBp":{"anyOf":[{"type":"integer","minimum":0,"maximum":100000},{"type":"null"}]}},"required":["markupBp"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"markupBp":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["markupBp"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/enquiries":{"get":{"operationId":"enquiries.list","summary":"Enquiries by stage, with counts, how many next actions are due, and the address to forward enquiries to","tags":["Enquiries"],"x-permission":"enquiry.view","x-module":"quotes","parameters":[{"name":"status","in":"query","required":false,"schema":{"default":"open","type":"string","enum":["new","contacted","quoted","won","lost","open","all"]}},{"name":"view","in":"query","required":false,"schema":{"default":"list","type":"string","enum":["list","board"]}},{"name":"stageId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["email","manual","phone","website"]}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"quiet","in":"query","required":false,"schema":{"type":"string","enum":["1"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"assignedUserId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"due","in":"query","required":false,"schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enquiries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"company":{"type":["string","null"]},"subject":{"type":["string","null"]},"status":{"type":"string","enum":["new","contacted","quoted","won","lost"]},"source":{"type":"string","enum":["email","manual","phone","website"]},"lostReason":{"anyOf":[{"type":"string","enum":["price","timing","no_reply","not_a_fit","other"]},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedName":{"type":["string","null"]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"type":["string","null"]},"overdue":{"type":"boolean"},"lastActivityAt":{"type":"string"},"lastActivity":{"type":["string","null"]},"unread":{"type":"boolean"},"createdAt":{"type":"string"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageName":{"type":"string"},"stageKey":{"anyOf":[{"type":"string","enum":["new","contacted","site_visit","quoted","won","lost"]},{"type":"null"}]},"stageKind":{"type":"string","enum":["open","won","lost"]},"probability":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stageEnteredAt":{"type":"string"},"daysInStage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valuePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"valueFrom":{"anyOf":[{"type":"string","enum":["quote","typed"]},{"type":"null"}]},"valueOneOffPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valueYearlyPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualValuePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"weightedPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"expectedCloseOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"closedAt":{"type":["string","null"]},"goneQuiet":{"type":"boolean"},"followUp":{"anyOf":[{"type":"string","enum":["not_viewed","expiring","declined"]},{"type":"null"}]},"quoteId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"quoteReference":{"type":["string","null"]},"quoteStatus":{"type":["string","null"]}},"required":["id","name","email","phone","company","subject","status","source","lostReason","clientId","clientName","assignedUserId","assignedName","nextActionOn","nextAction","overdue","lastActivityAt","lastActivity","unread","createdAt","stageId","stageName","stageKey","stageKind","probability","stageEnteredAt","daysInStage","valuePence","valueFrom","valueOneOffPence","valueYearlyPence","manualValuePence","weightedPence","expectedCloseOn","closedAt","goneQuiet","followUp","quoteId","quoteReference","quoteStatus"],"additionalProperties":false}},"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"key":{"anyOf":[{"type":"string","enum":["new","contacted","site_visit","quoted","won","lost"]},{"type":"null"}]},"kind":{"type":"string","enum":["open","won","lost"]},"probability":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","key","kind","probability","position"],"additionalProperties":false}},"quiet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"goneQuietDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"counts":{"type":"object","propertyNames":{"type":"string","enum":["new","contacted","quoted","won","lost","open","all"]},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"required":["new","contacted","quoted","won","lost","open","all"]},"due":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"inboundAddress":{"type":"string"}},"required":["enquiries","stages","quiet","goneQuietDays","counts","due","inboundAddress"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"enquiries.create","summary":"Add an enquiry by hand (a phone call, a pasted email)","tags":["Enquiries"],"x-permission":"enquiry.manage","x-module":"quotes","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"anyOf":[{"anyOf":[{"type":"string","const":""},{"type":"string"}]},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"subject":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"message":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"source":{"default":"manual","type":"string","enum":["email","manual","phone","website"]},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"valuePence":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000},{"type":"null"}]},"expectedCloseOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"company":{"type":["string","null"]},"subject":{"type":["string","null"]},"status":{"type":"string","enum":["new","contacted","quoted","won","lost"]},"source":{"type":"string","enum":["email","manual","phone","website"]},"lostReason":{"anyOf":[{"type":"string","enum":["price","timing","no_reply","not_a_fit","other"]},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedName":{"type":["string","null"]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"type":["string","null"]},"overdue":{"type":"boolean"},"lastActivityAt":{"type":"string"},"lastActivity":{"type":["string","null"]},"unread":{"type":"boolean"},"createdAt":{"type":"string"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageName":{"type":"string"},"stageKey":{"anyOf":[{"type":"string","enum":["new","contacted","site_visit","quoted","won","lost"]},{"type":"null"}]},"stageKind":{"type":"string","enum":["open","won","lost"]},"probability":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stageEnteredAt":{"type":"string"},"daysInStage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valuePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"valueFrom":{"anyOf":[{"type":"string","enum":["quote","typed"]},{"type":"null"}]},"valueOneOffPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valueYearlyPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualValuePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"weightedPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"expectedCloseOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"closedAt":{"type":["string","null"]},"goneQuiet":{"type":"boolean"},"followUp":{"anyOf":[{"type":"string","enum":["not_viewed","expiring","declined"]},{"type":"null"}]},"quoteId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"quoteReference":{"type":["string","null"]},"quoteStatus":{"type":["string","null"]},"address":{"type":["string","null"]},"message":{"type":["string","null"]},"lostNote":{"type":["string","null"]},"contactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"inboundAddress":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","email_in","email_out","note","call","status","assigned","quote_sent","quote_viewed","quote_accepted","quote_declined","converted","stage","site_visit","value","email_moved","merged"]},"body":{"type":["string","null"]},"subject":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"toAddress":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","filename","contentType","bytes","url"],"additionalProperties":false}},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["queued","sent","not_sent","delivered","bounced","complained","failed"]},"detail":{"type":["string","null"]}},"required":["status","detail"],"additionalProperties":false},{"type":"null"}]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","body","subject","fromAddress","toAddress","attachments","meta","delivery","userName","createdAt"],"additionalProperties":false}}},"required":["id","name","email","phone","company","subject","status","source","lostReason","clientId","clientName","assignedUserId","assignedName","nextActionOn","nextAction","overdue","lastActivityAt","lastActivity","unread","createdAt","stageId","stageName","stageKey","stageKind","probability","stageEnteredAt","daysInStage","valuePence","valueFrom","valueOneOffPence","valueYearlyPence","manualValuePence","weightedPence","expectedCloseOn","closedAt","goneQuiet","followUp","quoteId","quoteReference","quoteStatus","address","message","lostNote","contactId","inboundAddress","events"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/enquiries/{id}/read":{"post":{"operationId":"enquiries.markRead","summary":"Mark a deal read (or unread again). Opening a deal marks it read for everyone.","tags":["Enquiries"],"x-permission":"enquiry.view","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"unread":{"default":false,"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/enquiries/settings":{"get":{"operationId":"enquiries.settings","summary":"The address this company forwards enquiries to","tags":["Enquiries"],"x-permission":"enquiry.view","x-module":"quotes","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"inboundAddress":{"type":"string"},"inboundCode":{"type":"string"},"signature":{"default":"","type":"string"}},"required":["inboundAddress","inboundCode","signature"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/enquiries/settings/new-address":{"post":{"operationId":"enquiries.newAddress","summary":"Make a new forwarding address (the old one stops working, as do replies to emails already sent)","tags":["Enquiries"],"x-permission":"enquiry.manage","x-module":"quotes","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"inboundAddress":{"type":"string"},"inboundCode":{"type":"string"},"signature":{"default":"","type":"string"}},"required":["inboundAddress","inboundCode","signature"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/enquiries/parse":{"post":{"operationId":"enquiries.parse","summary":"Read a pasted email: who sent it, their phone, the subject and their words, and any client they already are","tags":["Enquiries"],"x-permission":"enquiry.manage","x-module":"quotes","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":100000}},"required":["text"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"company":{"type":["string","null"]},"subject":{"type":["string","null"]},"message":{"type":"string"},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientName":{"type":["string","null"]}},"required":["name","email","phone","company","subject","message","clientId","clientName"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/enquiries/{id}":{"get":{"operationId":"enquiries.get","summary":"One enquiry and its timeline (marks its emails as read)","tags":["Enquiries"],"x-permission":"enquiry.view","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"company":{"type":["string","null"]},"subject":{"type":["string","null"]},"status":{"type":"string","enum":["new","contacted","quoted","won","lost"]},"source":{"type":"string","enum":["email","manual","phone","website"]},"lostReason":{"anyOf":[{"type":"string","enum":["price","timing","no_reply","not_a_fit","other"]},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedName":{"type":["string","null"]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"type":["string","null"]},"overdue":{"type":"boolean"},"lastActivityAt":{"type":"string"},"lastActivity":{"type":["string","null"]},"unread":{"type":"boolean"},"createdAt":{"type":"string"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageName":{"type":"string"},"stageKey":{"anyOf":[{"type":"string","enum":["new","contacted","site_visit","quoted","won","lost"]},{"type":"null"}]},"stageKind":{"type":"string","enum":["open","won","lost"]},"probability":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stageEnteredAt":{"type":"string"},"daysInStage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valuePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"valueFrom":{"anyOf":[{"type":"string","enum":["quote","typed"]},{"type":"null"}]},"valueOneOffPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valueYearlyPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualValuePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"weightedPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"expectedCloseOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"closedAt":{"type":["string","null"]},"goneQuiet":{"type":"boolean"},"followUp":{"anyOf":[{"type":"string","enum":["not_viewed","expiring","declined"]},{"type":"null"}]},"quoteId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"quoteReference":{"type":["string","null"]},"quoteStatus":{"type":["string","null"]},"address":{"type":["string","null"]},"message":{"type":["string","null"]},"lostNote":{"type":["string","null"]},"contactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"inboundAddress":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","email_in","email_out","note","call","status","assigned","quote_sent","quote_viewed","quote_accepted","quote_declined","converted","stage","site_visit","value","email_moved","merged"]},"body":{"type":["string","null"]},"subject":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"toAddress":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","filename","contentType","bytes","url"],"additionalProperties":false}},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["queued","sent","not_sent","delivered","bounced","complained","failed"]},"detail":{"type":["string","null"]}},"required":["status","detail"],"additionalProperties":false},{"type":"null"}]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","body","subject","fromAddress","toAddress","attachments","meta","delivery","userName","createdAt"],"additionalProperties":false}}},"required":["id","name","email","phone","company","subject","status","source","lostReason","clientId","clientName","assignedUserId","assignedName","nextActionOn","nextAction","overdue","lastActivityAt","lastActivity","unread","createdAt","stageId","stageName","stageKey","stageKind","probability","stageEnteredAt","daysInStage","valuePence","valueFrom","valueOneOffPence","valueYearlyPence","manualValuePence","weightedPence","expectedCloseOn","closedAt","goneQuiet","followUp","quoteId","quoteReference","quoteStatus","address","message","lostNote","contactId","inboundAddress","events"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"enquiries.update","summary":"Change an enquiry: details, stage (Lost needs a reason), who has it, its next action","tags":["Enquiries"],"x-permission":"enquiry.manage","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"anyOf":[{"anyOf":[{"type":"string","const":""},{"type":"string"}]},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"subject":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"message":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"source":{"type":"string","enum":["email","manual","phone","website"]},"status":{"type":"string","enum":["new","contacted","quoted","won","lost"]},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"valuePence":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000000000},{"type":"null"}]},"expectedCloseOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"lostReason":{"anyOf":[{"type":"string","enum":["price","timing","no_reply","not_a_fit","other"]},{"type":"null"}]},"lostNote":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"company":{"type":["string","null"]},"subject":{"type":["string","null"]},"status":{"type":"string","enum":["new","contacted","quoted","won","lost"]},"source":{"type":"string","enum":["email","manual","phone","website"]},"lostReason":{"anyOf":[{"type":"string","enum":["price","timing","no_reply","not_a_fit","other"]},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedName":{"type":["string","null"]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"type":["string","null"]},"overdue":{"type":"boolean"},"lastActivityAt":{"type":"string"},"lastActivity":{"type":["string","null"]},"unread":{"type":"boolean"},"createdAt":{"type":"string"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageName":{"type":"string"},"stageKey":{"anyOf":[{"type":"string","enum":["new","contacted","site_visit","quoted","won","lost"]},{"type":"null"}]},"stageKind":{"type":"string","enum":["open","won","lost"]},"probability":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stageEnteredAt":{"type":"string"},"daysInStage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valuePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"valueFrom":{"anyOf":[{"type":"string","enum":["quote","typed"]},{"type":"null"}]},"valueOneOffPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valueYearlyPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualValuePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"weightedPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"expectedCloseOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"closedAt":{"type":["string","null"]},"goneQuiet":{"type":"boolean"},"followUp":{"anyOf":[{"type":"string","enum":["not_viewed","expiring","declined"]},{"type":"null"}]},"quoteId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"quoteReference":{"type":["string","null"]},"quoteStatus":{"type":["string","null"]},"address":{"type":["string","null"]},"message":{"type":["string","null"]},"lostNote":{"type":["string","null"]},"contactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"inboundAddress":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","email_in","email_out","note","call","status","assigned","quote_sent","quote_viewed","quote_accepted","quote_declined","converted","stage","site_visit","value","email_moved","merged"]},"body":{"type":["string","null"]},"subject":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"toAddress":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","filename","contentType","bytes","url"],"additionalProperties":false}},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["queued","sent","not_sent","delivered","bounced","complained","failed"]},"detail":{"type":["string","null"]}},"required":["status","detail"],"additionalProperties":false},{"type":"null"}]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","body","subject","fromAddress","toAddress","attachments","meta","delivery","userName","createdAt"],"additionalProperties":false}}},"required":["id","name","email","phone","company","subject","status","source","lostReason","clientId","clientName","assignedUserId","assignedName","nextActionOn","nextAction","overdue","lastActivityAt","lastActivity","unread","createdAt","stageId","stageName","stageKey","stageKind","probability","stageEnteredAt","daysInStage","valuePence","valueFrom","valueOneOffPence","valueYearlyPence","manualValuePence","weightedPence","expectedCloseOn","closedAt","goneQuiet","followUp","quoteId","quoteReference","quoteStatus","address","message","lostNote","contactId","inboundAddress","events"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"enquiries.remove","summary":"Delete an enquiry (spam, a mistake) and its timeline","tags":["Enquiries"],"x-permission":"enquiry.manage","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/enquiries/{id}/notes":{"post":{"operationId":"enquiries.note","summary":"Add a note or a call to the timeline","tags":["Enquiries"],"x-permission":"enquiry.manage","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"default":"note","type":"string","enum":["note","call"]},"body":{"type":"string","minLength":1,"maxLength":10000}},"required":["body"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"company":{"type":["string","null"]},"subject":{"type":["string","null"]},"status":{"type":"string","enum":["new","contacted","quoted","won","lost"]},"source":{"type":"string","enum":["email","manual","phone","website"]},"lostReason":{"anyOf":[{"type":"string","enum":["price","timing","no_reply","not_a_fit","other"]},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedName":{"type":["string","null"]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"type":["string","null"]},"overdue":{"type":"boolean"},"lastActivityAt":{"type":"string"},"lastActivity":{"type":["string","null"]},"unread":{"type":"boolean"},"createdAt":{"type":"string"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageName":{"type":"string"},"stageKey":{"anyOf":[{"type":"string","enum":["new","contacted","site_visit","quoted","won","lost"]},{"type":"null"}]},"stageKind":{"type":"string","enum":["open","won","lost"]},"probability":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stageEnteredAt":{"type":"string"},"daysInStage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valuePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"valueFrom":{"anyOf":[{"type":"string","enum":["quote","typed"]},{"type":"null"}]},"valueOneOffPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valueYearlyPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualValuePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"weightedPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"expectedCloseOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"closedAt":{"type":["string","null"]},"goneQuiet":{"type":"boolean"},"followUp":{"anyOf":[{"type":"string","enum":["not_viewed","expiring","declined"]},{"type":"null"}]},"quoteId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"quoteReference":{"type":["string","null"]},"quoteStatus":{"type":["string","null"]},"address":{"type":["string","null"]},"message":{"type":["string","null"]},"lostNote":{"type":["string","null"]},"contactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"inboundAddress":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","email_in","email_out","note","call","status","assigned","quote_sent","quote_viewed","quote_accepted","quote_declined","converted","stage","site_visit","value","email_moved","merged"]},"body":{"type":["string","null"]},"subject":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"toAddress":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","filename","contentType","bytes","url"],"additionalProperties":false}},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["queued","sent","not_sent","delivered","bounced","complained","failed"]},"detail":{"type":["string","null"]}},"required":["status","detail"],"additionalProperties":false},{"type":"null"}]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","body","subject","fromAddress","toAddress","attachments","meta","delivery","userName","createdAt"],"additionalProperties":false}}},"required":["id","name","email","phone","company","subject","status","source","lostReason","clientId","clientName","assignedUserId","assignedName","nextActionOn","nextAction","overdue","lastActivityAt","lastActivity","unread","createdAt","stageId","stageName","stageKey","stageKind","probability","stageEnteredAt","daysInStage","valuePence","valueFrom","valueOneOffPence","valueYearlyPence","manualValuePence","weightedPence","expectedCloseOn","closedAt","goneQuiet","followUp","quoteId","quoteReference","quoteStatus","address","message","lostNote","contactId","inboundAddress","events"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/enquiries/{id}/reply":{"post":{"operationId":"enquiries.reply","summary":"Email the enquirer. Their answer comes back to this enquiry. Links may only be to Workscope.","tags":["Enquiries"],"x-permission":"enquiry.manage","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"subject":{"type":"string","minLength":1,"maxLength":300},"body":{"type":"string","minLength":1,"maxLength":20000}},"required":["subject","body"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"company":{"type":["string","null"]},"subject":{"type":["string","null"]},"status":{"type":"string","enum":["new","contacted","quoted","won","lost"]},"source":{"type":"string","enum":["email","manual","phone","website"]},"lostReason":{"anyOf":[{"type":"string","enum":["price","timing","no_reply","not_a_fit","other"]},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedName":{"type":["string","null"]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"type":["string","null"]},"overdue":{"type":"boolean"},"lastActivityAt":{"type":"string"},"lastActivity":{"type":["string","null"]},"unread":{"type":"boolean"},"createdAt":{"type":"string"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageName":{"type":"string"},"stageKey":{"anyOf":[{"type":"string","enum":["new","contacted","site_visit","quoted","won","lost"]},{"type":"null"}]},"stageKind":{"type":"string","enum":["open","won","lost"]},"probability":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stageEnteredAt":{"type":"string"},"daysInStage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valuePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"valueFrom":{"anyOf":[{"type":"string","enum":["quote","typed"]},{"type":"null"}]},"valueOneOffPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valueYearlyPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualValuePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"weightedPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"expectedCloseOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"closedAt":{"type":["string","null"]},"goneQuiet":{"type":"boolean"},"followUp":{"anyOf":[{"type":"string","enum":["not_viewed","expiring","declined"]},{"type":"null"}]},"quoteId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"quoteReference":{"type":["string","null"]},"quoteStatus":{"type":["string","null"]},"address":{"type":["string","null"]},"message":{"type":["string","null"]},"lostNote":{"type":["string","null"]},"contactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"inboundAddress":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","email_in","email_out","note","call","status","assigned","quote_sent","quote_viewed","quote_accepted","quote_declined","converted","stage","site_visit","value","email_moved","merged"]},"body":{"type":["string","null"]},"subject":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"toAddress":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","filename","contentType","bytes","url"],"additionalProperties":false}},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["queued","sent","not_sent","delivered","bounced","complained","failed"]},"detail":{"type":["string","null"]}},"required":["status","detail"],"additionalProperties":false},{"type":"null"}]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","body","subject","fromAddress","toAddress","attachments","meta","delivery","userName","createdAt"],"additionalProperties":false}}},"required":["id","name","email","phone","company","subject","status","source","lostReason","clientId","clientName","assignedUserId","assignedName","nextActionOn","nextAction","overdue","lastActivityAt","lastActivity","unread","createdAt","stageId","stageName","stageKey","stageKind","probability","stageEnteredAt","daysInStage","valuePence","valueFrom","valueOneOffPence","valueYearlyPence","manualValuePence","weightedPence","expectedCloseOn","closedAt","goneQuiet","followUp","quoteId","quoteReference","quoteStatus","address","message","lostNote","contactId","inboundAddress","events"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/enquiries/{id}/events/{eventId}/move":{"post":{"operationId":"enquiries.moveEvent","summary":"Move an email (and its files) to another deal. Both timelines say so.","tags":["Enquiries"],"x-permission":"enquiry.manage","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"toEnquiryId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["toEnquiryId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"company":{"type":["string","null"]},"subject":{"type":["string","null"]},"status":{"type":"string","enum":["new","contacted","quoted","won","lost"]},"source":{"type":"string","enum":["email","manual","phone","website"]},"lostReason":{"anyOf":[{"type":"string","enum":["price","timing","no_reply","not_a_fit","other"]},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedName":{"type":["string","null"]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"type":["string","null"]},"overdue":{"type":"boolean"},"lastActivityAt":{"type":"string"},"lastActivity":{"type":["string","null"]},"unread":{"type":"boolean"},"createdAt":{"type":"string"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageName":{"type":"string"},"stageKey":{"anyOf":[{"type":"string","enum":["new","contacted","site_visit","quoted","won","lost"]},{"type":"null"}]},"stageKind":{"type":"string","enum":["open","won","lost"]},"probability":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stageEnteredAt":{"type":"string"},"daysInStage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valuePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"valueFrom":{"anyOf":[{"type":"string","enum":["quote","typed"]},{"type":"null"}]},"valueOneOffPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valueYearlyPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualValuePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"weightedPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"expectedCloseOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"closedAt":{"type":["string","null"]},"goneQuiet":{"type":"boolean"},"followUp":{"anyOf":[{"type":"string","enum":["not_viewed","expiring","declined"]},{"type":"null"}]},"quoteId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"quoteReference":{"type":["string","null"]},"quoteStatus":{"type":["string","null"]},"address":{"type":["string","null"]},"message":{"type":["string","null"]},"lostNote":{"type":["string","null"]},"contactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"inboundAddress":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","email_in","email_out","note","call","status","assigned","quote_sent","quote_viewed","quote_accepted","quote_declined","converted","stage","site_visit","value","email_moved","merged"]},"body":{"type":["string","null"]},"subject":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"toAddress":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","filename","contentType","bytes","url"],"additionalProperties":false}},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["queued","sent","not_sent","delivered","bounced","complained","failed"]},"detail":{"type":["string","null"]}},"required":["status","detail"],"additionalProperties":false},{"type":"null"}]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","body","subject","fromAddress","toAddress","attachments","meta","delivery","userName","createdAt"],"additionalProperties":false}}},"required":["id","name","email","phone","company","subject","status","source","lostReason","clientId","clientName","assignedUserId","assignedName","nextActionOn","nextAction","overdue","lastActivityAt","lastActivity","unread","createdAt","stageId","stageName","stageKey","stageKind","probability","stageEnteredAt","daysInStage","valuePence","valueFrom","valueOneOffPence","valueYearlyPence","manualValuePence","weightedPence","expectedCloseOn","closedAt","goneQuiet","followUp","quoteId","quoteReference","quoteStatus","address","message","lostNote","contactId","inboundAddress","events"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/enquiries/{id}/merge":{"get":{"operationId":"enquiries.mergeCheck","summary":"What merging this deal into another would move, and whether its client could be archived","tags":["Enquiries"],"x-permission":"enquiry.manage","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"intoId","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"intoId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"intoTitle":{"type":"string"},"clientChanges":{"type":"boolean"},"fromClientName":{"type":"string"},"intoClientName":{"type":"string"},"canArchiveClient":{"type":"boolean"},"moves":{"type":"object","properties":{"events":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"quotes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bookings":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["events","quotes","bookings"],"additionalProperties":false}},"required":["intoId","intoTitle","clientChanges","fromClientName","intoClientName","canArchiveClient","moves"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"enquiries.merge","summary":"Merge this deal into another: its timeline, quotes and site visits move, replies to its emails still arrive, and it goes. The other deal's client and stage stay.","tags":["Enquiries"],"x-permission":"enquiry.manage","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"intoId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"archiveClient":{"default":false,"type":"boolean"}},"required":["intoId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"company":{"type":["string","null"]},"subject":{"type":["string","null"]},"status":{"type":"string","enum":["new","contacted","quoted","won","lost"]},"source":{"type":"string","enum":["email","manual","phone","website"]},"lostReason":{"anyOf":[{"type":"string","enum":["price","timing","no_reply","not_a_fit","other"]},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"clientName":{"type":"string"},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedName":{"type":["string","null"]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"type":["string","null"]},"overdue":{"type":"boolean"},"lastActivityAt":{"type":"string"},"lastActivity":{"type":["string","null"]},"unread":{"type":"boolean"},"createdAt":{"type":"string"},"stageId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"stageName":{"type":"string"},"stageKey":{"anyOf":[{"type":"string","enum":["new","contacted","site_visit","quoted","won","lost"]},{"type":"null"}]},"stageKind":{"type":"string","enum":["open","won","lost"]},"probability":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stageEnteredAt":{"type":"string"},"daysInStage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valuePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"valueFrom":{"anyOf":[{"type":"string","enum":["quote","typed"]},{"type":"null"}]},"valueOneOffPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"valueYearlyPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"manualValuePence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"weightedPence":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"expectedCloseOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"closedAt":{"type":["string","null"]},"goneQuiet":{"type":"boolean"},"followUp":{"anyOf":[{"type":"string","enum":["not_viewed","expiring","declined"]},{"type":"null"}]},"quoteId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"quoteReference":{"type":["string","null"]},"quoteStatus":{"type":["string","null"]},"address":{"type":["string","null"]},"message":{"type":["string","null"]},"lostNote":{"type":["string","null"]},"contactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"inboundAddress":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","email_in","email_out","note","call","status","assigned","quote_sent","quote_viewed","quote_accepted","quote_declined","converted","stage","site_visit","value","email_moved","merged"]},"body":{"type":["string","null"]},"subject":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"toAddress":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","filename","contentType","bytes","url"],"additionalProperties":false}},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["queued","sent","not_sent","delivered","bounced","complained","failed"]},"detail":{"type":["string","null"]}},"required":["status","detail"],"additionalProperties":false},{"type":"null"}]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","body","subject","fromAddress","toAddress","attachments","meta","delivery","userName","createdAt"],"additionalProperties":false}}},"required":["id","name","email","phone","company","subject","status","source","lostReason","clientId","clientName","assignedUserId","assignedName","nextActionOn","nextAction","overdue","lastActivityAt","lastActivity","unread","createdAt","stageId","stageName","stageKey","stageKind","probability","stageEnteredAt","daysInStage","valuePence","valueFrom","valueOneOffPence","valueYearlyPence","manualValuePence","weightedPence","expectedCloseOn","closedAt","goneQuiet","followUp","quoteId","quoteReference","quoteStatus","address","message","lostNote","contactId","inboundAddress","events"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/enquiries/page":{"get":{"operationId":"enquiries.page","summary":"The enquiry page settings, and what the website forms need","tags":["Enquiries"],"x-permission":"enquiry.manage","x-module":"quotes","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"},"slug":{"type":"string"},"url":{"type":"string"},"colour":{"type":"string"},"headline":{"type":["string","null"]},"intro":{"type":["string","null"]},"thanks":{"type":["string","null"]},"services":{"type":"array","items":{"type":"string"}},"required":{"type":"array","items":{"type":"string","enum":["phone","company","address","service","message"]}},"logoUrl":{"type":["string","null"]},"coverUrl":{"type":["string","null"]},"companyName":{"type":"string"},"suggestedServices":{"type":"array","items":{"type":"string"}},"origin":{"type":"string"},"careers":{"anyOf":[{"type":"object","properties":{"enabled":{"type":"boolean"},"roles":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"string"}},"required":["slug","title"],"additionalProperties":false}}},"required":["enabled","roles"],"additionalProperties":false},{"type":"null"}]}},"required":["enabled","slug","url","colour","headline","intro","thanks","services","required","logoUrl","coverUrl","companyName","suggestedServices","origin","careers"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"enquiries.updatePage","summary":"Change the enquiry page: switch it on, its address (shared with the careers page), colour, words, services and which questions must be answered","tags":["Enquiries"],"x-permission":"enquiry.manage","x-module":"quotes","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"},"slug":{"type":"string","minLength":2,"maxLength":60,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"colour":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"headline":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"intro":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"thanks":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"services":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"required":{"type":"array","items":{"type":"string","enum":["phone","company","address","service","message"]}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"},"slug":{"type":"string"},"url":{"type":"string"},"colour":{"type":"string"},"headline":{"type":["string","null"]},"intro":{"type":["string","null"]},"thanks":{"type":["string","null"]},"services":{"type":"array","items":{"type":"string"}},"required":{"type":"array","items":{"type":"string","enum":["phone","company","address","service","message"]}},"logoUrl":{"type":["string","null"]},"coverUrl":{"type":["string","null"]},"companyName":{"type":"string"},"suggestedServices":{"type":"array","items":{"type":"string"}},"origin":{"type":"string"},"careers":{"anyOf":[{"type":"object","properties":{"enabled":{"type":"boolean"},"roles":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"string"}},"required":["slug","title"],"additionalProperties":false}}},"required":["enabled","roles"],"additionalProperties":false},{"type":"null"}]}},"required":["enabled","slug","url","colour","headline","intro","thanks","services","required","logoUrl","coverUrl","companyName","suggestedServices","origin","careers"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/enquiries/page/preview":{"get":{"operationId":"enquiries.pagePreview","summary":"The enquiry page as it will look, before it is switched on","tags":["Enquiries"],"x-permission":"enquiry.manage","x-module":"quotes","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"slug":{"type":"string"},"companyName":{"type":"string"},"website":{"type":["string","null"]},"phone":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"coverUrl":{"type":["string","null"]},"colour":{"type":"string"},"headline":{"type":["string","null"]},"intro":{"type":["string","null"]},"services":{"type":"array","items":{"type":"string"}},"required":{"type":"array","items":{"type":"string","enum":["phone","company","address","service","message"]}},"thanks":{"type":"string"},"privacy":{"type":"string"},"preview":{"type":"boolean"}},"required":["slug","companyName","website","phone","logoUrl","coverUrl","colour","headline","intro","services","required","thanks","privacy","preview"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/enquiries/page/cover":{"post":{"operationId":"enquiries.pageCover","summary":"Set the cover picture (shared with the careers page): send the image itself (JPEG, PNG or WebP)","tags":["Enquiries"],"x-permission":"enquiry.manage","x-module":"quotes","parameters":[],"requestBody":{"required":true,"content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}},"image/heic":{"schema":{"type":"string","format":"binary"}},"image/heif":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"},"slug":{"type":"string"},"url":{"type":"string"},"colour":{"type":"string"},"headline":{"type":["string","null"]},"intro":{"type":["string","null"]},"thanks":{"type":["string","null"]},"services":{"type":"array","items":{"type":"string"}},"required":{"type":"array","items":{"type":"string","enum":["phone","company","address","service","message"]}},"logoUrl":{"type":["string","null"]},"coverUrl":{"type":["string","null"]},"companyName":{"type":"string"},"suggestedServices":{"type":"array","items":{"type":"string"}},"origin":{"type":"string"},"careers":{"anyOf":[{"type":"object","properties":{"enabled":{"type":"boolean"},"roles":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"string"}},"required":["slug","title"],"additionalProperties":false}}},"required":["enabled","roles"],"additionalProperties":false},{"type":"null"}]}},"required":["enabled","slug","url","colour","headline","intro","thanks","services","required","logoUrl","coverUrl","companyName","suggestedServices","origin","careers"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"enquiries.removePageCover","summary":"Take the cover picture off","tags":["Enquiries"],"x-permission":"enquiry.manage","x-module":"quotes","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"},"slug":{"type":"string"},"url":{"type":"string"},"colour":{"type":"string"},"headline":{"type":["string","null"]},"intro":{"type":["string","null"]},"thanks":{"type":["string","null"]},"services":{"type":"array","items":{"type":"string"}},"required":{"type":"array","items":{"type":"string","enum":["phone","company","address","service","message"]}},"logoUrl":{"type":["string","null"]},"coverUrl":{"type":["string","null"]},"companyName":{"type":"string"},"suggestedServices":{"type":"array","items":{"type":"string"}},"origin":{"type":"string"},"careers":{"anyOf":[{"type":"object","properties":{"enabled":{"type":"boolean"},"roles":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"string"}},"required":["slug","title"],"additionalProperties":false}}},"required":["enabled","roles"],"additionalProperties":false},{"type":"null"}]}},"required":["enabled","slug","url","colour","headline","intro","thanks","services","required","logoUrl","coverUrl","companyName","suggestedServices","origin","careers"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/enquiries/page/images/{id}":{"get":{"operationId":"enquiries.pageImage","summary":"The logo or cover on the enquiry page, for the preview","tags":["Enquiries"],"x-permission":"enquiry.manage","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","enum":["logo","cover"]}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/enquiries/{id}/events/{eventId}/attachments/{index}":{"get":{"operationId":"enquiries.attachment","summary":"A file that came with an email","tags":["Enquiries"],"x-permission":"enquiry.view","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"index","in":"path","required":true,"schema":{"type":"integer","minimum":0,"maximum":50}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/sales/stages":{"get":{"operationId":"sales.stages","summary":"The company's sales stages in order (the board's columns), with how many deals each holds, and after how many quiet days a deal is flagged","tags":["Sales"],"x-permission":"enquiry.view","x-module":"quotes","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"probability":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"kind":{"type":"string","enum":["open","won","lost"]},"key":{"anyOf":[{"type":"string","enum":["new","contacted","site_visit","quoted","won","lost"]},{"type":"null"}]},"deals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","position","probability","kind","key","deals"],"additionalProperties":false}},"goneQuietDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["stages","goneQuietDays"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"put":{"operationId":"sales.saveStages","summary":"Save the stages: rename, reorder, set how likely each is to win, add and remove open ones (their deals move to the stage given). Won and Lost stay at the end.","tags":["Sales"],"x-permission":"enquiry.manage","x-module":"quotes","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"stages":{"minItems":3,"maxItems":20,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string","minLength":1,"maxLength":60},"probability":{"type":"integer","minimum":0,"maximum":100},"kind":{"type":"string","enum":["open","won","lost"]}},"required":["name","probability","kind"]}},"moveTo":{"default":{},"type":"object","propertyNames":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"additionalProperties":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"goneQuietDays":{"type":"integer","minimum":1,"maximum":365}},"required":["stages"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"stages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"probability":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"kind":{"type":"string","enum":["open","won","lost"]},"key":{"anyOf":[{"type":"string","enum":["new","contacted","site_visit","quoted","won","lost"]},{"type":"null"}]},"deals":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","position","probability","kind","key","deals"],"additionalProperties":false}},"goneQuietDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["stages","goneQuietDays"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/reports/sales":{"get":{"operationId":"sales.report","summary":"Deals won and lost, win rate, value won (one-off and a year of recurring), days to win, by source and owner, and why deals were lost","tags":["Reports"],"x-permission":"report.view","x-module":"quotes","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"won":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lost":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"winRate":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"wonOneOffPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"wonYearlyPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"averageDaysToWin":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"openNow":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"openValuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"openWeightedPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"bySource":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"won":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lost":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"open":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"wonValuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","label","won","lost","open","wonValuePence"],"additionalProperties":false}},"byOwner":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"won":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lost":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"open":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"wonValuePence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","label","won","lost","open","wonValuePence"],"additionalProperties":false}},"lostReasons":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string","enum":["price","timing","no_reply","not_a_fit","other"]},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["reason","count"],"additionalProperties":false}}},"required":["from","to","created","won","lost","winRate","wonOneOffPence","wonYearlyPence","averageDaysToWin","openNow","openValuePence","openWeightedPence","bySource","byOwner","lostReasons"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/reports/sales/export":{"get":{"operationId":"sales.reportExport","summary":"The deals closed in the range as CSV","tags":["Reports"],"x-permission":"report.view","x-module":"quotes","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/sales/counts":{"get":{"operationId":"sales.counts","summary":"How many deals have something nobody has opened yet (a new enquiry, an email, a quote's answer): the Sales menu's number","tags":["Sales"],"x-permission":"enquiry.view","x-module":"quotes","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"unread":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["unread"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/quote-items":{"get":{"operationId":"quoteItems.list","summary":"Saved quote items in their order (archived ones with archived=true)","tags":["Quotes"],"x-permission":"quote.view","x-module":"quotes","parameters":[{"name":"archived","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"optional":{"type":"boolean"},"archived":{"type":"boolean"},"used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","description","quantityX100","unitPence","period","optional","archived","used"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"quoteItems.create","summary":"Save an item (added at the end of the list)","tags":["Quotes"],"x-permission":"quote.manage","x-module":"quotes","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","minLength":1,"maxLength":2000},"quantityX100":{"default":100,"type":"integer","minimum":1,"maximum":10000000},"unitPence":{"type":"integer","minimum":-100000000,"maximum":100000000},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"optional":{"default":false,"type":"boolean"}},"required":["name","description","unitPence"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"optional":{"type":"boolean"},"archived":{"type":"boolean"},"used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","description","quantityX100","unitPence","period","optional","archived","used"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/quote-items/{id}":{"patch":{"operationId":"quoteItems.update","summary":"Change or archive a saved item (quotes already made keep their copy)","tags":["Quotes"],"x-permission":"quote.manage","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","minLength":1,"maxLength":2000},"quantityX100":{"type":"integer","minimum":1,"maximum":10000000},"unitPence":{"type":"integer","minimum":-100000000,"maximum":100000000},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"optional":{"type":"boolean"},"archived":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"optional":{"type":"boolean"},"archived":{"type":"boolean"},"used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","description","quantityX100","unitPence","period","optional","archived","used"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"quoteItems.remove","summary":"Delete a saved item no quote has used (archive it otherwise)","tags":["Quotes"],"x-permission":"quote.manage","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/quote-items/order":{"put":{"operationId":"quoteItems.reorder","summary":"Put the saved items in this order","tags":["Quotes"],"x-permission":"quote.manage","x-module":"quotes","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["ids"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"optional":{"type":"boolean"},"archived":{"type":"boolean"},"used":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","description","quantityX100","unitPence","period","optional","archived","used"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/quotes/settings":{"get":{"operationId":"quotes.settings","summary":"Quote numbering, how long a quote stands, and the terms new quotes start with","tags":["Quotes"],"x-permission":"quote.view","x-module":"quotes","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"quotePrefix":{"type":"string"},"nextQuoteNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"quoteValidityDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"quoteTerms":{"type":"string"}},"required":["quotePrefix","nextQuoteNumber","quoteValidityDays","quoteTerms"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"quotes.updateSettings","summary":"Change the quote settings","tags":["Quotes"],"x-permission":"quote.manage","x-module":"quotes","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"quotePrefix":{"type":"string","maxLength":10},"nextQuoteNumber":{"type":"integer","minimum":1,"maximum":9999999},"quoteValidityDays":{"type":"integer","minimum":1,"maximum":365},"quoteTerms":{"type":"string","maxLength":20000}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"quotePrefix":{"type":"string"},"nextQuoteNumber":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"quoteValidityDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"quoteTerms":{"type":"string"}},"required":["quotePrefix","nextQuoteNumber","quoteValidityDays","quoteTerms"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/quotes":{"get":{"operationId":"quotes.list","summary":"Quotes, newest first, with counts by status (expired ones shown as expired)","tags":["Quotes"],"x-permission":"quote.view","x-module":"quotes","parameters":[{"name":"status","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["draft","sent","viewed","accepted","declined","expired","withdrawn","all","waiting"]}},{"name":"enquiryId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"quotes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"title":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","expired","withdrawn"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enquiryId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"forName":{"type":"string"},"recipientEmail":{"type":["string","null"]},"validUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"sentAt":{"type":["string","null"]},"answeredAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","number","reference","title","status","version","enquiryId","clientId","forName","recipientEmail","validUntil","oneOffNet","recurring","sentAt","answeredAt","createdAt"],"additionalProperties":false}},"counts":{"type":"object","propertyNames":{"type":"string","enum":["draft","sent","viewed","accepted","declined","expired","withdrawn","all","waiting"]},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"required":["draft","sent","viewed","accepted","declined","expired","withdrawn","all","waiting"]}},"required":["quotes","counts"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"quotes.create","summary":"Start a quote for an enquiry or a client (a draft, no number yet); can copy another quote","tags":["Quotes"],"x-permission":"quote.manage","x-module":"quotes","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enquiryId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"contactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"title":{"type":"string","minLength":1,"maxLength":200},"copyFromQuoteId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["title"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"title":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","expired","withdrawn"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enquiryId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"forName":{"type":"string"},"recipientEmail":{"type":["string","null"]},"validUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"sentAt":{"type":["string","null"]},"answeredAt":{"type":["string","null"]},"createdAt":{"type":"string"},"scope":{"type":["string","null"]},"terms":{"type":["string","null"]},"notes":{"type":["string","null"]},"recipientName":{"type":["string","null"]},"recipientCompany":{"type":["string","null"]},"recipientAddress":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"itemId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"optional":{"type":"boolean"},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","description","quantityX100","unitPence","period","optional","netPence"],"additionalProperties":false}},"totals":{"type":"object","properties":{"oneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"optionalOneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"optionalRecurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}}},"required":["oneOff","recurring","optionalOneOff","optionalRecurring"],"additionalProperties":false},"images":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","thumbUrl","fullUrl"],"additionalProperties":false}},"vatRegistered":{"type":"boolean"},"publicUrl":{"type":["string","null"]},"unsentChanges":{"type":"boolean"},"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sentAt":{"type":"string"},"sentByName":{"type":["string","null"]},"fingerprint":{"type":"string"},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["version","sentAt","sentByName","fingerprint","oneOffNet"],"additionalProperties":false}},"acceptance":{"anyOf":[{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"email":{"type":["string","null"]},"at":{"type":"string"},"ip":{"type":["string","null"]},"userAgent":{"type":["string","null"]},"fingerprint":{"type":"string"},"optionalLineIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"signatureUrl":{"type":"string"}},"required":["version","name","email","at","ip","userAgent","fingerprint","optionalLineIds","signatureUrl"],"additionalProperties":false},{"type":"null"}]},"declineReason":{"type":["string","null"]},"changes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","edited","sent","viewed","accepted","declined","withdrawn","reopened","converted"]},"summary":{"type":["string","null"]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","summary","userName","createdAt"],"additionalProperties":false}},"enquiryName":{"type":["string","null"]},"clientName":{"type":"string"},"contactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientAddress":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"work":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"lineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"notNeeded":{"type":"boolean"},"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"bookings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["id","name","date"],"additionalProperties":false}}},"required":["lineId","description","quantityX100","unitPence","period","notNeeded","jobs","bookings"],"additionalProperties":false}},{"type":"null"}]}},"required":["id","number","reference","title","status","version","enquiryId","clientId","forName","recipientEmail","validUntil","oneOffNet","recurring","sentAt","answeredAt","createdAt","scope","terms","notes","recipientName","recipientCompany","recipientAddress","lines","totals","images","vatRegistered","publicUrl","unsentChanges","versions","acceptance","declineReason","changes","enquiryName","clientName","contactId","clientAddress","projectId","projectName","work"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/quotes/{id}":{"get":{"operationId":"quotes.get","summary":"One quote: the working copy, its totals, versions sent, the acceptance and history","tags":["Quotes"],"x-permission":"quote.view","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"title":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","expired","withdrawn"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enquiryId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"forName":{"type":"string"},"recipientEmail":{"type":["string","null"]},"validUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"sentAt":{"type":["string","null"]},"answeredAt":{"type":["string","null"]},"createdAt":{"type":"string"},"scope":{"type":["string","null"]},"terms":{"type":["string","null"]},"notes":{"type":["string","null"]},"recipientName":{"type":["string","null"]},"recipientCompany":{"type":["string","null"]},"recipientAddress":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"itemId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"optional":{"type":"boolean"},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","description","quantityX100","unitPence","period","optional","netPence"],"additionalProperties":false}},"totals":{"type":"object","properties":{"oneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"optionalOneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"optionalRecurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}}},"required":["oneOff","recurring","optionalOneOff","optionalRecurring"],"additionalProperties":false},"images":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","thumbUrl","fullUrl"],"additionalProperties":false}},"vatRegistered":{"type":"boolean"},"publicUrl":{"type":["string","null"]},"unsentChanges":{"type":"boolean"},"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sentAt":{"type":"string"},"sentByName":{"type":["string","null"]},"fingerprint":{"type":"string"},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["version","sentAt","sentByName","fingerprint","oneOffNet"],"additionalProperties":false}},"acceptance":{"anyOf":[{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"email":{"type":["string","null"]},"at":{"type":"string"},"ip":{"type":["string","null"]},"userAgent":{"type":["string","null"]},"fingerprint":{"type":"string"},"optionalLineIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"signatureUrl":{"type":"string"}},"required":["version","name","email","at","ip","userAgent","fingerprint","optionalLineIds","signatureUrl"],"additionalProperties":false},{"type":"null"}]},"declineReason":{"type":["string","null"]},"changes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","edited","sent","viewed","accepted","declined","withdrawn","reopened","converted"]},"summary":{"type":["string","null"]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","summary","userName","createdAt"],"additionalProperties":false}},"enquiryName":{"type":["string","null"]},"clientName":{"type":"string"},"contactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientAddress":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"work":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"lineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"notNeeded":{"type":"boolean"},"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"bookings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["id","name","date"],"additionalProperties":false}}},"required":["lineId","description","quantityX100","unitPence","period","notNeeded","jobs","bookings"],"additionalProperties":false}},{"type":"null"}]}},"required":["id","number","reference","title","status","version","enquiryId","clientId","forName","recipientEmail","validUntil","oneOffNet","recurring","sentAt","answeredAt","createdAt","scope","terms","notes","recipientName","recipientCompany","recipientAddress","lines","totals","images","vatRegistered","publicUrl","unsentChanges","versions","acceptance","declineReason","changes","enquiryName","clientName","contactId","clientAddress","projectId","projectName","work"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"quotes.update","summary":"Change the working copy (lines are replaced as a whole). A sent quote changes only when sent again, as a new version.","tags":["Quotes"],"x-permission":"quote.manage","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"scope":{"anyOf":[{"type":"string","maxLength":50000},{"type":"null"}]},"terms":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}]},"validUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"contactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"recipientName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"recipientEmail":{"anyOf":[{"anyOf":[{"type":"string","const":""},{"type":"string"}]},{"type":"null"}]},"recipientCompany":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"recipientAddress":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"lines":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string","minLength":1,"maxLength":2000},"quantityX100":{"default":100,"type":"integer","minimum":1,"maximum":10000000},"unitPence":{"type":"integer","minimum":-100000000,"maximum":100000000},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"optional":{"default":false,"type":"boolean"},"itemId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["description","unitPence"]}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"title":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","expired","withdrawn"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enquiryId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"forName":{"type":"string"},"recipientEmail":{"type":["string","null"]},"validUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"sentAt":{"type":["string","null"]},"answeredAt":{"type":["string","null"]},"createdAt":{"type":"string"},"scope":{"type":["string","null"]},"terms":{"type":["string","null"]},"notes":{"type":["string","null"]},"recipientName":{"type":["string","null"]},"recipientCompany":{"type":["string","null"]},"recipientAddress":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"itemId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"optional":{"type":"boolean"},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","description","quantityX100","unitPence","period","optional","netPence"],"additionalProperties":false}},"totals":{"type":"object","properties":{"oneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"optionalOneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"optionalRecurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}}},"required":["oneOff","recurring","optionalOneOff","optionalRecurring"],"additionalProperties":false},"images":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","thumbUrl","fullUrl"],"additionalProperties":false}},"vatRegistered":{"type":"boolean"},"publicUrl":{"type":["string","null"]},"unsentChanges":{"type":"boolean"},"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sentAt":{"type":"string"},"sentByName":{"type":["string","null"]},"fingerprint":{"type":"string"},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["version","sentAt","sentByName","fingerprint","oneOffNet"],"additionalProperties":false}},"acceptance":{"anyOf":[{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"email":{"type":["string","null"]},"at":{"type":"string"},"ip":{"type":["string","null"]},"userAgent":{"type":["string","null"]},"fingerprint":{"type":"string"},"optionalLineIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"signatureUrl":{"type":"string"}},"required":["version","name","email","at","ip","userAgent","fingerprint","optionalLineIds","signatureUrl"],"additionalProperties":false},{"type":"null"}]},"declineReason":{"type":["string","null"]},"changes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","edited","sent","viewed","accepted","declined","withdrawn","reopened","converted"]},"summary":{"type":["string","null"]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","summary","userName","createdAt"],"additionalProperties":false}},"enquiryName":{"type":["string","null"]},"clientName":{"type":"string"},"contactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientAddress":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"work":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"lineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"notNeeded":{"type":"boolean"},"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"bookings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["id","name","date"],"additionalProperties":false}}},"required":["lineId","description","quantityX100","unitPence","period","notNeeded","jobs","bookings"],"additionalProperties":false}},{"type":"null"}]}},"required":["id","number","reference","title","status","version","enquiryId","clientId","forName","recipientEmail","validUntil","oneOffNet","recurring","sentAt","answeredAt","createdAt","scope","terms","notes","recipientName","recipientCompany","recipientAddress","lines","totals","images","vatRegistered","publicUrl","unsentChanges","versions","acceptance","declineReason","changes","enquiryName","clientName","contactId","clientAddress","projectId","projectName","work"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"quotes.remove","summary":"Delete a draft that was never sent","tags":["Quotes"],"x-permission":"quote.manage","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/quotes/{id}/send":{"post":{"operationId":"quotes.send","summary":"Send the working copy as the next version (numbered on first send), by email or just to share the link","tags":["Quotes"],"x-permission":"quote.manage","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"default":true,"type":"boolean"},"to":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"subject":{"type":"string","maxLength":300},"message":{"type":"string","maxLength":10000}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"title":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","expired","withdrawn"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enquiryId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"forName":{"type":"string"},"recipientEmail":{"type":["string","null"]},"validUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"sentAt":{"type":["string","null"]},"answeredAt":{"type":["string","null"]},"createdAt":{"type":"string"},"scope":{"type":["string","null"]},"terms":{"type":["string","null"]},"notes":{"type":["string","null"]},"recipientName":{"type":["string","null"]},"recipientCompany":{"type":["string","null"]},"recipientAddress":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"itemId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"optional":{"type":"boolean"},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","description","quantityX100","unitPence","period","optional","netPence"],"additionalProperties":false}},"totals":{"type":"object","properties":{"oneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"optionalOneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"optionalRecurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}}},"required":["oneOff","recurring","optionalOneOff","optionalRecurring"],"additionalProperties":false},"images":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","thumbUrl","fullUrl"],"additionalProperties":false}},"vatRegistered":{"type":"boolean"},"publicUrl":{"type":["string","null"]},"unsentChanges":{"type":"boolean"},"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sentAt":{"type":"string"},"sentByName":{"type":["string","null"]},"fingerprint":{"type":"string"},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["version","sentAt","sentByName","fingerprint","oneOffNet"],"additionalProperties":false}},"acceptance":{"anyOf":[{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"email":{"type":["string","null"]},"at":{"type":"string"},"ip":{"type":["string","null"]},"userAgent":{"type":["string","null"]},"fingerprint":{"type":"string"},"optionalLineIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"signatureUrl":{"type":"string"}},"required":["version","name","email","at","ip","userAgent","fingerprint","optionalLineIds","signatureUrl"],"additionalProperties":false},{"type":"null"}]},"declineReason":{"type":["string","null"]},"changes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","edited","sent","viewed","accepted","declined","withdrawn","reopened","converted"]},"summary":{"type":["string","null"]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","summary","userName","createdAt"],"additionalProperties":false}},"enquiryName":{"type":["string","null"]},"clientName":{"type":"string"},"contactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientAddress":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"work":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"lineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"notNeeded":{"type":"boolean"},"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"bookings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["id","name","date"],"additionalProperties":false}}},"required":["lineId","description","quantityX100","unitPence","period","notNeeded","jobs","bookings"],"additionalProperties":false}},{"type":"null"}]}},"required":["id","number","reference","title","status","version","enquiryId","clientId","forName","recipientEmail","validUntil","oneOffNet","recurring","sentAt","answeredAt","createdAt","scope","terms","notes","recipientName","recipientCompany","recipientAddress","lines","totals","images","vatRegistered","publicUrl","unsentChanges","versions","acceptance","declineReason","changes","enquiryName","clientName","contactId","clientAddress","projectId","projectName","work"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/quotes/{id}/withdraw":{"post":{"operationId":"quotes.withdraw","summary":"Withdraw a quote that is out (its link then says so)","tags":["Quotes"],"x-permission":"quote.manage","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"title":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","expired","withdrawn"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enquiryId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"forName":{"type":"string"},"recipientEmail":{"type":["string","null"]},"validUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"sentAt":{"type":["string","null"]},"answeredAt":{"type":["string","null"]},"createdAt":{"type":"string"},"scope":{"type":["string","null"]},"terms":{"type":["string","null"]},"notes":{"type":["string","null"]},"recipientName":{"type":["string","null"]},"recipientCompany":{"type":["string","null"]},"recipientAddress":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"itemId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"optional":{"type":"boolean"},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","description","quantityX100","unitPence","period","optional","netPence"],"additionalProperties":false}},"totals":{"type":"object","properties":{"oneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"optionalOneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"optionalRecurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}}},"required":["oneOff","recurring","optionalOneOff","optionalRecurring"],"additionalProperties":false},"images":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","thumbUrl","fullUrl"],"additionalProperties":false}},"vatRegistered":{"type":"boolean"},"publicUrl":{"type":["string","null"]},"unsentChanges":{"type":"boolean"},"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sentAt":{"type":"string"},"sentByName":{"type":["string","null"]},"fingerprint":{"type":"string"},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["version","sentAt","sentByName","fingerprint","oneOffNet"],"additionalProperties":false}},"acceptance":{"anyOf":[{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"email":{"type":["string","null"]},"at":{"type":"string"},"ip":{"type":["string","null"]},"userAgent":{"type":["string","null"]},"fingerprint":{"type":"string"},"optionalLineIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"signatureUrl":{"type":"string"}},"required":["version","name","email","at","ip","userAgent","fingerprint","optionalLineIds","signatureUrl"],"additionalProperties":false},{"type":"null"}]},"declineReason":{"type":["string","null"]},"changes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","edited","sent","viewed","accepted","declined","withdrawn","reopened","converted"]},"summary":{"type":["string","null"]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","summary","userName","createdAt"],"additionalProperties":false}},"enquiryName":{"type":["string","null"]},"clientName":{"type":"string"},"contactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientAddress":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"work":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"lineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"notNeeded":{"type":"boolean"},"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"bookings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["id","name","date"],"additionalProperties":false}}},"required":["lineId","description","quantityX100","unitPence","period","notNeeded","jobs","bookings"],"additionalProperties":false}},{"type":"null"}]}},"required":["id","number","reference","title","status","version","enquiryId","clientId","forName","recipientEmail","validUntil","oneOffNet","recurring","sentAt","answeredAt","createdAt","scope","terms","notes","recipientName","recipientCompany","recipientAddress","lines","totals","images","vatRegistered","publicUrl","unsentChanges","versions","acceptance","declineReason","changes","enquiryName","clientName","contactId","clientAddress","projectId","projectName","work"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/quotes/{id}/versions/{version}":{"get":{"operationId":"quotes.version","summary":"A version exactly as it was sent (as the client sees it)","tags":["Quotes"],"x-permission":"quote.view","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"version","in":"path","required":true,"schema":{"type":"integer","minimum":1,"maximum":9007199254740991}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reference":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","expired","withdrawn"]},"title":{"type":"string"},"issuedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"validUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"from":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"logoUrl":{"type":["string","null"]}},"required":["name","address","phone","email","website","companyNumber","vatNumber","logoUrl"],"additionalProperties":false},"to":{"type":"object","properties":{"name":{"type":["string","null"]},"company":{"type":["string","null"]},"address":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["name","company","address","email"],"additionalProperties":false},"scope":{"type":["string","null"]},"images":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","thumbUrl","fullUrl"],"additionalProperties":false}},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"itemId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"optional":{"type":"boolean"},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","description","quantityX100","unitPence","period","optional","netPence"],"additionalProperties":false}},"totals":{"type":"object","properties":{"oneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"optionalOneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"optionalRecurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}}},"required":["oneOff","recurring","optionalOneOff","optionalRecurring"],"additionalProperties":false},"vatRegistered":{"type":"boolean"},"terms":{"type":["string","null"]},"fingerprint":{"type":"string"},"accepted":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"at":{"type":"string"},"optionalLineIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"signatureUrl":{"type":["string","null"]}},"required":["name","at","optionalLineIds"],"additionalProperties":false},{"type":"null"}]},"pdfUrl":{"type":["string","null"]},"declinedAt":{"type":["string","null"]}},"required":["reference","version","status","title","issuedOn","validUntil","from","to","scope","images","lines","totals","vatRegistered","terms","fingerprint","accepted","declinedAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/quotes/{id}/preview":{"get":{"operationId":"quotes.preview","summary":"The working copy as the client would see it if it were sent now","tags":["Quotes"],"x-permission":"quote.view","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reference":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","expired","withdrawn"]},"title":{"type":"string"},"issuedOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"validUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"from":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":["string","null"]},"phone":{"type":["string","null"]},"email":{"type":["string","null"]},"website":{"type":["string","null"]},"companyNumber":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"logoUrl":{"type":["string","null"]}},"required":["name","address","phone","email","website","companyNumber","vatNumber","logoUrl"],"additionalProperties":false},"to":{"type":"object","properties":{"name":{"type":["string","null"]},"company":{"type":["string","null"]},"address":{"type":["string","null"]},"email":{"type":["string","null"]}},"required":["name","company","address","email"],"additionalProperties":false},"scope":{"type":["string","null"]},"images":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","thumbUrl","fullUrl"],"additionalProperties":false}},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"itemId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"optional":{"type":"boolean"},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","description","quantityX100","unitPence","period","optional","netPence"],"additionalProperties":false}},"totals":{"type":"object","properties":{"oneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"optionalOneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"optionalRecurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}}},"required":["oneOff","recurring","optionalOneOff","optionalRecurring"],"additionalProperties":false},"vatRegistered":{"type":"boolean"},"terms":{"type":["string","null"]},"fingerprint":{"type":"string"},"accepted":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"at":{"type":"string"},"optionalLineIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"signatureUrl":{"type":["string","null"]}},"required":["name","at","optionalLineIds"],"additionalProperties":false},{"type":"null"}]},"pdfUrl":{"type":["string","null"]},"declinedAt":{"type":["string","null"]}},"required":["reference","version","status","title","issuedOn","validUntil","from","to","scope","images","lines","totals","vatRegistered","terms","fingerprint","accepted","declinedAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/quotes/{id}/images":{"post":{"operationId":"quotes.addImage","summary":"Add a picture to the scope","tags":["Quotes"],"x-permission":"quote.manage","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}},"image/heic":{"schema":{"type":"string","format":"binary"}},"image/heif":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"title":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","expired","withdrawn"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enquiryId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"forName":{"type":"string"},"recipientEmail":{"type":["string","null"]},"validUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"sentAt":{"type":["string","null"]},"answeredAt":{"type":["string","null"]},"createdAt":{"type":"string"},"scope":{"type":["string","null"]},"terms":{"type":["string","null"]},"notes":{"type":["string","null"]},"recipientName":{"type":["string","null"]},"recipientCompany":{"type":["string","null"]},"recipientAddress":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"itemId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"optional":{"type":"boolean"},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","description","quantityX100","unitPence","period","optional","netPence"],"additionalProperties":false}},"totals":{"type":"object","properties":{"oneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"optionalOneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"optionalRecurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}}},"required":["oneOff","recurring","optionalOneOff","optionalRecurring"],"additionalProperties":false},"images":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","thumbUrl","fullUrl"],"additionalProperties":false}},"vatRegistered":{"type":"boolean"},"publicUrl":{"type":["string","null"]},"unsentChanges":{"type":"boolean"},"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sentAt":{"type":"string"},"sentByName":{"type":["string","null"]},"fingerprint":{"type":"string"},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["version","sentAt","sentByName","fingerprint","oneOffNet"],"additionalProperties":false}},"acceptance":{"anyOf":[{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"email":{"type":["string","null"]},"at":{"type":"string"},"ip":{"type":["string","null"]},"userAgent":{"type":["string","null"]},"fingerprint":{"type":"string"},"optionalLineIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"signatureUrl":{"type":"string"}},"required":["version","name","email","at","ip","userAgent","fingerprint","optionalLineIds","signatureUrl"],"additionalProperties":false},{"type":"null"}]},"declineReason":{"type":["string","null"]},"changes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","edited","sent","viewed","accepted","declined","withdrawn","reopened","converted"]},"summary":{"type":["string","null"]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","summary","userName","createdAt"],"additionalProperties":false}},"enquiryName":{"type":["string","null"]},"clientName":{"type":"string"},"contactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientAddress":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"work":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"lineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"notNeeded":{"type":"boolean"},"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"bookings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["id","name","date"],"additionalProperties":false}}},"required":["lineId","description","quantityX100","unitPence","period","notNeeded","jobs","bookings"],"additionalProperties":false}},{"type":"null"}]}},"required":["id","number","reference","title","status","version","enquiryId","clientId","forName","recipientEmail","validUntil","oneOffNet","recurring","sentAt","answeredAt","createdAt","scope","terms","notes","recipientName","recipientCompany","recipientAddress","lines","totals","images","vatRegistered","publicUrl","unsentChanges","versions","acceptance","declineReason","changes","enquiryName","clientName","contactId","clientAddress","projectId","projectName","work"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/quotes/{id}/images/{imageId}/{size}":{"get":{"operationId":"quotes.image","summary":"A picture in the scope","tags":["Quotes"],"x-permission":"quote.view","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"imageId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"size","in":"path","required":true,"schema":{"type":"string","enum":["thumb","full"]}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/quotes/{id}/images/{imageId}":{"delete":{"operationId":"quotes.removeImage","summary":"Take a picture out of the working copy (versions already sent keep it)","tags":["Quotes"],"x-permission":"quote.manage","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"imageId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"title":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","expired","withdrawn"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enquiryId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"forName":{"type":"string"},"recipientEmail":{"type":["string","null"]},"validUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"sentAt":{"type":["string","null"]},"answeredAt":{"type":["string","null"]},"createdAt":{"type":"string"},"scope":{"type":["string","null"]},"terms":{"type":["string","null"]},"notes":{"type":["string","null"]},"recipientName":{"type":["string","null"]},"recipientCompany":{"type":["string","null"]},"recipientAddress":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"itemId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"optional":{"type":"boolean"},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","description","quantityX100","unitPence","period","optional","netPence"],"additionalProperties":false}},"totals":{"type":"object","properties":{"oneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"optionalOneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"optionalRecurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}}},"required":["oneOff","recurring","optionalOneOff","optionalRecurring"],"additionalProperties":false},"images":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","thumbUrl","fullUrl"],"additionalProperties":false}},"vatRegistered":{"type":"boolean"},"publicUrl":{"type":["string","null"]},"unsentChanges":{"type":"boolean"},"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sentAt":{"type":"string"},"sentByName":{"type":["string","null"]},"fingerprint":{"type":"string"},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["version","sentAt","sentByName","fingerprint","oneOffNet"],"additionalProperties":false}},"acceptance":{"anyOf":[{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"email":{"type":["string","null"]},"at":{"type":"string"},"ip":{"type":["string","null"]},"userAgent":{"type":["string","null"]},"fingerprint":{"type":"string"},"optionalLineIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"signatureUrl":{"type":"string"}},"required":["version","name","email","at","ip","userAgent","fingerprint","optionalLineIds","signatureUrl"],"additionalProperties":false},{"type":"null"}]},"declineReason":{"type":["string","null"]},"changes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","edited","sent","viewed","accepted","declined","withdrawn","reopened","converted"]},"summary":{"type":["string","null"]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","summary","userName","createdAt"],"additionalProperties":false}},"enquiryName":{"type":["string","null"]},"clientName":{"type":"string"},"contactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientAddress":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"work":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"lineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"notNeeded":{"type":"boolean"},"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"bookings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["id","name","date"],"additionalProperties":false}}},"required":["lineId","description","quantityX100","unitPence","period","notNeeded","jobs","bookings"],"additionalProperties":false}},{"type":"null"}]}},"required":["id","number","reference","title","status","version","enquiryId","clientId","forName","recipientEmail","validUntil","oneOffNet","recurring","sentAt","answeredAt","createdAt","scope","terms","notes","recipientName","recipientCompany","recipientAddress","lines","totals","images","vatRegistered","publicUrl","unsentChanges","versions","acceptance","declineReason","changes","enquiryName","clientName","contactId","clientAddress","projectId","projectName","work"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/quotes/{id}/project":{"put":{"operationId":"quotes.setProject","summary":"Choose what an accepted quote's work is booked against: the client only, or one of its existing projects (until work has been made from it)","tags":["Quotes"],"x-permission":"quote.manage","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["projectId"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"title":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","expired","withdrawn"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enquiryId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"forName":{"type":"string"},"recipientEmail":{"type":["string","null"]},"validUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"sentAt":{"type":["string","null"]},"answeredAt":{"type":["string","null"]},"createdAt":{"type":"string"},"scope":{"type":["string","null"]},"terms":{"type":["string","null"]},"notes":{"type":["string","null"]},"recipientName":{"type":["string","null"]},"recipientCompany":{"type":["string","null"]},"recipientAddress":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"itemId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"optional":{"type":"boolean"},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","description","quantityX100","unitPence","period","optional","netPence"],"additionalProperties":false}},"totals":{"type":"object","properties":{"oneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"optionalOneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"optionalRecurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}}},"required":["oneOff","recurring","optionalOneOff","optionalRecurring"],"additionalProperties":false},"images":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","thumbUrl","fullUrl"],"additionalProperties":false}},"vatRegistered":{"type":"boolean"},"publicUrl":{"type":["string","null"]},"unsentChanges":{"type":"boolean"},"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sentAt":{"type":"string"},"sentByName":{"type":["string","null"]},"fingerprint":{"type":"string"},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["version","sentAt","sentByName","fingerprint","oneOffNet"],"additionalProperties":false}},"acceptance":{"anyOf":[{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"email":{"type":["string","null"]},"at":{"type":"string"},"ip":{"type":["string","null"]},"userAgent":{"type":["string","null"]},"fingerprint":{"type":"string"},"optionalLineIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"signatureUrl":{"type":"string"}},"required":["version","name","email","at","ip","userAgent","fingerprint","optionalLineIds","signatureUrl"],"additionalProperties":false},{"type":"null"}]},"declineReason":{"type":["string","null"]},"changes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","edited","sent","viewed","accepted","declined","withdrawn","reopened","converted"]},"summary":{"type":["string","null"]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","summary","userName","createdAt"],"additionalProperties":false}},"enquiryName":{"type":["string","null"]},"clientName":{"type":"string"},"contactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientAddress":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"work":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"lineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"notNeeded":{"type":"boolean"},"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"bookings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["id","name","date"],"additionalProperties":false}}},"required":["lineId","description","quantityX100","unitPence","period","notNeeded","jobs","bookings"],"additionalProperties":false}},{"type":"null"}]}},"required":["id","number","reference","title","status","version","enquiryId","clientId","forName","recipientEmail","validUntil","oneOffNet","recurring","sentAt","answeredAt","createdAt","scope","terms","notes","recipientName","recipientCompany","recipientAddress","lines","totals","images","vatRegistered","publicUrl","unsentChanges","versions","acceptance","declineReason","changes","enquiryName","clientName","contactId","clientAddress","projectId","projectName","work"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"quotes.addProject","summary":"Add a project (property) for an accepted quote's client, for its address, and link the quote to it","tags":["Quotes"],"x-permission":["quote.manage","project.manage"],"x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["name"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"title":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","expired","withdrawn"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enquiryId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"forName":{"type":"string"},"recipientEmail":{"type":["string","null"]},"validUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"sentAt":{"type":["string","null"]},"answeredAt":{"type":["string","null"]},"createdAt":{"type":"string"},"scope":{"type":["string","null"]},"terms":{"type":["string","null"]},"notes":{"type":["string","null"]},"recipientName":{"type":["string","null"]},"recipientCompany":{"type":["string","null"]},"recipientAddress":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"itemId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"optional":{"type":"boolean"},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","description","quantityX100","unitPence","period","optional","netPence"],"additionalProperties":false}},"totals":{"type":"object","properties":{"oneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"optionalOneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"optionalRecurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}}},"required":["oneOff","recurring","optionalOneOff","optionalRecurring"],"additionalProperties":false},"images":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","thumbUrl","fullUrl"],"additionalProperties":false}},"vatRegistered":{"type":"boolean"},"publicUrl":{"type":["string","null"]},"unsentChanges":{"type":"boolean"},"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sentAt":{"type":"string"},"sentByName":{"type":["string","null"]},"fingerprint":{"type":"string"},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["version","sentAt","sentByName","fingerprint","oneOffNet"],"additionalProperties":false}},"acceptance":{"anyOf":[{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"email":{"type":["string","null"]},"at":{"type":"string"},"ip":{"type":["string","null"]},"userAgent":{"type":["string","null"]},"fingerprint":{"type":"string"},"optionalLineIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"signatureUrl":{"type":"string"}},"required":["version","name","email","at","ip","userAgent","fingerprint","optionalLineIds","signatureUrl"],"additionalProperties":false},{"type":"null"}]},"declineReason":{"type":["string","null"]},"changes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","edited","sent","viewed","accepted","declined","withdrawn","reopened","converted"]},"summary":{"type":["string","null"]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","summary","userName","createdAt"],"additionalProperties":false}},"enquiryName":{"type":["string","null"]},"clientName":{"type":"string"},"contactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientAddress":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"work":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"lineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"notNeeded":{"type":"boolean"},"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"bookings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["id","name","date"],"additionalProperties":false}}},"required":["lineId","description","quantityX100","unitPence","period","notNeeded","jobs","bookings"],"additionalProperties":false}},{"type":"null"}]}},"required":["id","number","reference","title","status","version","enquiryId","clientId","forName","recipientEmail","validUntil","oneOffNet","recurring","sentAt","answeredAt","createdAt","scope","terms","notes","recipientName","recipientCompany","recipientAddress","lines","totals","images","vatRegistered","publicUrl","unsentChanges","versions","acceptance","declineReason","changes","enquiryName","clientName","contactId","clientAddress","projectId","projectName","work"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/quotes/{id}/work":{"post":{"operationId":"quotes.workLine","summary":"Mark an accepted line as not needed as work (or take that back). Jobs and bookings made with fromQuote link themselves.","tags":["Quotes"],"x-permission":"quote.manage","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"lineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"notNeeded":{"type":"boolean"}},"required":["lineId","notNeeded"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"title":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","expired","withdrawn"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enquiryId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"forName":{"type":"string"},"recipientEmail":{"type":["string","null"]},"validUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"sentAt":{"type":["string","null"]},"answeredAt":{"type":["string","null"]},"createdAt":{"type":"string"},"scope":{"type":["string","null"]},"terms":{"type":["string","null"]},"notes":{"type":["string","null"]},"recipientName":{"type":["string","null"]},"recipientCompany":{"type":["string","null"]},"recipientAddress":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"itemId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"optional":{"type":"boolean"},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","description","quantityX100","unitPence","period","optional","netPence"],"additionalProperties":false}},"totals":{"type":"object","properties":{"oneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"optionalOneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"optionalRecurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}}},"required":["oneOff","recurring","optionalOneOff","optionalRecurring"],"additionalProperties":false},"images":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","thumbUrl","fullUrl"],"additionalProperties":false}},"vatRegistered":{"type":"boolean"},"publicUrl":{"type":["string","null"]},"unsentChanges":{"type":"boolean"},"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sentAt":{"type":"string"},"sentByName":{"type":["string","null"]},"fingerprint":{"type":"string"},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["version","sentAt","sentByName","fingerprint","oneOffNet"],"additionalProperties":false}},"acceptance":{"anyOf":[{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"email":{"type":["string","null"]},"at":{"type":"string"},"ip":{"type":["string","null"]},"userAgent":{"type":["string","null"]},"fingerprint":{"type":"string"},"optionalLineIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"signatureUrl":{"type":"string"}},"required":["version","name","email","at","ip","userAgent","fingerprint","optionalLineIds","signatureUrl"],"additionalProperties":false},{"type":"null"}]},"declineReason":{"type":["string","null"]},"changes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","edited","sent","viewed","accepted","declined","withdrawn","reopened","converted"]},"summary":{"type":["string","null"]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","summary","userName","createdAt"],"additionalProperties":false}},"enquiryName":{"type":["string","null"]},"clientName":{"type":"string"},"contactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientAddress":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"work":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"lineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"notNeeded":{"type":"boolean"},"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"bookings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["id","name","date"],"additionalProperties":false}}},"required":["lineId","description","quantityX100","unitPence","period","notNeeded","jobs","bookings"],"additionalProperties":false}},{"type":"null"}]}},"required":["id","number","reference","title","status","version","enquiryId","clientId","forName","recipientEmail","validUntil","oneOffNet","recurring","sentAt","answeredAt","createdAt","scope","terms","notes","recipientName","recipientCompany","recipientAddress","lines","totals","images","vatRegistered","publicUrl","unsentChanges","versions","acceptance","declineReason","changes","enquiryName","clientName","contactId","clientAddress","projectId","projectName","work"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/quotes/{id}/signature":{"get":{"operationId":"quotes.signature","summary":"The signature an accepted quote was signed with","tags":["Quotes"],"x-permission":"quote.view","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/quotes/{id}/pdf":{"get":{"operationId":"quotes.pdf","summary":"The latest version sent as a PDF (signed, once accepted)","tags":["Quotes"],"x-permission":"quote.view","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/quotes/{id}/email":{"get":{"operationId":"quotes.emailDraft","summary":"A ready-to-send email for a quote (sending it, or a nudge) in the company's wording","tags":["Quotes"],"x-permission":"quote.manage","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"kind","in":"query","required":false,"schema":{"default":"quote","type":"string","enum":["quote","quote_nudge"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"to":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":["string","null"]}},"required":["email","name"],"additionalProperties":false}},"subject":{"type":"string"},"message":{"type":"string"},"pdf":{"type":"boolean"},"link":{"type":["string","null"]}},"required":["to","subject","message","pdf","link"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/quotes/{id}/nudge":{"post":{"operationId":"quotes.nudge","summary":"Email the client a nudge about a quote that is out, with its link","tags":["Quotes"],"x-permission":"quote.manage","x-module":"quotes","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"to":{"minItems":1,"maxItems":5,"type":"array","items":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"subject":{"type":"string","minLength":1,"maxLength":300},"message":{"type":"string","minLength":1,"maxLength":10000}},"required":["to","subject","message"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"number":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"reference":{"type":["string","null"]},"title":{"type":"string"},"status":{"type":"string","enum":["draft","sent","viewed","accepted","declined","expired","withdrawn"]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enquiryId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"forName":{"type":"string"},"recipientEmail":{"type":["string","null"]},"validUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"sentAt":{"type":["string","null"]},"answeredAt":{"type":["string","null"]},"createdAt":{"type":"string"},"scope":{"type":["string","null"]},"terms":{"type":["string","null"]},"notes":{"type":["string","null"]},"recipientName":{"type":["string","null"]},"recipientCompany":{"type":["string","null"]},"recipientAddress":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"itemId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"optional":{"type":"boolean"},"netPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","description","quantityX100","unitPence","period","optional","netPence"],"additionalProperties":false}},"totals":{"type":"object","properties":{"oneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"recurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}},"optionalOneOff":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["net"],"additionalProperties":false},"optionalRecurring":{"type":"array","items":{"type":"object","properties":{"net":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]}},"required":["net","period"],"additionalProperties":false}}},"required":["oneOff","recurring","optionalOneOff","optionalRecurring"],"additionalProperties":false},"images":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"width":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"height":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"thumbUrl":{"type":"string"},"fullUrl":{"type":"string"}},"required":["id","width","height","thumbUrl","fullUrl"],"additionalProperties":false}},"vatRegistered":{"type":"boolean"},"publicUrl":{"type":["string","null"]},"unsentChanges":{"type":"boolean"},"versions":{"type":"array","items":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sentAt":{"type":"string"},"sentByName":{"type":["string","null"]},"fingerprint":{"type":"string"},"oneOffNet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["version","sentAt","sentByName","fingerprint","oneOffNet"],"additionalProperties":false}},"acceptance":{"anyOf":[{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"name":{"type":"string"},"email":{"type":["string","null"]},"at":{"type":"string"},"ip":{"type":["string","null"]},"userAgent":{"type":["string","null"]},"fingerprint":{"type":"string"},"optionalLineIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"signatureUrl":{"type":"string"}},"required":["version","name","email","at","ip","userAgent","fingerprint","optionalLineIds","signatureUrl"],"additionalProperties":false},{"type":"null"}]},"declineReason":{"type":["string","null"]},"changes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","edited","sent","viewed","accepted","declined","withdrawn","reopened","converted"]},"summary":{"type":["string","null"]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","summary","userName","createdAt"],"additionalProperties":false}},"enquiryName":{"type":["string","null"]},"clientName":{"type":"string"},"contactId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"clientAddress":{"type":["string","null"]},"projectId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"projectName":{"type":["string","null"]},"work":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"lineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string"},"quantityX100":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPence":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period":{"anyOf":[{"type":"string","enum":["weekly","fortnightly","four_weekly","monthly","quarterly","yearly"]},{"type":"null"}]},"notNeeded":{"type":"boolean"},"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false}},"bookings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["id","name","date"],"additionalProperties":false}}},"required":["lineId","description","quantityX100","unitPence","period","notNeeded","jobs","bookings"],"additionalProperties":false}},{"type":"null"}]}},"required":["id","number","reference","title","status","version","enquiryId","clientId","forName","recipientEmail","validUntil","oneOffNet","recurring","sentAt","answeredAt","createdAt","scope","terms","notes","recipientName","recipientCompany","recipientAddress","lines","totals","images","vatRegistered","publicUrl","unsentChanges","versions","acceptance","declineReason","changes","enquiryName","clientName","contactId","clientAddress","projectId","projectName","work"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/settings/emails":{"get":{"operationId":"emailSettings.get","summary":"What each kind of email to clients says (the company's wording or Workscope's), and invoice reminders","tags":["Emails"],"x-permission":"organization.update","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"templates":{"type":"object","propertyNames":{"type":"string","enum":["invoice","invoice_reminder","payment_received","quote","quote_nudge","quote_accepted","deal_signature","credit_note","purchase_order","applicant_received","applicant_info","applicant_reject","applicant_interview","applicant_interview_reminder","applicant_interview_changed","applicant_interview_cancelled","applicant_onboarding","applicant_welcome"]},"additionalProperties":{"type":"object","properties":{"subject":{"type":"string"},"message":{"type":"string"},"changed":{"type":"boolean"}},"required":["subject","message","changed"],"additionalProperties":false},"required":["invoice","invoice_reminder","payment_received","quote","quote_nudge","quote_accepted","deal_signature","credit_note","purchase_order","applicant_received","applicant_info","applicant_reject","applicant_interview","applicant_interview_reminder","applicant_interview_changed","applicant_interview_cancelled","applicant_onboarding","applicant_welcome"]},"invoiceReminderDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"paymentReceivedEmail":{"type":"boolean"},"pdfs":{"type":"boolean"}},"required":["templates","invoiceReminderDays","paymentReceivedEmail","pdfs"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"emailSettings.update","summary":"Change the wording of emails to clients (null: back to Workscope's), and invoice reminders","tags":["Emails"],"x-permission":"organization.update","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"templates":{"type":"object","propertyNames":{"type":"string","enum":["invoice","invoice_reminder","payment_received","quote","quote_nudge","quote_accepted","deal_signature","credit_note","purchase_order","applicant_received","applicant_info","applicant_reject","applicant_interview","applicant_interview_reminder","applicant_interview_changed","applicant_interview_cancelled","applicant_onboarding","applicant_welcome"]},"additionalProperties":{"anyOf":[{"type":"object","properties":{"subject":{"type":"string","maxLength":300},"message":{"type":"string","maxLength":5000}},"required":["subject","message"]},{"type":"null"}]}},"invoiceReminderDays":{"anyOf":[{"type":"integer","minimum":1,"maximum":120},{"type":"null"}]},"paymentReceivedEmail":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"templates":{"type":"object","propertyNames":{"type":"string","enum":["invoice","invoice_reminder","payment_received","quote","quote_nudge","quote_accepted","deal_signature","credit_note","purchase_order","applicant_received","applicant_info","applicant_reject","applicant_interview","applicant_interview_reminder","applicant_interview_changed","applicant_interview_cancelled","applicant_onboarding","applicant_welcome"]},"additionalProperties":{"type":"object","properties":{"subject":{"type":"string"},"message":{"type":"string"},"changed":{"type":"boolean"}},"required":["subject","message","changed"],"additionalProperties":false},"required":["invoice","invoice_reminder","payment_received","quote","quote_nudge","quote_accepted","deal_signature","credit_note","purchase_order","applicant_received","applicant_info","applicant_reject","applicant_interview","applicant_interview_reminder","applicant_interview_changed","applicant_interview_cancelled","applicant_onboarding","applicant_welcome"]},"invoiceReminderDays":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"paymentReceivedEmail":{"type":"boolean"},"pdfs":{"type":"boolean"}},"required":["templates","invoiceReminderDays","paymentReceivedEmail","pdfs"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/counts":{"get":{"operationId":"recruitment.counts","summary":"How many applicants have something nobody has opened yet (the Recruitment menu's number)","tags":["Recruitment"],"x-permission":"recruit.view","x-module":"recruitment","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"unread":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["unread"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/roles":{"get":{"operationId":"recruitment.roles","summary":"The roles (open first), with how many applied for each","tags":["Recruitment"],"x-permission":"recruit.view","x-module":"recruitment","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"slug":{"type":"string"},"summary":{"type":["string","null"]},"description":{"type":["string","null"]},"area":{"type":["string","null"]},"hours":{"type":["string","null"]},"pay":{"type":["string","null"]},"employmentType":{"type":"string","enum":["employed","self_employed"]},"status":{"type":"string","enum":["draft","open","closed"]},"closesOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"applicants":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"openApplicants":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"}},"required":["id","title","slug","summary","description","area","hours","pay","employmentType","status","closesOn","applicants","openApplicants","createdAt"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"recruitment.createRole","summary":"Add a role (a draft unless opened)","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"summary":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}]},"area":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"hours":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"pay":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"employmentType":{"default":"employed","type":"string","enum":["employed","self_employed"]},"status":{"default":"draft","type":"string","enum":["draft","open","closed"]},"closesOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"slug":{"anyOf":[{"type":"string","maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},{"type":"null"}]}},"required":["title"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"slug":{"type":"string"},"summary":{"type":["string","null"]},"description":{"type":["string","null"]},"area":{"type":["string","null"]},"hours":{"type":["string","null"]},"pay":{"type":["string","null"]},"employmentType":{"type":"string","enum":["employed","self_employed"]},"status":{"type":"string","enum":["draft","open","closed"]},"closesOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"applicants":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"openApplicants":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"}},"required":["id","title","slug","summary","description","area","hours","pay","employmentType","status","closesOn","applicants","openApplicants","createdAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/roles/{id}":{"patch":{"operationId":"recruitment.updateRole","summary":"Change a role, open it or close it","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"summary":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}]},"area":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"hours":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"pay":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"employmentType":{"default":"employed","type":"string","enum":["employed","self_employed"]},"status":{"default":"draft","type":"string","enum":["draft","open","closed"]},"closesOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"slug":{"anyOf":[{"type":"string","maxLength":80,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},{"type":"null"}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"slug":{"type":"string"},"summary":{"type":["string","null"]},"description":{"type":["string","null"]},"area":{"type":["string","null"]},"hours":{"type":["string","null"]},"pay":{"type":["string","null"]},"employmentType":{"type":"string","enum":["employed","self_employed"]},"status":{"type":"string","enum":["draft","open","closed"]},"closesOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"applicants":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"openApplicants":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string"}},"required":["id","title","slug","summary","description","area","hours","pay","employmentType","status","closesOn","applicants","openApplicants","createdAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"recruitment.removeRole","summary":"Delete a role nobody has applied for (close it otherwise)","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/applicants":{"get":{"operationId":"recruitment.list","summary":"Applicants (the board or a list), with counts by stage, and the jobs address","tags":["Recruitment"],"x-permission":"recruit.view","x-module":"recruitment","parameters":[{"name":"view","in":"query","required":false,"schema":{"default":"list","type":"string","enum":["list","board"]}},{"name":"stage","in":"query","required":false,"schema":{"default":"open","type":"string","enum":["new","screening","interview","onboarding","on_trial","hired","rejected","withdrawn","open","all"]}},{"name":"roleId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["careers","email","manual"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"quiet","in":"query","required":false,"schema":{"type":"string","enum":["1"]}},{"name":"due","in":"query","required":false,"schema":{"type":"string","enum":["1"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"applicants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"area":{"type":["string","null"]},"stage":{"type":"string","enum":["new","screening","interview","onboarding","on_trial","hired","rejected","withdrawn"]},"source":{"type":"string","enum":["careers","email","manual"]},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false}},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedName":{"type":["string","null"]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"type":["string","null"]},"overdue":{"type":"boolean"},"goneQuiet":{"type":"boolean"},"unread":{"type":"boolean"},"files":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daysInStage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastActivityAt":{"type":"string"},"lastActivity":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","name","email","phone","area","stage","source","roles","assignedUserId","assignedName","nextActionOn","nextAction","overdue","goneQuiet","unread","files","daysInStage","lastActivityAt","lastActivity","createdAt"],"additionalProperties":false}},"counts":{"type":"object","propertyNames":{"type":"string","enum":["new","screening","interview","onboarding","on_trial","hired","rejected","withdrawn","open","all"]},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"required":["new","screening","interview","onboarding","on_trial","hired","rejected","withdrawn","open","all"]},"quiet":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"due":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"goneQuietDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"jobsAddress":{"type":"string"},"careersUrl":{"type":["string","null"]}},"required":["applicants","counts","quiet","due","goneQuietDays","jobsAddress","careersUrl"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"recruitment.create","summary":"Add an applicant by hand. An email address already an applicant adds to them (linked: true).","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"anyOf":[{"anyOf":[{"type":"string","const":""},{"type":"string"}]},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"area":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"availability":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"rightToWork":{"type":["boolean","null"]},"message":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}]},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"roleId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["name"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"area":{"type":["string","null"]},"stage":{"type":"string","enum":["new","screening","interview","onboarding","on_trial","hired","rejected","withdrawn"]},"source":{"type":"string","enum":["careers","email","manual"]},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false}},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedName":{"type":["string","null"]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"type":["string","null"]},"overdue":{"type":"boolean"},"goneQuiet":{"type":"boolean"},"unread":{"type":"boolean"},"files":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daysInStage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastActivityAt":{"type":"string"},"lastActivity":{"type":["string","null"]},"createdAt":{"type":"string"},"availability":{"type":["string","null"]},"rightToWork":{"type":["boolean","null"]},"message":{"type":["string","null"]},"jobsAddress":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","applied","email_in","email_out","note","call","stage","file","assigned","interview","onboarding","trial","retention"]},"subject":{"type":["string","null"]},"body":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"toAddress":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","filename","contentType","bytes","url"],"additionalProperties":false}},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["queued","sent","not_sent","delivered","bounced","complained","failed"]},"detail":{"type":["string","null"]}},"required":["status","detail"],"additionalProperties":false},{"type":"null"}]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","subject","body","fromAddress","toAddress","attachments","meta","delivery","userName","createdAt"],"additionalProperties":false}},"interviews":{"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"interviewerName":{"type":["string","null"]},"place":{"type":"string","enum":["office","other","phone","video"]},"placeText":{"type":["string","null"]},"where":{"type":"string"},"status":{"type":"string"},"past":{"type":"boolean"}},"required":["bookingId","date","start","end","teamMemberId","interviewerName","place","placeText","where","status","past"],"additionalProperties":false}},"interviewScore":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"onboarding":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["open","submitted","approved"]},"expiresAt":{"type":"string"},"expired":{"type":"boolean"},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roleTitle":{"type":["string","null"]},"link":{"type":"string"},"steps":{"type":"object","propertyNames":{"type":"string","enum":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"additionalProperties":{"type":"boolean"},"required":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"submittedAt":{"type":["string","null"]},"approvedAt":{"type":["string","null"]}},"required":["status","expiresAt","expired","startDate","roleTitle","link","steps","submittedAt","approvedAt"],"additionalProperties":false},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"onTrial":{"type":"boolean"},"deleteOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptReason":{"type":["string","null"]},"linked":{"type":"boolean"}},"required":["id","name","email","phone","area","stage","source","roles","assignedUserId","assignedName","nextActionOn","nextAction","overdue","goneQuiet","unread","files","daysInStage","lastActivityAt","lastActivity","createdAt","availability","rightToWork","message","jobsAddress","events","interviews","interviewScore","onboarding","teamMemberId","onTrial","deleteOn","keptUntil","keptReason","linked"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/applicants/{id}":{"get":{"operationId":"recruitment.get","summary":"One applicant and their timeline (marks them read)","tags":["Recruitment"],"x-permission":"recruit.view","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"area":{"type":["string","null"]},"stage":{"type":"string","enum":["new","screening","interview","onboarding","on_trial","hired","rejected","withdrawn"]},"source":{"type":"string","enum":["careers","email","manual"]},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false}},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedName":{"type":["string","null"]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"type":["string","null"]},"overdue":{"type":"boolean"},"goneQuiet":{"type":"boolean"},"unread":{"type":"boolean"},"files":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daysInStage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastActivityAt":{"type":"string"},"lastActivity":{"type":["string","null"]},"createdAt":{"type":"string"},"availability":{"type":["string","null"]},"rightToWork":{"type":["boolean","null"]},"message":{"type":["string","null"]},"jobsAddress":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","applied","email_in","email_out","note","call","stage","file","assigned","interview","onboarding","trial","retention"]},"subject":{"type":["string","null"]},"body":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"toAddress":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","filename","contentType","bytes","url"],"additionalProperties":false}},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["queued","sent","not_sent","delivered","bounced","complained","failed"]},"detail":{"type":["string","null"]}},"required":["status","detail"],"additionalProperties":false},{"type":"null"}]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","subject","body","fromAddress","toAddress","attachments","meta","delivery","userName","createdAt"],"additionalProperties":false}},"interviews":{"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"interviewerName":{"type":["string","null"]},"place":{"type":"string","enum":["office","other","phone","video"]},"placeText":{"type":["string","null"]},"where":{"type":"string"},"status":{"type":"string"},"past":{"type":"boolean"}},"required":["bookingId","date","start","end","teamMemberId","interviewerName","place","placeText","where","status","past"],"additionalProperties":false}},"interviewScore":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"onboarding":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["open","submitted","approved"]},"expiresAt":{"type":"string"},"expired":{"type":"boolean"},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roleTitle":{"type":["string","null"]},"link":{"type":"string"},"steps":{"type":"object","propertyNames":{"type":"string","enum":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"additionalProperties":{"type":"boolean"},"required":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"submittedAt":{"type":["string","null"]},"approvedAt":{"type":["string","null"]}},"required":["status","expiresAt","expired","startDate","roleTitle","link","steps","submittedAt","approvedAt"],"additionalProperties":false},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"onTrial":{"type":"boolean"},"deleteOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptReason":{"type":["string","null"]}},"required":["id","name","email","phone","area","stage","source","roles","assignedUserId","assignedName","nextActionOn","nextAction","overdue","goneQuiet","unread","files","daysInStage","lastActivityAt","lastActivity","createdAt","availability","rightToWork","message","jobsAddress","events","interviews","interviewScore","onboarding","teamMemberId","onTrial","deleteOn","keptUntil","keptReason"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"recruitment.update","summary":"Change an applicant: details, stage, roles, who has them, next action","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"anyOf":[{"anyOf":[{"type":"string","const":""},{"type":"string"}]},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"area":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"availability":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"rightToWork":{"type":["boolean","null"]},"message":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}]},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"stage":{"type":"string","enum":["new","screening","interview","onboarding","on_trial","hired","rejected","withdrawn"]},"roleIds":{"maxItems":20,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"area":{"type":["string","null"]},"stage":{"type":"string","enum":["new","screening","interview","onboarding","on_trial","hired","rejected","withdrawn"]},"source":{"type":"string","enum":["careers","email","manual"]},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false}},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedName":{"type":["string","null"]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"type":["string","null"]},"overdue":{"type":"boolean"},"goneQuiet":{"type":"boolean"},"unread":{"type":"boolean"},"files":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daysInStage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastActivityAt":{"type":"string"},"lastActivity":{"type":["string","null"]},"createdAt":{"type":"string"},"availability":{"type":["string","null"]},"rightToWork":{"type":["boolean","null"]},"message":{"type":["string","null"]},"jobsAddress":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","applied","email_in","email_out","note","call","stage","file","assigned","interview","onboarding","trial","retention"]},"subject":{"type":["string","null"]},"body":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"toAddress":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","filename","contentType","bytes","url"],"additionalProperties":false}},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["queued","sent","not_sent","delivered","bounced","complained","failed"]},"detail":{"type":["string","null"]}},"required":["status","detail"],"additionalProperties":false},{"type":"null"}]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","subject","body","fromAddress","toAddress","attachments","meta","delivery","userName","createdAt"],"additionalProperties":false}},"interviews":{"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"interviewerName":{"type":["string","null"]},"place":{"type":"string","enum":["office","other","phone","video"]},"placeText":{"type":["string","null"]},"where":{"type":"string"},"status":{"type":"string"},"past":{"type":"boolean"}},"required":["bookingId","date","start","end","teamMemberId","interviewerName","place","placeText","where","status","past"],"additionalProperties":false}},"interviewScore":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"onboarding":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["open","submitted","approved"]},"expiresAt":{"type":"string"},"expired":{"type":"boolean"},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roleTitle":{"type":["string","null"]},"link":{"type":"string"},"steps":{"type":"object","propertyNames":{"type":"string","enum":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"additionalProperties":{"type":"boolean"},"required":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"submittedAt":{"type":["string","null"]},"approvedAt":{"type":["string","null"]}},"required":["status","expiresAt","expired","startDate","roleTitle","link","steps","submittedAt","approvedAt"],"additionalProperties":false},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"onTrial":{"type":"boolean"},"deleteOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptReason":{"type":["string","null"]}},"required":["id","name","email","phone","area","stage","source","roles","assignedUserId","assignedName","nextActionOn","nextAction","overdue","goneQuiet","unread","files","daysInStage","lastActivityAt","lastActivity","createdAt","availability","rightToWork","message","jobsAddress","events","interviews","interviewScore","onboarding","teamMemberId","onTrial","deleteOn","keptUntil","keptReason"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"recruitment.remove","summary":"Delete an applicant for good: their timeline, emails, files and onboarding (recorded, without their name, in the privacy log)","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/applicants/{id}/export":{"get":{"operationId":"recruitment.exportApplicant","summary":"Download everything held about an applicant: a ZIP of their record, timeline and files (recorded in the privacy log)","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/applicants/{id}/keep":{"post":{"operationId":"recruitment.keep","summary":"Keep an applicant for another retention period instead of deleting them, saying why","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"area":{"type":["string","null"]},"stage":{"type":"string","enum":["new","screening","interview","onboarding","on_trial","hired","rejected","withdrawn"]},"source":{"type":"string","enum":["careers","email","manual"]},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false}},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedName":{"type":["string","null"]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"type":["string","null"]},"overdue":{"type":"boolean"},"goneQuiet":{"type":"boolean"},"unread":{"type":"boolean"},"files":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daysInStage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastActivityAt":{"type":"string"},"lastActivity":{"type":["string","null"]},"createdAt":{"type":"string"},"availability":{"type":["string","null"]},"rightToWork":{"type":["boolean","null"]},"message":{"type":["string","null"]},"jobsAddress":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","applied","email_in","email_out","note","call","stage","file","assigned","interview","onboarding","trial","retention"]},"subject":{"type":["string","null"]},"body":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"toAddress":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","filename","contentType","bytes","url"],"additionalProperties":false}},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["queued","sent","not_sent","delivered","bounced","complained","failed"]},"detail":{"type":["string","null"]}},"required":["status","detail"],"additionalProperties":false},{"type":"null"}]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","subject","body","fromAddress","toAddress","attachments","meta","delivery","userName","createdAt"],"additionalProperties":false}},"interviews":{"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"interviewerName":{"type":["string","null"]},"place":{"type":"string","enum":["office","other","phone","video"]},"placeText":{"type":["string","null"]},"where":{"type":"string"},"status":{"type":"string"},"past":{"type":"boolean"}},"required":["bookingId","date","start","end","teamMemberId","interviewerName","place","placeText","where","status","past"],"additionalProperties":false}},"interviewScore":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"onboarding":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["open","submitted","approved"]},"expiresAt":{"type":"string"},"expired":{"type":"boolean"},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roleTitle":{"type":["string","null"]},"link":{"type":"string"},"steps":{"type":"object","propertyNames":{"type":"string","enum":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"additionalProperties":{"type":"boolean"},"required":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"submittedAt":{"type":["string","null"]},"approvedAt":{"type":["string","null"]}},"required":["status","expiresAt","expired","startDate","roleTitle","link","steps","submittedAt","approvedAt"],"additionalProperties":false},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"onTrial":{"type":"boolean"},"deleteOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptReason":{"type":["string","null"]}},"required":["id","name","email","phone","area","stage","source","roles","assignedUserId","assignedName","nextActionOn","nextAction","overdue","goneQuiet","unread","files","daysInStage","lastActivityAt","lastActivity","createdAt","availability","rightToWork","message","jobsAddress","events","interviews","interviewScore","onboarding","teamMemberId","onTrial","deleteOn","keptUntil","keptReason"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/retention":{"get":{"operationId":"recruitment.retention","summary":"Applicants due for deletion in the next 30 days, and the privacy log","tags":["Recruitment"],"x-permission":"recruit.view","x-module":"recruitment","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"months":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"due":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"stage":{"type":"string","enum":["new","screening","interview","onboarding","on_trial","hired","rejected","withdrawn"]},"deleteOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"keptUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["id","name","stage","deleteOn","keptUntil"],"additionalProperties":false}},"log":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"action":{"type":"string","enum":["auto_deleted","deleted","exported","kept"]},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"detail":{"type":["string","null"]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","action","count","detail","userName","createdAt"],"additionalProperties":false}}},"required":["months","due","log"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/applicants/{id}/read":{"post":{"operationId":"recruitment.markRead","summary":"Mark an applicant read (or unread again)","tags":["Recruitment"],"x-permission":"recruit.view","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"unread":{"default":false,"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ok":{"type":"boolean","const":true}},"required":["ok"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/applicants/{id}/notes":{"post":{"operationId":"recruitment.note","summary":"Add a note or a call to the timeline","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"default":"note","type":"string","enum":["note","call"]},"body":{"type":"string","minLength":1,"maxLength":10000}},"required":["body"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"area":{"type":["string","null"]},"stage":{"type":"string","enum":["new","screening","interview","onboarding","on_trial","hired","rejected","withdrawn"]},"source":{"type":"string","enum":["careers","email","manual"]},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false}},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedName":{"type":["string","null"]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"type":["string","null"]},"overdue":{"type":"boolean"},"goneQuiet":{"type":"boolean"},"unread":{"type":"boolean"},"files":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daysInStage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastActivityAt":{"type":"string"},"lastActivity":{"type":["string","null"]},"createdAt":{"type":"string"},"availability":{"type":["string","null"]},"rightToWork":{"type":["boolean","null"]},"message":{"type":["string","null"]},"jobsAddress":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","applied","email_in","email_out","note","call","stage","file","assigned","interview","onboarding","trial","retention"]},"subject":{"type":["string","null"]},"body":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"toAddress":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","filename","contentType","bytes","url"],"additionalProperties":false}},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["queued","sent","not_sent","delivered","bounced","complained","failed"]},"detail":{"type":["string","null"]}},"required":["status","detail"],"additionalProperties":false},{"type":"null"}]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","subject","body","fromAddress","toAddress","attachments","meta","delivery","userName","createdAt"],"additionalProperties":false}},"interviews":{"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"interviewerName":{"type":["string","null"]},"place":{"type":"string","enum":["office","other","phone","video"]},"placeText":{"type":["string","null"]},"where":{"type":"string"},"status":{"type":"string"},"past":{"type":"boolean"}},"required":["bookingId","date","start","end","teamMemberId","interviewerName","place","placeText","where","status","past"],"additionalProperties":false}},"interviewScore":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"onboarding":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["open","submitted","approved"]},"expiresAt":{"type":"string"},"expired":{"type":"boolean"},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roleTitle":{"type":["string","null"]},"link":{"type":"string"},"steps":{"type":"object","propertyNames":{"type":"string","enum":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"additionalProperties":{"type":"boolean"},"required":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"submittedAt":{"type":["string","null"]},"approvedAt":{"type":["string","null"]}},"required":["status","expiresAt","expired","startDate","roleTitle","link","steps","submittedAt","approvedAt"],"additionalProperties":false},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"onTrial":{"type":"boolean"},"deleteOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptReason":{"type":["string","null"]}},"required":["id","name","email","phone","area","stage","source","roles","assignedUserId","assignedName","nextActionOn","nextAction","overdue","goneQuiet","unread","files","daysInStage","lastActivityAt","lastActivity","createdAt","availability","rightToWork","message","jobsAddress","events","interviews","interviewScore","onboarding","teamMemberId","onTrial","deleteOn","keptUntil","keptReason"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/applicants/{id}/email-draft":{"get":{"operationId":"recruitment.emailDraft","summary":"A ready-written email (thanks for applying, asking for more, or not this time) in the company's own words","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"kind","in":"query","required":true,"schema":{"type":"string","enum":["applicant_received","applicant_info","applicant_reject"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"to":{"type":["string","null"]},"subject":{"type":"string"},"message":{"type":"string"}},"required":["to","subject","message"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/applicants/{id}/email":{"post":{"operationId":"recruitment.email","summary":"Email the applicant. Their answer comes back to them here. Links may only be to Workscope.","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"subject":{"type":"string","minLength":1,"maxLength":300},"body":{"type":"string","minLength":1,"maxLength":20000}},"required":["subject","body"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"area":{"type":["string","null"]},"stage":{"type":"string","enum":["new","screening","interview","onboarding","on_trial","hired","rejected","withdrawn"]},"source":{"type":"string","enum":["careers","email","manual"]},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false}},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedName":{"type":["string","null"]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"type":["string","null"]},"overdue":{"type":"boolean"},"goneQuiet":{"type":"boolean"},"unread":{"type":"boolean"},"files":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daysInStage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastActivityAt":{"type":"string"},"lastActivity":{"type":["string","null"]},"createdAt":{"type":"string"},"availability":{"type":["string","null"]},"rightToWork":{"type":["boolean","null"]},"message":{"type":["string","null"]},"jobsAddress":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","applied","email_in","email_out","note","call","stage","file","assigned","interview","onboarding","trial","retention"]},"subject":{"type":["string","null"]},"body":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"toAddress":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","filename","contentType","bytes","url"],"additionalProperties":false}},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["queued","sent","not_sent","delivered","bounced","complained","failed"]},"detail":{"type":["string","null"]}},"required":["status","detail"],"additionalProperties":false},{"type":"null"}]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","subject","body","fromAddress","toAddress","attachments","meta","delivery","userName","createdAt"],"additionalProperties":false}},"interviews":{"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"interviewerName":{"type":["string","null"]},"place":{"type":"string","enum":["office","other","phone","video"]},"placeText":{"type":["string","null"]},"where":{"type":"string"},"status":{"type":"string"},"past":{"type":"boolean"}},"required":["bookingId","date","start","end","teamMemberId","interviewerName","place","placeText","where","status","past"],"additionalProperties":false}},"interviewScore":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"onboarding":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["open","submitted","approved"]},"expiresAt":{"type":"string"},"expired":{"type":"boolean"},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roleTitle":{"type":["string","null"]},"link":{"type":"string"},"steps":{"type":"object","propertyNames":{"type":"string","enum":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"additionalProperties":{"type":"boolean"},"required":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"submittedAt":{"type":["string","null"]},"approvedAt":{"type":["string","null"]}},"required":["status","expiresAt","expired","startDate","roleTitle","link","steps","submittedAt","approvedAt"],"additionalProperties":false},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"onTrial":{"type":"boolean"},"deleteOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptReason":{"type":["string","null"]}},"required":["id","name","email","phone","area","stage","source","roles","assignedUserId","assignedName","nextActionOn","nextAction","overdue","goneQuiet","unread","files","daysInStage","lastActivityAt","lastActivity","createdAt","availability","rightToWork","message","jobsAddress","events","interviews","interviewScore","onboarding","teamMemberId","onTrial","deleteOn","keptUntil","keptReason"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/applicants/{id}/reject":{"post":{"operationId":"recruitment.reject","summary":"Move to Rejected, and (unless email is false) send the \"not this time\" email","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"default":true,"type":"boolean"},"subject":{"type":"string","maxLength":300},"body":{"type":"string","maxLength":20000}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"area":{"type":["string","null"]},"stage":{"type":"string","enum":["new","screening","interview","onboarding","on_trial","hired","rejected","withdrawn"]},"source":{"type":"string","enum":["careers","email","manual"]},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false}},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedName":{"type":["string","null"]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"type":["string","null"]},"overdue":{"type":"boolean"},"goneQuiet":{"type":"boolean"},"unread":{"type":"boolean"},"files":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daysInStage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastActivityAt":{"type":"string"},"lastActivity":{"type":["string","null"]},"createdAt":{"type":"string"},"availability":{"type":["string","null"]},"rightToWork":{"type":["boolean","null"]},"message":{"type":["string","null"]},"jobsAddress":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","applied","email_in","email_out","note","call","stage","file","assigned","interview","onboarding","trial","retention"]},"subject":{"type":["string","null"]},"body":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"toAddress":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","filename","contentType","bytes","url"],"additionalProperties":false}},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["queued","sent","not_sent","delivered","bounced","complained","failed"]},"detail":{"type":["string","null"]}},"required":["status","detail"],"additionalProperties":false},{"type":"null"}]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","subject","body","fromAddress","toAddress","attachments","meta","delivery","userName","createdAt"],"additionalProperties":false}},"interviews":{"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"interviewerName":{"type":["string","null"]},"place":{"type":"string","enum":["office","other","phone","video"]},"placeText":{"type":["string","null"]},"where":{"type":"string"},"status":{"type":"string"},"past":{"type":"boolean"}},"required":["bookingId","date","start","end","teamMemberId","interviewerName","place","placeText","where","status","past"],"additionalProperties":false}},"interviewScore":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"onboarding":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["open","submitted","approved"]},"expiresAt":{"type":"string"},"expired":{"type":"boolean"},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roleTitle":{"type":["string","null"]},"link":{"type":"string"},"steps":{"type":"object","propertyNames":{"type":"string","enum":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"additionalProperties":{"type":"boolean"},"required":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"submittedAt":{"type":["string","null"]},"approvedAt":{"type":["string","null"]}},"required":["status","expiresAt","expired","startDate","roleTitle","link","steps","submittedAt","approvedAt"],"additionalProperties":false},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"onTrial":{"type":"boolean"},"deleteOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptReason":{"type":["string","null"]}},"required":["id","name","email","phone","area","stage","source","roles","assignedUserId","assignedName","nextActionOn","nextAction","overdue","goneQuiet","unread","files","daysInStage","lastActivityAt","lastActivity","createdAt","availability","rightToWork","message","jobsAddress","events","interviews","interviewScore","onboarding","teamMemberId","onTrial","deleteOn","keptUntil","keptReason"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/applicants/{id}/files":{"post":{"operationId":"recruitment.addFile","summary":"Add a file (a CV, a certificate): send the file itself as application/octet-stream, its name in the query","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"name","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"area":{"type":["string","null"]},"stage":{"type":"string","enum":["new","screening","interview","onboarding","on_trial","hired","rejected","withdrawn"]},"source":{"type":"string","enum":["careers","email","manual"]},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false}},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedName":{"type":["string","null"]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"type":["string","null"]},"overdue":{"type":"boolean"},"goneQuiet":{"type":"boolean"},"unread":{"type":"boolean"},"files":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daysInStage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastActivityAt":{"type":"string"},"lastActivity":{"type":["string","null"]},"createdAt":{"type":"string"},"availability":{"type":["string","null"]},"rightToWork":{"type":["boolean","null"]},"message":{"type":["string","null"]},"jobsAddress":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","applied","email_in","email_out","note","call","stage","file","assigned","interview","onboarding","trial","retention"]},"subject":{"type":["string","null"]},"body":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"toAddress":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","filename","contentType","bytes","url"],"additionalProperties":false}},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["queued","sent","not_sent","delivered","bounced","complained","failed"]},"detail":{"type":["string","null"]}},"required":["status","detail"],"additionalProperties":false},{"type":"null"}]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","subject","body","fromAddress","toAddress","attachments","meta","delivery","userName","createdAt"],"additionalProperties":false}},"interviews":{"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"interviewerName":{"type":["string","null"]},"place":{"type":"string","enum":["office","other","phone","video"]},"placeText":{"type":["string","null"]},"where":{"type":"string"},"status":{"type":"string"},"past":{"type":"boolean"}},"required":["bookingId","date","start","end","teamMemberId","interviewerName","place","placeText","where","status","past"],"additionalProperties":false}},"interviewScore":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"onboarding":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["open","submitted","approved"]},"expiresAt":{"type":"string"},"expired":{"type":"boolean"},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roleTitle":{"type":["string","null"]},"link":{"type":"string"},"steps":{"type":"object","propertyNames":{"type":"string","enum":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"additionalProperties":{"type":"boolean"},"required":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"submittedAt":{"type":["string","null"]},"approvedAt":{"type":["string","null"]}},"required":["status","expiresAt","expired","startDate","roleTitle","link","steps","submittedAt","approvedAt"],"additionalProperties":false},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"onTrial":{"type":"boolean"},"deleteOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptReason":{"type":["string","null"]}},"required":["id","name","email","phone","area","stage","source","roles","assignedUserId","assignedName","nextActionOn","nextAction","overdue","goneQuiet","unread","files","daysInStage","lastActivityAt","lastActivity","createdAt","availability","rightToWork","message","jobsAddress","events","interviews","interviewScore","onboarding","teamMemberId","onTrial","deleteOn","keptUntil","keptReason"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/applicants/{id}/events/{eventId}/attachments/{index}":{"get":{"operationId":"recruitment.attachment","summary":"A file that came with an application or an email","tags":["Recruitment"],"x-permission":"recruit.view","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"eventId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"index","in":"path","required":true,"schema":{"type":"integer","minimum":0,"maximum":50}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/careers":{"get":{"operationId":"recruitment.careers","summary":"The careers page settings (made, switched off, the first time)","tags":["Recruitment"],"x-permission":"recruit.view","x-module":"recruitment","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"},"slug":{"type":"string"},"url":{"type":"string"},"colour":{"type":"string"},"headline":{"type":["string","null"]},"about":{"type":["string","null"]},"perks":{"type":"array","items":{"type":"string"}},"coverUrl":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"thumbUrl":{"type":"string"}},"required":["id","url","thumbUrl"],"additionalProperties":false}},"speculative":{"type":"boolean"},"autoReply":{"type":"boolean"},"privacy":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"companyName":{"type":"string"},"retentionMonths":{"anyOf":[{"type":"number","const":3},{"type":"number","const":6},{"type":"number","const":12},{"type":"number","const":24}]}},"required":["enabled","slug","url","colour","headline","about","perks","coverUrl","photos","speculative","autoReply","privacy","logoUrl","companyName","retentionMonths"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"patch":{"operationId":"recruitment.updateCareers","summary":"Change the careers page: switch it on, its address, colour, words, perks","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"},"slug":{"type":"string","minLength":2,"maxLength":60,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"colour":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"headline":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"about":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"perks":{"maxItems":12,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"speculative":{"type":"boolean"},"autoReply":{"type":"boolean"},"privacy":{"anyOf":[{"type":"string","maxLength":3000},{"type":"null"}]},"retentionMonths":{"anyOf":[{"type":"number","const":3},{"type":"number","const":6},{"type":"number","const":12},{"type":"number","const":24}]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"},"slug":{"type":"string"},"url":{"type":"string"},"colour":{"type":"string"},"headline":{"type":["string","null"]},"about":{"type":["string","null"]},"perks":{"type":"array","items":{"type":"string"}},"coverUrl":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"thumbUrl":{"type":"string"}},"required":["id","url","thumbUrl"],"additionalProperties":false}},"speculative":{"type":"boolean"},"autoReply":{"type":"boolean"},"privacy":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"companyName":{"type":"string"},"retentionMonths":{"anyOf":[{"type":"number","const":3},{"type":"number","const":6},{"type":"number","const":12},{"type":"number","const":24}]}},"required":["enabled","slug","url","colour","headline","about","perks","coverUrl","photos","speculative","autoReply","privacy","logoUrl","companyName","retentionMonths"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/careers/preview":{"get":{"operationId":"recruitment.careersPreview","summary":"The careers page as visitors would see it, even while switched off","tags":["Recruitment"],"x-permission":"recruit.view","x-module":"recruitment","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"slug":{"type":"string"},"companyName":{"type":"string"},"website":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"colour":{"type":"string"},"headline":{"type":["string","null"]},"about":{"type":["string","null"]},"perks":{"type":"array","items":{"type":"string"}},"coverUrl":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"thumbUrl":{"type":"string"}},"required":["id","url","thumbUrl"],"additionalProperties":false}},"speculative":{"type":"boolean"},"privacy":{"type":"string"},"roles":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"string"},"summary":{"type":["string","null"]},"area":{"type":["string","null"]},"hours":{"type":["string","null"]},"pay":{"type":["string","null"]},"employmentType":{"type":"string","enum":["employed","self_employed"]},"closesOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"description":{"type":["string","null"]}},"required":["slug","title","summary","area","hours","pay","employmentType","closesOn","description"],"additionalProperties":false}},"role":{"anyOf":[{"type":"object","properties":{"slug":{"type":"string"},"title":{"type":"string"},"summary":{"type":["string","null"]},"area":{"type":["string","null"]},"hours":{"type":["string","null"]},"pay":{"type":["string","null"]},"employmentType":{"type":"string","enum":["employed","self_employed"]},"closesOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"description":{"type":["string","null"]}},"required":["slug","title","summary","area","hours","pay","employmentType","closesOn","description"],"additionalProperties":false},{"type":"null"}]},"preview":{"type":"boolean"}},"required":["slug","companyName","website","logoUrl","colour","headline","about","perks","coverUrl","photos","speculative","privacy","roles","role","preview"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/careers/cover":{"post":{"operationId":"recruitment.careersCover","summary":"Set the cover picture: send the image itself (JPEG, PNG or WebP)","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[],"requestBody":{"required":true,"content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}},"image/heic":{"schema":{"type":"string","format":"binary"}},"image/heif":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"},"slug":{"type":"string"},"url":{"type":"string"},"colour":{"type":"string"},"headline":{"type":["string","null"]},"about":{"type":["string","null"]},"perks":{"type":"array","items":{"type":"string"}},"coverUrl":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"thumbUrl":{"type":"string"}},"required":["id","url","thumbUrl"],"additionalProperties":false}},"speculative":{"type":"boolean"},"autoReply":{"type":"boolean"},"privacy":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"companyName":{"type":"string"},"retentionMonths":{"anyOf":[{"type":"number","const":3},{"type":"number","const":6},{"type":"number","const":12},{"type":"number","const":24}]}},"required":["enabled","slug","url","colour","headline","about","perks","coverUrl","photos","speculative","autoReply","privacy","logoUrl","companyName","retentionMonths"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"recruitment.removeCareersCover","summary":"Take the cover picture off","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"},"slug":{"type":"string"},"url":{"type":"string"},"colour":{"type":"string"},"headline":{"type":["string","null"]},"about":{"type":["string","null"]},"perks":{"type":"array","items":{"type":"string"}},"coverUrl":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"thumbUrl":{"type":"string"}},"required":["id","url","thumbUrl"],"additionalProperties":false}},"speculative":{"type":"boolean"},"autoReply":{"type":"boolean"},"privacy":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"companyName":{"type":"string"},"retentionMonths":{"anyOf":[{"type":"number","const":3},{"type":"number","const":6},{"type":"number","const":12},{"type":"number","const":24}]}},"required":["enabled","slug","url","colour","headline","about","perks","coverUrl","photos","speculative","autoReply","privacy","logoUrl","companyName","retentionMonths"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/careers/photos":{"post":{"operationId":"recruitment.addCareersPhoto","summary":"Add a photo to \"About us\" (up to 8): send the image itself","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[],"requestBody":{"required":true,"content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}},"image/webp":{"schema":{"type":"string","format":"binary"}},"image/heic":{"schema":{"type":"string","format":"binary"}},"image/heif":{"schema":{"type":"string","format":"binary"}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"},"slug":{"type":"string"},"url":{"type":"string"},"colour":{"type":"string"},"headline":{"type":["string","null"]},"about":{"type":["string","null"]},"perks":{"type":"array","items":{"type":"string"}},"coverUrl":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"thumbUrl":{"type":"string"}},"required":["id","url","thumbUrl"],"additionalProperties":false}},"speculative":{"type":"boolean"},"autoReply":{"type":"boolean"},"privacy":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"companyName":{"type":"string"},"retentionMonths":{"anyOf":[{"type":"number","const":3},{"type":"number","const":6},{"type":"number","const":12},{"type":"number","const":24}]}},"required":["enabled","slug","url","colour","headline","about","perks","coverUrl","photos","speculative","autoReply","privacy","logoUrl","companyName","retentionMonths"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/careers/photos/{id}":{"delete":{"operationId":"recruitment.removeCareersPhoto","summary":"Take a photo off","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9-]{1,60}$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"},"slug":{"type":"string"},"url":{"type":"string"},"colour":{"type":"string"},"headline":{"type":["string","null"]},"about":{"type":["string","null"]},"perks":{"type":"array","items":{"type":"string"}},"coverUrl":{"type":["string","null"]},"photos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"thumbUrl":{"type":"string"}},"required":["id","url","thumbUrl"],"additionalProperties":false}},"speculative":{"type":"boolean"},"autoReply":{"type":"boolean"},"privacy":{"type":["string","null"]},"logoUrl":{"type":["string","null"]},"companyName":{"type":"string"},"retentionMonths":{"anyOf":[{"type":"number","const":3},{"type":"number","const":6},{"type":"number","const":12},{"type":"number","const":24}]}},"required":["enabled","slug","url","colour","headline","about","perks","coverUrl","photos","speculative","autoReply","privacy","logoUrl","companyName","retentionMonths"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/careers/images/{id}":{"get":{"operationId":"recruitment.careersImage","summary":"An image on the careers page (logo, cover, a photo), for the preview","tags":["Recruitment"],"x-permission":"recruit.view","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9-]{1,60}$"}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/applicants/{id}/interviews":{"post":{"operationId":"recruitment.bookInterview","summary":"Book an interview: a booking on the interviewer's schedule (internal, never invoiced), and the invite emailed with a calendar file","tags":["Recruitment"],"x-permission":["recruit.manage","booking.manage"],"x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"start":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"end":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"teamMemberId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"place":{"default":"office","type":"string","enum":["office","other","phone","video"]},"placeText":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"email":{"default":true,"type":"boolean"}},"required":["date","start","end","teamMemberId"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"area":{"type":["string","null"]},"stage":{"type":"string","enum":["new","screening","interview","onboarding","on_trial","hired","rejected","withdrawn"]},"source":{"type":"string","enum":["careers","email","manual"]},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false}},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedName":{"type":["string","null"]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"type":["string","null"]},"overdue":{"type":"boolean"},"goneQuiet":{"type":"boolean"},"unread":{"type":"boolean"},"files":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daysInStage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastActivityAt":{"type":"string"},"lastActivity":{"type":["string","null"]},"createdAt":{"type":"string"},"availability":{"type":["string","null"]},"rightToWork":{"type":["boolean","null"]},"message":{"type":["string","null"]},"jobsAddress":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","applied","email_in","email_out","note","call","stage","file","assigned","interview","onboarding","trial","retention"]},"subject":{"type":["string","null"]},"body":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"toAddress":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","filename","contentType","bytes","url"],"additionalProperties":false}},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["queued","sent","not_sent","delivered","bounced","complained","failed"]},"detail":{"type":["string","null"]}},"required":["status","detail"],"additionalProperties":false},{"type":"null"}]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","subject","body","fromAddress","toAddress","attachments","meta","delivery","userName","createdAt"],"additionalProperties":false}},"interviews":{"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"interviewerName":{"type":["string","null"]},"place":{"type":"string","enum":["office","other","phone","video"]},"placeText":{"type":["string","null"]},"where":{"type":"string"},"status":{"type":"string"},"past":{"type":"boolean"}},"required":["bookingId","date","start","end","teamMemberId","interviewerName","place","placeText","where","status","past"],"additionalProperties":false}},"interviewScore":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"onboarding":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["open","submitted","approved"]},"expiresAt":{"type":"string"},"expired":{"type":"boolean"},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roleTitle":{"type":["string","null"]},"link":{"type":"string"},"steps":{"type":"object","propertyNames":{"type":"string","enum":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"additionalProperties":{"type":"boolean"},"required":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"submittedAt":{"type":["string","null"]},"approvedAt":{"type":["string","null"]}},"required":["status","expiresAt","expired","startDate","roleTitle","link","steps","submittedAt","approvedAt"],"additionalProperties":false},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"onTrial":{"type":"boolean"},"deleteOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptReason":{"type":["string","null"]}},"required":["id","name","email","phone","area","stage","source","roles","assignedUserId","assignedName","nextActionOn","nextAction","overdue","goneQuiet","unread","files","daysInStage","lastActivityAt","lastActivity","createdAt","availability","rightToWork","message","jobsAddress","events","interviews","interviewScore","onboarding","teamMemberId","onTrial","deleteOn","keptUntil","keptReason"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/applicants/{id}/interview-notes":{"post":{"operationId":"recruitment.interviewNotes","summary":"Notes from an interview, with a score from 1 to 5 if given","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":10000},"score":{"anyOf":[{"type":"integer","minimum":1,"maximum":5},{"type":"null"}]}},"required":["body"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"area":{"type":["string","null"]},"stage":{"type":"string","enum":["new","screening","interview","onboarding","on_trial","hired","rejected","withdrawn"]},"source":{"type":"string","enum":["careers","email","manual"]},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false}},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedName":{"type":["string","null"]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"type":["string","null"]},"overdue":{"type":"boolean"},"goneQuiet":{"type":"boolean"},"unread":{"type":"boolean"},"files":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daysInStage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastActivityAt":{"type":"string"},"lastActivity":{"type":["string","null"]},"createdAt":{"type":"string"},"availability":{"type":["string","null"]},"rightToWork":{"type":["boolean","null"]},"message":{"type":["string","null"]},"jobsAddress":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","applied","email_in","email_out","note","call","stage","file","assigned","interview","onboarding","trial","retention"]},"subject":{"type":["string","null"]},"body":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"toAddress":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","filename","contentType","bytes","url"],"additionalProperties":false}},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["queued","sent","not_sent","delivered","bounced","complained","failed"]},"detail":{"type":["string","null"]}},"required":["status","detail"],"additionalProperties":false},{"type":"null"}]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","subject","body","fromAddress","toAddress","attachments","meta","delivery","userName","createdAt"],"additionalProperties":false}},"interviews":{"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"interviewerName":{"type":["string","null"]},"place":{"type":"string","enum":["office","other","phone","video"]},"placeText":{"type":["string","null"]},"where":{"type":"string"},"status":{"type":"string"},"past":{"type":"boolean"}},"required":["bookingId","date","start","end","teamMemberId","interviewerName","place","placeText","where","status","past"],"additionalProperties":false}},"interviewScore":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"onboarding":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["open","submitted","approved"]},"expiresAt":{"type":"string"},"expired":{"type":"boolean"},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roleTitle":{"type":["string","null"]},"link":{"type":"string"},"steps":{"type":"object","propertyNames":{"type":"string","enum":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"additionalProperties":{"type":"boolean"},"required":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"submittedAt":{"type":["string","null"]},"approvedAt":{"type":["string","null"]}},"required":["status","expiresAt","expired","startDate","roleTitle","link","steps","submittedAt","approvedAt"],"additionalProperties":false},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"onTrial":{"type":"boolean"},"deleteOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptReason":{"type":["string","null"]}},"required":["id","name","email","phone","area","stage","source","roles","assignedUserId","assignedName","nextActionOn","nextAction","overdue","goneQuiet","unread","files","daysInStage","lastActivityAt","lastActivity","createdAt","availability","rightToWork","message","jobsAddress","events","interviews","interviewScore","onboarding","teamMemberId","onTrial","deleteOn","keptUntil","keptReason"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/contracts":{"get":{"operationId":"recruitment.contractTemplates","summary":"Contract templates (the first one is made from Workscope's example the first time)","tags":["Recruitment"],"x-permission":"recruit.view","x-module":"recruitment","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"body":{"type":"string"},"archived":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","name","body","archived","createdAt"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"recruitment.createContractTemplate","summary":"Add a contract template","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"body":{"type":"string","minLength":1,"maxLength":50000},"archived":{"type":"boolean"}},"required":["name","body"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"body":{"type":"string"},"archived":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","name","body","archived","createdAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/contracts/{id}":{"patch":{"operationId":"recruitment.updateContractTemplate","summary":"Change or archive a contract template (contracts already sent keep their words)","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"body":{"type":"string","minLength":1,"maxLength":50000},"archived":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"body":{"type":"string"},"archived":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","name","body","archived","createdAt"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/applicants/{id}/onboarding":{"post":{"operationId":"recruitment.startOnboarding","summary":"Start onboarding: a private link for 14 days where they give their details and sign their contract (emailed unless email is false)","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"roleTitle":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"pay":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"hours":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"contractTemplateId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"email":{"default":true,"type":"boolean"}},"required":["startDate"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["open","submitted","approved"]},"expiresAt":{"type":"string"},"expired":{"type":"boolean"},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roleTitle":{"type":["string","null"]},"link":{"type":"string"},"steps":{"type":"object","propertyNames":{"type":"string","enum":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"additionalProperties":{"type":"boolean"},"required":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"submittedAt":{"type":["string","null"]},"approvedAt":{"type":["string","null"]},"pay":{"type":["string","null"]},"hours":{"type":["string","null"]},"contractTemplateName":{"type":["string","null"]},"details":{"type":"object","properties":{"name":{"type":["string","null"]},"surname":{"type":["string","null"]},"phone":{"type":["string","null"]},"address":{"type":["string","null"]},"dateOfBirth":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["name","surname","phone","address","dateOfBirth"],"additionalProperties":false},"niNumberMasked":{"type":["string","null"]},"bankMasked":{"type":["string","null"]},"emergency":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"relationship":{"type":["string","null"]},"phone":{"type":"string"}},"required":["name","relationship","phone"],"additionalProperties":false},{"type":"null"}]},"dbsNumber":{"type":["string","null"]},"files":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"kind":{"type":"string","enum":["right_to_work","dbs"]},"filename":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","kind","filename","bytes","url"],"additionalProperties":false}},"rightToWorkCheckedAt":{"type":["string","null"]},"rightToWorkCheckedBy":{"type":["string","null"]},"dbsCheckedAt":{"type":["string","null"]},"dbsCheckedBy":{"type":["string","null"]},"contract":{"type":"object","properties":{"text":{"type":["string","null"]},"signedName":{"type":["string","null"]},"signedAt":{"type":["string","null"]},"signedIp":{"type":["string","null"]},"hash":{"type":["string","null"]},"signatureUrl":{"type":["string","null"]}},"required":["text","signedName","signedAt","signedIp","hash","signatureUrl"],"additionalProperties":false},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["status","expiresAt","expired","startDate","roleTitle","link","steps","submittedAt","approvedAt","pay","hours","contractTemplateName","details","niNumberMasked","bankMasked","emergency","dbsNumber","files","rightToWorkCheckedAt","rightToWorkCheckedBy","dbsCheckedAt","dbsCheckedBy","contract","teamMemberId"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"get":{"operationId":"recruitment.onboarding","summary":"Their onboarding: the checklist, what they gave (NI and bank masked), files and the signed contract","tags":["Recruitment"],"x-permission":"recruit.view","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["open","submitted","approved"]},"expiresAt":{"type":"string"},"expired":{"type":"boolean"},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roleTitle":{"type":["string","null"]},"link":{"type":"string"},"steps":{"type":"object","propertyNames":{"type":"string","enum":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"additionalProperties":{"type":"boolean"},"required":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"submittedAt":{"type":["string","null"]},"approvedAt":{"type":["string","null"]},"pay":{"type":["string","null"]},"hours":{"type":["string","null"]},"contractTemplateName":{"type":["string","null"]},"details":{"type":"object","properties":{"name":{"type":["string","null"]},"surname":{"type":["string","null"]},"phone":{"type":["string","null"]},"address":{"type":["string","null"]},"dateOfBirth":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["name","surname","phone","address","dateOfBirth"],"additionalProperties":false},"niNumberMasked":{"type":["string","null"]},"bankMasked":{"type":["string","null"]},"emergency":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"relationship":{"type":["string","null"]},"phone":{"type":"string"}},"required":["name","relationship","phone"],"additionalProperties":false},{"type":"null"}]},"dbsNumber":{"type":["string","null"]},"files":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"kind":{"type":"string","enum":["right_to_work","dbs"]},"filename":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","kind","filename","bytes","url"],"additionalProperties":false}},"rightToWorkCheckedAt":{"type":["string","null"]},"rightToWorkCheckedBy":{"type":["string","null"]},"dbsCheckedAt":{"type":["string","null"]},"dbsCheckedBy":{"type":["string","null"]},"contract":{"type":"object","properties":{"text":{"type":["string","null"]},"signedName":{"type":["string","null"]},"signedAt":{"type":["string","null"]},"signedIp":{"type":["string","null"]},"hash":{"type":["string","null"]},"signatureUrl":{"type":["string","null"]}},"required":["text","signedName","signedAt","signedIp","hash","signatureUrl"],"additionalProperties":false},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["status","expiresAt","expired","startDate","roleTitle","link","steps","submittedAt","approvedAt","pay","hours","contractTemplateName","details","niNumberMasked","bankMasked","emergency","dbsNumber","files","rightToWorkCheckedAt","rightToWorkCheckedBy","dbsCheckedAt","dbsCheckedBy","contract","teamMemberId"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/applicants/{id}/onboarding/resend":{"post":{"operationId":"recruitment.resendOnboarding","summary":"Another 14 days on the onboarding link, and the email again","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["open","submitted","approved"]},"expiresAt":{"type":"string"},"expired":{"type":"boolean"},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roleTitle":{"type":["string","null"]},"link":{"type":"string"},"steps":{"type":"object","propertyNames":{"type":"string","enum":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"additionalProperties":{"type":"boolean"},"required":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"submittedAt":{"type":["string","null"]},"approvedAt":{"type":["string","null"]},"pay":{"type":["string","null"]},"hours":{"type":["string","null"]},"contractTemplateName":{"type":["string","null"]},"details":{"type":"object","properties":{"name":{"type":["string","null"]},"surname":{"type":["string","null"]},"phone":{"type":["string","null"]},"address":{"type":["string","null"]},"dateOfBirth":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["name","surname","phone","address","dateOfBirth"],"additionalProperties":false},"niNumberMasked":{"type":["string","null"]},"bankMasked":{"type":["string","null"]},"emergency":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"relationship":{"type":["string","null"]},"phone":{"type":"string"}},"required":["name","relationship","phone"],"additionalProperties":false},{"type":"null"}]},"dbsNumber":{"type":["string","null"]},"files":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"kind":{"type":"string","enum":["right_to_work","dbs"]},"filename":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","kind","filename","bytes","url"],"additionalProperties":false}},"rightToWorkCheckedAt":{"type":["string","null"]},"rightToWorkCheckedBy":{"type":["string","null"]},"dbsCheckedAt":{"type":["string","null"]},"dbsCheckedBy":{"type":["string","null"]},"contract":{"type":"object","properties":{"text":{"type":["string","null"]},"signedName":{"type":["string","null"]},"signedAt":{"type":["string","null"]},"signedIp":{"type":["string","null"]},"hash":{"type":["string","null"]},"signatureUrl":{"type":["string","null"]}},"required":["text","signedName","signedAt","signedIp","hash","signatureUrl"],"additionalProperties":false},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["status","expiresAt","expired","startDate","roleTitle","link","steps","submittedAt","approvedAt","pay","hours","contractTemplateName","details","niNumberMasked","bankMasked","emergency","dbsNumber","files","rightToWorkCheckedAt","rightToWorkCheckedBy","dbsCheckedAt","dbsCheckedBy","contract","teamMemberId"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/applicants/{id}/onboarding/checks":{"post":{"operationId":"recruitment.onboardingChecks","summary":"Tick (or untick) that their right to work and DBS were checked","tags":["Recruitment"],"x-permission":"recruit.manage","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"rightToWork":{"type":"boolean"},"dbs":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["open","submitted","approved"]},"expiresAt":{"type":"string"},"expired":{"type":"boolean"},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roleTitle":{"type":["string","null"]},"link":{"type":"string"},"steps":{"type":"object","propertyNames":{"type":"string","enum":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"additionalProperties":{"type":"boolean"},"required":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"submittedAt":{"type":["string","null"]},"approvedAt":{"type":["string","null"]},"pay":{"type":["string","null"]},"hours":{"type":["string","null"]},"contractTemplateName":{"type":["string","null"]},"details":{"type":"object","properties":{"name":{"type":["string","null"]},"surname":{"type":["string","null"]},"phone":{"type":["string","null"]},"address":{"type":["string","null"]},"dateOfBirth":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["name","surname","phone","address","dateOfBirth"],"additionalProperties":false},"niNumberMasked":{"type":["string","null"]},"bankMasked":{"type":["string","null"]},"emergency":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"relationship":{"type":["string","null"]},"phone":{"type":"string"}},"required":["name","relationship","phone"],"additionalProperties":false},{"type":"null"}]},"dbsNumber":{"type":["string","null"]},"files":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"kind":{"type":"string","enum":["right_to_work","dbs"]},"filename":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","kind","filename","bytes","url"],"additionalProperties":false}},"rightToWorkCheckedAt":{"type":["string","null"]},"rightToWorkCheckedBy":{"type":["string","null"]},"dbsCheckedAt":{"type":["string","null"]},"dbsCheckedBy":{"type":["string","null"]},"contract":{"type":"object","properties":{"text":{"type":["string","null"]},"signedName":{"type":["string","null"]},"signedAt":{"type":["string","null"]},"signedIp":{"type":["string","null"]},"hash":{"type":["string","null"]},"signatureUrl":{"type":["string","null"]}},"required":["text","signedName","signedAt","signedIp","hash","signatureUrl"],"additionalProperties":false},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["status","expiresAt","expired","startDate","roleTitle","link","steps","submittedAt","approvedAt","pay","hours","contractTemplateName","details","niNumberMasked","bankMasked","emergency","dbsNumber","files","rightToWorkCheckedAt","rightToWorkCheckedBy","dbsCheckedAt","dbsCheckedBy","contract","teamMemberId"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/applicants/{id}/onboarding/files/{index}":{"get":{"operationId":"recruitment.onboardingFile","summary":"A document they uploaded (right to work, DBS)","tags":["Recruitment"],"x-permission":"recruit.view","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"index","in":"path","required":true,"schema":{"type":"integer","minimum":0,"maximum":50}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/applicants/{id}/onboarding/signature":{"get":{"operationId":"recruitment.onboardingSignature","summary":"The signature their contract was signed with","tags":["Recruitment"],"x-permission":"recruit.view","x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"The file","content":{"image/jpeg":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/applicants/{id}/onboarding/approve":{"post":{"operationId":"recruitment.approveOnboarding","summary":"Make them a team member On trial from what they gave (nothing typed again), with their documents, an app invite and a welcome email","tags":["Recruitment"],"x-permission":["recruit.manage","team.manage"],"x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"invite":{"default":true,"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"area":{"type":["string","null"]},"stage":{"type":"string","enum":["new","screening","interview","onboarding","on_trial","hired","rejected","withdrawn"]},"source":{"type":"string","enum":["careers","email","manual"]},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false}},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedName":{"type":["string","null"]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"type":["string","null"]},"overdue":{"type":"boolean"},"goneQuiet":{"type":"boolean"},"unread":{"type":"boolean"},"files":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daysInStage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastActivityAt":{"type":"string"},"lastActivity":{"type":["string","null"]},"createdAt":{"type":"string"},"availability":{"type":["string","null"]},"rightToWork":{"type":["boolean","null"]},"message":{"type":["string","null"]},"jobsAddress":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","applied","email_in","email_out","note","call","stage","file","assigned","interview","onboarding","trial","retention"]},"subject":{"type":["string","null"]},"body":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"toAddress":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","filename","contentType","bytes","url"],"additionalProperties":false}},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["queued","sent","not_sent","delivered","bounced","complained","failed"]},"detail":{"type":["string","null"]}},"required":["status","detail"],"additionalProperties":false},{"type":"null"}]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","subject","body","fromAddress","toAddress","attachments","meta","delivery","userName","createdAt"],"additionalProperties":false}},"interviews":{"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"interviewerName":{"type":["string","null"]},"place":{"type":"string","enum":["office","other","phone","video"]},"placeText":{"type":["string","null"]},"where":{"type":"string"},"status":{"type":"string"},"past":{"type":"boolean"}},"required":["bookingId","date","start","end","teamMemberId","interviewerName","place","placeText","where","status","past"],"additionalProperties":false}},"interviewScore":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"onboarding":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["open","submitted","approved"]},"expiresAt":{"type":"string"},"expired":{"type":"boolean"},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roleTitle":{"type":["string","null"]},"link":{"type":"string"},"steps":{"type":"object","propertyNames":{"type":"string","enum":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"additionalProperties":{"type":"boolean"},"required":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"submittedAt":{"type":["string","null"]},"approvedAt":{"type":["string","null"]}},"required":["status","expiresAt","expired","startDate","roleTitle","link","steps","submittedAt","approvedAt"],"additionalProperties":false},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"onTrial":{"type":"boolean"},"deleteOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptReason":{"type":["string","null"]}},"required":["id","name","email","phone","area","stage","source","roles","assignedUserId","assignedName","nextActionOn","nextAction","overdue","goneQuiet","unread","files","daysInStage","lastActivityAt","lastActivity","createdAt","availability","rightToWork","message","jobsAddress","events","interviews","interviewScore","onboarding","teamMemberId","onTrial","deleteOn","keptUntil","keptReason"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/recruitment/applicants/{id}/trial":{"post":{"operationId":"recruitment.trial","summary":"The end of the trial: keep them on (Hired), or it didn't work out (employment ends, future bookings go to nobody, the login stops)","tags":["Recruitment"],"x-permission":["recruit.manage","team.manage"],"x-module":"recruitment","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"outcome":{"type":"string","enum":["keep","end"]},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["outcome"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"area":{"type":["string","null"]},"stage":{"type":"string","enum":["new","screening","interview","onboarding","on_trial","hired","rejected","withdrawn"]},"source":{"type":"string","enum":["careers","email","manual"]},"roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"}},"required":["id","title"],"additionalProperties":false}},"assignedUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"assignedName":{"type":["string","null"]},"nextActionOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"nextAction":{"type":["string","null"]},"overdue":{"type":"boolean"},"goneQuiet":{"type":"boolean"},"unread":{"type":"boolean"},"files":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"daysInStage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastActivityAt":{"type":"string"},"lastActivity":{"type":["string","null"]},"createdAt":{"type":"string"},"availability":{"type":["string","null"]},"rightToWork":{"type":["boolean","null"]},"message":{"type":["string","null"]},"jobsAddress":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"kind":{"type":"string","enum":["created","applied","email_in","email_out","note","call","stage","file","assigned","interview","onboarding","trial","retention"]},"subject":{"type":["string","null"]},"body":{"type":["string","null"]},"fromAddress":{"type":["string","null"]},"toAddress":{"type":["string","null"]},"attachments":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"filename":{"type":"string"},"contentType":{"type":"string"},"bytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string"}},"required":["index","filename","contentType","bytes","url"],"additionalProperties":false}},"meta":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"delivery":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["queued","sent","not_sent","delivered","bounced","complained","failed"]},"detail":{"type":["string","null"]}},"required":["status","detail"],"additionalProperties":false},{"type":"null"}]},"userName":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","subject","body","fromAddress","toAddress","attachments","meta","delivery","userName","createdAt"],"additionalProperties":false}},"interviews":{"type":"array","items":{"type":"object","properties":{"bookingId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"start":{"type":["string","null"]},"end":{"type":["string","null"]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"interviewerName":{"type":["string","null"]},"place":{"type":"string","enum":["office","other","phone","video"]},"placeText":{"type":["string","null"]},"where":{"type":"string"},"status":{"type":"string"},"past":{"type":"boolean"}},"required":["bookingId","date","start","end","teamMemberId","interviewerName","place","placeText","where","status","past"],"additionalProperties":false}},"interviewScore":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"onboarding":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["open","submitted","approved"]},"expiresAt":{"type":"string"},"expired":{"type":"boolean"},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roleTitle":{"type":["string","null"]},"link":{"type":"string"},"steps":{"type":"object","propertyNames":{"type":"string","enum":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"additionalProperties":{"type":"boolean"},"required":["details","ni","bank","emergency","right_to_work","dbs","contract"]},"submittedAt":{"type":["string","null"]},"approvedAt":{"type":["string","null"]}},"required":["status","expiresAt","expired","startDate","roleTitle","link","steps","submittedAt","approvedAt"],"additionalProperties":false},{"type":"null"}]},"teamMemberId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"onTrial":{"type":"boolean"},"deleteOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptUntil":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"keptReason":{"type":["string","null"]}},"required":["id","name","email","phone","area","stage","source","roles","assignedUserId","assignedName","nextActionOn","nextAction","overdue","goneQuiet","unread","files","daysInStage","lastActivityAt","lastActivity","createdAt","availability","rightToWork","message","jobsAddress","events","interviews","interviewScore","onboarding","teamMemberId","onTrial","deleteOn","keptUntil","keptReason"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/webhook-endpoints/events":{"get":{"operationId":"webhookEndpoints.events","summary":"Every event Workscope can send, what it means and what its data is","tags":["Webhooks"],"x-permission":"users.manage","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"event":{"type":"string"},"group":{"type":"string","enum":["work","team","money","sales","clients"]},"description":{"type":"string"},"data":{"type":"string"}},"required":["event","group","description","data"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/webhook-endpoints":{"get":{"operationId":"webhookEndpoints.list","summary":"The company's webhook endpoints, each with its latest delivery (never the secrets)","tags":["Webhooks"],"x-permission":"users.manage","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"url":{"type":"string"},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"disabledReason":{"type":["string","null"]},"createdByName":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"lastDelivery":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"event":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed"]},"statusCode":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["at","event","status","statusCode"],"additionalProperties":false},{"type":"null"}]}},"required":["id","url","description","events","enabled","disabledReason","createdByName","createdAt","lastDelivery"],"additionalProperties":false}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"post":{"operationId":"webhookEndpoints.create","summary":"Add an endpoint. The answer is the only time its signing secret is shown.","tags":["Webhooks"],"x-permission":"users.manage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","maxLength":2000},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"events":{"minItems":1,"type":"array","items":{"anyOf":[{"type":"string","enum":["booking.created","booking.updated","booking.status_changed","booking.deleted","timesheet.submitted","absence.approved","absence.cancelled","invoice.issued","invoice.paid","quote.accepted","enquiry.received","client.created","client.updated"]},{"type":"string","const":"*"}]}}},"required":["url","events"]}}}},"responses":{"201":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"url":{"type":"string"},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"disabledReason":{"type":["string","null"]},"createdByName":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"lastDelivery":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"event":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed"]},"statusCode":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["at","event","status","statusCode"],"additionalProperties":false},{"type":"null"}]},"secret":{"type":"string"}},"required":["id","url","description","events","enabled","disabledReason","createdByName","createdAt","lastDelivery","secret"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/webhook-endpoints/{id}":{"patch":{"operationId":"webhookEndpoints.update","summary":"Change its address, description or events, or switch it off and on (on again clears the failures)","tags":["Webhooks"],"x-permission":"users.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"url":{"type":"string","maxLength":2000},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"events":{"minItems":1,"type":"array","items":{"anyOf":[{"type":"string","enum":["booking.created","booking.updated","booking.status_changed","booking.deleted","timesheet.submitted","absence.approved","absence.cancelled","invoice.issued","invoice.paid","quote.accepted","enquiry.received","client.created","client.updated"]},{"type":"string","const":"*"}]}},"enabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"url":{"type":"string"},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"disabledReason":{"type":["string","null"]},"createdByName":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"lastDelivery":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"event":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed"]},"statusCode":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["at","event","status","statusCode"],"additionalProperties":false},{"type":"null"}]}},"required":["id","url","description","events","enabled","disabledReason","createdByName","createdAt","lastDelivery"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}},"delete":{"operationId":"webhookEndpoints.remove","summary":"Delete an endpoint and its delivery log","tags":["Webhooks"],"x-permission":"users.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"204":{"description":"No content"},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/webhook-endpoints/{id}/rotate-secret":{"post":{"operationId":"webhookEndpoints.rotateSecret","summary":"Give it a new signing secret (shown once); the old one stops at once","tags":["Webhooks"],"x-permission":"users.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"url":{"type":"string"},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"disabledReason":{"type":["string","null"]},"createdByName":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"lastDelivery":{"anyOf":[{"type":"object","properties":{"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"event":{"type":"string"},"status":{"type":"string","enum":["pending","delivered","failed"]},"statusCode":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["at","event","status","statusCode"],"additionalProperties":false},{"type":"null"}]},"secret":{"type":"string"}},"required":["id","url","description","events","enabled","disabledReason","createdByName","createdAt","lastDelivery","secret"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/webhook-endpoints/{id}/test":{"post":{"operationId":"webhookEndpoints.test","summary":"Send a 'ping' event now, to check the endpoint works; answers with the delivery","tags":["Webhooks"],"x-permission":"users.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"event":{"type":"string"},"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["pending","delivered","failed"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"nextAttemptAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"statusCode":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":["string","null"]},"responseMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deliveredAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"payload":{}},"required":["id","event","eventId","status","attempts","nextAttemptAt","statusCode","error","responseMs","createdAt","deliveredAt","payload"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/webhook-endpoints/{id}/deliveries":{"get":{"operationId":"webhookEndpoints.deliveries","summary":"What was sent to it, newest first (kept 30 days)","tags":["Webhooks"],"x-permission":"users.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"before","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"limit","in":"query","required":false,"schema":{"default":25,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"event":{"type":"string"},"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["pending","delivered","failed"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"nextAttemptAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"statusCode":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":["string","null"]},"responseMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deliveredAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"payload":{}},"required":["id","event","eventId","status","attempts","nextAttemptAt","statusCode","error","responseMs","createdAt","deliveredAt","payload"],"additionalProperties":false}},"more":{"type":"boolean"}},"required":["items","more"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/webhook-endpoints/{id}/deliveries/{deliveryId}/redeliver":{"post":{"operationId":"webhookEndpoints.redeliver","summary":"Send a delivery again now (the same event id, so a receiver can tell it is a repeat)","tags":["Webhooks"],"x-permission":"users.manage","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"deliveryId","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"event":{"type":"string"},"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["pending","delivered","failed"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"nextAttemptAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"statusCode":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"error":{"type":["string","null"]},"responseMs":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"deliveredAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"payload":{}},"required":["id","event","eventId","status","attempts","nextAttemptAt","statusCode","error","responseMs","createdAt","deliveredAt","payload"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/api-keys/current":{"get":{"operationId":"apiKeyInfo.current","summary":"The key making this request, and the company it works for (a good first call to check a key works)","tags":["API keys"],"parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"key":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","admin"]},"readOnly":{"type":"boolean"},"hiddenModules":{"type":"array","items":{"type":"string","enum":["projects","issues","invoicing","holiday","timesheets","quotes","purchases","payroll","recruitment"]}},"prefix":{"type":"string"},"createdByName":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"lastUsedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"lastUsedIp":{"type":["string","null"]},"revokedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]}},"required":["id","name","role","readOnly","hiddenModules","prefix","createdByName","createdAt","lastUsedAt","lastUsedIp","revokedAt"],"additionalProperties":false},"organization":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"timeZone":{"type":"string"},"modules":{"type":"array","items":{"type":"string","enum":["projects","issues","invoicing","holiday","timesheets","quotes","purchases","payroll","recruitment"]}}},"required":["id","name","timeZone","modules"],"additionalProperties":false}},"required":["key","organization"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/xota-sync":{"get":{"operationId":"xotaSync.get","summary":"How the live sync from Xota is doing, and the differences left to decide","tags":["Organisation"],"x-permission":"organization.update","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"setUp":{"type":"boolean"},"enabled":{"type":"boolean"},"xotaOrganizationId":{"type":["string","null"]},"enabledAt":{"type":["string","null"]},"lastRunAt":{"type":["string","null"]},"lastOkAt":{"type":["string","null"]},"lastError":{"type":["string","null"]},"lastCounts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"created":{"type":"number"},"updated":{"type":"number"},"unchanged":{"type":"number"},"conflicts":{"type":"number"},"failed":{"type":"number"},"skipped":{"type":"number"}},"required":["created","updated","unchanged","conflicts","failed","skipped"],"additionalProperties":false}},"openConflicts":{"type":"number"},"conflicts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":["string","null"]},"table":{"type":"string"},"field":{"type":"string"},"workscopeValue":{},"xotaValue":{},"seenAt":{"type":"string"}},"required":["id","label","table","field","workscopeValue","xotaValue","seenAt"],"additionalProperties":false}}},"required":["setUp","enabled","xotaOrganizationId","enabledAt","lastRunAt","lastOkAt","lastError","lastCounts","openConflicts","conflicts"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}},"/v1/xota-sync/conflicts/{id}/resolve":{"post":{"operationId":"xotaSync.resolve","summary":"Decide a difference: take Xota's value, or keep Workscope's","tags":["Organisation"],"x-permission":"organization.update","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"choice":{"type":"string","enum":["xota","workscope"]}},"required":["choice"]}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"setUp":{"type":"boolean"},"enabled":{"type":"boolean"},"xotaOrganizationId":{"type":["string","null"]},"enabledAt":{"type":["string","null"]},"lastRunAt":{"type":["string","null"]},"lastOkAt":{"type":["string","null"]},"lastError":{"type":["string","null"]},"lastCounts":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"created":{"type":"number"},"updated":{"type":"number"},"unchanged":{"type":"number"},"conflicts":{"type":"number"},"failed":{"type":"number"},"skipped":{"type":"number"}},"required":["created","updated","unchanged","conflicts","failed","skipped"],"additionalProperties":false}},"openConflicts":{"type":"number"},"conflicts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":["string","null"]},"table":{"type":"string"},"field":{"type":"string"},"workscopeValue":{},"xotaValue":{},"seenAt":{"type":"string"}},"required":["id","label","table","field","workscopeValue","xotaValue","seenAt"],"additionalProperties":false}}},"required":["setUp","enabled","xotaOrganizationId","enabledAt","lastRunAt","lastOkAt","lastError","lastCounts","openConflicts","conflicts"],"additionalProperties":false}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["error"],"additionalProperties":false}}}}}}}}}