{"openapi":"3.1.0","info":{"title":"The Lab platform API","version":"1","description":"People, their app access, their activity and their waivers, from the CRM. Tokens come from the platform’s OpenID Connect provider: register an app in CRM settings → Apps, then use the authorization code flow (for a person) or client credentials (server to server) with resource=https://api.thelabtraining.com/v1."},"servers":[{"url":"https://api.thelabtraining.com/v1"}],"security":[{"platform":[]}],"paths":{"/me":{"get":{"summary":"Who the token is for","description":"Only for a person’s token. Their CRM person, the athletes they look after, and their app access.","responses":{"200":{"description":"The signed-in person.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"description":"No token, or it isn’t valid any more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token is missing a scope this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/people":{"get":{"summary":"People the app can see: a changes feed, or a search","description":"Needs people:read, with an app’s own token (client credentials). An app limited to some businesses sees only people tied to them: on one of their teams, signed up for one, or a parent of someone who is. Without q, a changes feed: everyone in view, oldest change first, including people merged into someone else (merged_into_id) and archived people, so a copy can repoint or retire its links. Follow next_cursor until it’s null; next time, pass updated_since a minute or so before the latest updated_at you saw. A change to a person’s contacts, consent, parents, teams or signups counts as a change to them. With q, a search by name, email or phone among current people (not merged or archived), sorted by name, one page only.","security":[{"platform":["people:read"]}],"parameters":[{"name":"business","in":"query","schema":{"type":"string","example":"tpa,365"},"description":"Only people tied to these businesses (tpa, 365, vbl, lab, recruiting), comma-separated. Must be ones the app may see. Leave out for all of them."},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only people changed at or after this time."},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"The next_cursor from the page before."},{"name":"q","in":"query","schema":{"type":"string","minLength":2,"maxLength":100},"description":"A name, or part of one, an email or a phone number."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500,"default":100}}],"responses":{"200":{"description":"A page of people.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeoplePage"}}}},"400":{"description":"A query parameter isn’t valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or it isn’t valid any more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token is missing people:read, isn’t an app’s own, or asked for a business the app can’t see.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/people/{id}":{"get":{"summary":"A person, with contacts and family","description":"Needs people:read. A person’s token only sees their own family, unless they’re CRM staff. An app limited to some businesses only sees their people, and only their people among a person’s parents and athletes. A merged-away id gives the person it became.","security":[{"platform":["people:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The person.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Person"}}}},"401":{"description":"No token, or it isn’t valid any more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token is missing a scope this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such person, or the token can’t see them.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/people/{id}/access":{"get":{"summary":"Which apps a person can use","description":"Needs access:read.","security":[{"platform":["access:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Their app access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Access"}}}},"401":{"description":"No token, or it isn’t valid any more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token is missing a scope this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such person, or the token can’t see them.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/activity":{"post":{"summary":"Add to a person’s activity in the CRM","description":"Needs activity:write. Recorded under the app’s name; the CRM’s Activity page shows the summary.","security":[{"platform":["activity:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewActivity"}}}},"responses":{"201":{"description":"Recorded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Activity"}}}},"400":{"description":"The body isn’t valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or it isn’t valid any more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token is missing a scope this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such person, or the token can’t see them.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/people/{id}/waivers":{"get":{"summary":"Where a person stands on each waiver","description":"Needs waivers:read. Every waiver the caller can see (not archived), with the person’s status: signed (the current words, not run out), outdated (they signed older words), expired, or unsigned (none, or only voided ones), and the signature it rests on. Signatures made under a duplicate later merged into them count.","security":[{"platform":["waivers:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Their waivers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonWaivers"}}}},"401":{"description":"No token, or it isn’t valid any more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token is missing a scope this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such person, or the token can’t see them.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Sign a waiver for a person","description":"Needs waivers:write. An app’s own token records a signature it took, with the signer in the body. A person’s token signs as that person, now: for themselves (signer self) or for a kid they’re a parent of (signer parent or guardian). Someone under 18 by their date of birth can’t sign for themselves. version must be the current one, so nobody agrees to words they weren’t shown: otherwise 409 waiver_changed.","security":[{"platform":["waivers:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewSignature"}}}},"responses":{"201":{"description":"Signed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Signature"}}}},"400":{"description":"The body isn’t valid, or the signer can’t sign for this person. The description says why.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or it isn’t valid any more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token is missing a scope this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such person or waiver, or the token can’t see them.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"waiver_changed: the words changed since the signer saw them. waiver_archived: it isn’t asked for any more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/waivers":{"get":{"summary":"The waivers the caller can see","description":"Needs waivers:read. An app limited to some businesses sees only theirs. Sorted by business and title.","security":[{"platform":["waivers:read"]}],"parameters":[{"name":"include_archived","in":"query","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"The waivers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaiverList"}}}},"401":{"description":"No token, or it isn’t valid any more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token is missing a scope this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Add a waiver","description":"Needs waivers:write, with an app’s own token. For one of the app’s businesses. Its words become version 1.","security":[{"platform":["waivers:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewWaiver"}}}},"responses":{"201":{"description":"Added.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaiverDetail"}}}},"400":{"description":"The body isn’t valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or it isn’t valid any more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token is missing waivers:write, isn’t an app’s own, or the business isn’t one the app can see.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/waivers/{id}":{"get":{"summary":"A waiver, with its current words and every version","description":"Needs waivers:read.","security":[{"platform":["waivers:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The waiver.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaiverDetail"}}}},"401":{"description":"No token, or it isn’t valid any more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token is missing a scope this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such waiver, or the token can’t see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Change how long signatures last, or archive a waiver","description":"Needs waivers:write, with an app’s own token. valid_for_days applies to signatures from now on. An archived waiver can’t be signed and drops out of lists; its signatures stay. New words are a new version (POST /waivers/{id}/versions).","security":[{"platform":["waivers:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaiverSettings"}}}},"responses":{"200":{"description":"The waiver, changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaiverDetail"}}}},"400":{"description":"The body isn’t valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or it isn’t valid any more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token is missing waivers:write, or isn’t an app’s own.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such waiver, or the token can’t see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/waivers/{id}/versions":{"post":{"summary":"New words for a waiver","description":"Needs waivers:write, with an app’s own token. Publishes the next version (and a new title, if given). Signatures on earlier versions are kept and show as outdated, so the app can ask for them again.","security":[{"platform":["waivers:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewWaiverVersion"}}}},"responses":{"201":{"description":"Published.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaiverDetail"}}}},"400":{"description":"The body isn’t valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or it isn’t valid any more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token is missing waivers:write, or isn’t an app’s own.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such waiver, or the token can’t see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"waiver_archived: restore it first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/waivers/{id}/signatures":{"get":{"summary":"A waiver’s signatures, as a changes feed","description":"Needs waivers:read, with an app’s own token. Signatures of people the app can see, oldest change first, a page at a time, like GET /people: follow next_cursor until it’s null, and next time pass updated_since a minute or so before the latest updated_at you saw. A voided signature comes again with voided_at set. person_id is who the person is now, past any merge.","security":[{"platform":["waivers:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"The next_cursor from the page before."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":500,"default":100}}],"responses":{"200":{"description":"A page of signatures.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignaturePage"}}}},"400":{"description":"A query parameter isn’t valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or it isn’t valid any more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token is missing waivers:read, or isn’t an app’s own.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such waiver, or the token can’t see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/waiver-signatures/{id}":{"get":{"summary":"A signature as evidence","description":"Needs waivers:read. With the exact words signed, the drawn signature if there was one, and the signer’s address and browser.","security":[{"platform":["waivers:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The signature.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignatureDetail"}}}},"401":{"description":"No token, or it isn’t valid any more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token is missing a scope this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such signature, or the token can’t see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/waiver-signatures/{id}/void":{"post":{"summary":"Void a signature","description":"Needs waivers:write, with an app’s own token. For a signature that shouldn’t count (signed for the wrong player, say). It’s kept, with the reason; voiding it again keeps the first reason.","security":[{"platform":["waivers:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoidSignature"}}}},"responses":{"200":{"description":"Voided.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Signature"}}}},"400":{"description":"The body isn’t valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or it isn’t valid any more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token is missing waivers:write, or isn’t an app’s own.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such signature, or the token can’t see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/signups":{"post":{"summary":"Record a website request or booking as a signup, or a member’s booking","description":"Needs signups:write, with an app’s own token (client credentials). Finds the person by Glofox member id, or adds them; keeps their email and mobile; sets their signup for the program (requested and started leave it new, paid enrolls it); and adds the step to their activity. A person’s first signup for a program alerts staff. Someone already a member (they or a kid on their Glofox account hold a membership) gets a booking instead of a signup: started is a checkout to follow up on until paid.","security":[{"platform":["signups:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewSignup"}}}},"responses":{"201":{"description":"Recorded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Signup"}}}},"400":{"description":"The body isn’t valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"No token, or it isn’t valid any more.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token is missing a scope this needs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The Glofox branch isn’t the CRM’s.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many requests.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"platform":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://hub.thelabtraining.com/oidc/auth","tokenUrl":"https://hub.thelabtraining.com/oidc/token","scopes":{"people:read":"See people in the CRM, with their contacts and family","access:read":"See which of our apps people can use","activity:write":"Add to the CRM’s activity log","signups:write":"Add website requests and bookings to the CRM’s signups","waivers:read":"See waivers and who has signed them","waivers:write":"Add and change waivers, and record and void signatures"}},"clientCredentials":{"tokenUrl":"https://hub.thelabtraining.com/oidc/token","scopes":{"people:read":"See people in the CRM, with their contacts and family","access:read":"See which of our apps people can use","activity:write":"Add to the CRM’s activity log","signups:write":"Add website requests and bookings to the CRM’s signups","waivers:read":"See waivers and who has signed them","waivers:write":"Add and change waivers, and record and void signatures"}}}}},"schemas":{"Error":{"type":"object","required":["error","error_description"],"properties":{"error":{"type":"string"},"error_description":{"type":"string"}}},"Named":{"type":"object","required":["id","first_name","last_name"],"properties":{"id":{"type":"string","format":"uuid"},"first_name":{"type":"string"},"last_name":{"type":"string"}}},"Person":{"type":"object","required":["id","first_name","last_name","kind","date_of_birth","archived","contacts","parents","athletes"],"properties":{"id":{"type":"string","format":"uuid"},"first_name":{"type":"string"},"last_name":{"type":"string"},"kind":{"type":"string","enum":["athlete","guardian","adult"]},"date_of_birth":{"type":["string","null"],"format":"date"},"archived":{"type":"boolean"},"contacts":{"type":"array","items":{"type":"object","required":["channel","value","sms_consent","suppressed"],"properties":{"channel":{"type":"string","enum":["email","sms"],"description":"sms is a mobile number."},"value":{"type":"string","description":"A lowercase email, or a phone as +1XXXXXXXXXX."},"sms_consent":{"type":["string","null"],"enum":["unknown","opted_in","opted_out",null],"description":"For a mobile: only opted_in numbers may be texted. Null for an email."},"suppressed":{"type":"boolean","description":"The address opted out or hard-failed. Send it nothing."}}}},"parents":{"type":"array","items":{"$ref":"#/components/schemas/Named"}},"athletes":{"type":"array","items":{"$ref":"#/components/schemas/Named"}}}},"DirectoryPerson":{"allOf":[{"$ref":"#/components/schemas/Person"},{"type":"object","required":["merged_into_id","businesses","updated_at"],"properties":{"merged_into_id":{"type":["string","null"],"format":"uuid","description":"Set when this person was merged into another: repoint links to that id and ignore the rest."},"businesses":{"type":"array","items":{"type":"string","enum":["tpa","365","lab","recruiting","vbl"]},"description":"The businesses in view they’re tied to."},"updated_at":{"type":"string","format":"date-time"}}}]},"PeoplePage":{"type":"object","required":["people","next_cursor"],"properties":{"people":{"type":"array","items":{"$ref":"#/components/schemas/DirectoryPerson"}},"next_cursor":{"type":["string","null"],"description":"Pass as cursor for the next page. Null on the last page, and always for a search."}}},"Me":{"type":"object","required":["user_id","email","name","person","athletes","app_access"],"properties":{"user_id":{"type":"string","format":"uuid"},"email":{"type":["string","null"]},"name":{"type":["string","null"]},"person":{"oneOf":[{"$ref":"#/components/schemas/Person"},{"type":"null"}]},"athletes":{"type":"array","items":{"$ref":"#/components/schemas/Named"}},"app_access":{"type":"object","additionalProperties":{"type":"string"},"description":"App key → role."}}},"Access":{"type":"object","required":["person_id","apps"],"properties":{"person_id":{"type":"string","format":"uuid"},"apps":{"type":"array","items":{"type":"object","required":["app","role","status","since"],"properties":{"app":{"type":"string"},"role":{"type":"string"},"status":{"type":"string","enum":["invited","active","disabled"]},"since":{"type":["string","null"],"format":"date-time"}}}}}},"NewActivity":{"type":"object","required":["person_id","kind"],"additionalProperties":false,"properties":{"person_id":{"type":"string","format":"uuid"},"kind":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,62}$","description":"Your app’s own kind of event, like profile_viewed."},"summary":{"type":"string","maxLength":200,"description":"The line the CRM shows, like “Watched the hitting video”."},"data":{"type":"object","description":"Anything else worth keeping, up to 8 KB."},"occurred_at":{"type":"string","format":"date-time","description":"When it happened; now if left out."}}},"Activity":{"type":"object","required":["id","person_id","kind","occurred_at"],"properties":{"id":{"type":"string","format":"uuid"},"person_id":{"type":"string","format":"uuid"},"kind":{"type":"string"},"occurred_at":{"type":"string","format":"date-time"}}},"NewSignup":{"type":"object","required":["glofox_member_id","glofox_branch_id","step","what"],"additionalProperties":false,"properties":{"glofox_member_id":{"type":"string","pattern":"^[a-f0-9]{24}$","description":"The Glofox member the request was recorded on."},"glofox_branch_id":{"type":"string","description":"Their Glofox branch. It must be the CRM’s."},"first_name":{"type":"string","maxLength":80,"description":"Needed for someone the CRM doesn’t have yet."},"last_name":{"type":"string","maxLength":80,"description":"Needed for someone the CRM doesn’t have yet."},"email":{"type":"string","maxLength":254},"phone":{"type":"string","maxLength":40,"description":"A US mobile."},"program":{"type":"string","enum":["tpa","365","lab","recruiting","vbl"],"default":"lab"},"step":{"type":"string","enum":["requested","started","paid"],"description":"A request, a checkout started, or one paid for."},"what":{"type":"string","maxLength":120,"description":"What it’s for, like “Pop Time - The Catching Lab class”."},"detail":{"type":"string","maxLength":500,"description":"The time, sessions or message."},"amount":{"type":"number","description":"Charged, in dollars, when paid."},"occurred_at":{"type":"string","format":"date-time","description":"When it happened; now if left out."}}},"WaiverVersion":{"type":"object","required":["id","version","title","sha256","published_at"],"properties":{"id":{"type":"string","format":"uuid"},"version":{"type":"integer","minimum":1},"title":{"type":"string"},"sha256":{"type":"string","description":"sha256 (hex) of the title, a blank line, and the body: what a signature commits to."},"published_at":{"type":"string","format":"date-time"}}},"Waiver":{"type":"object","required":["id","business","title","valid_for_days","archived","current_version","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"business":{"type":"string","enum":["tpa","365","lab","recruiting","vbl"]},"title":{"type":"string"},"valid_for_days":{"type":["integer","null"],"description":"How long a signature lasts. Null never runs out."},"archived":{"type":"boolean"},"current_version":{"$ref":"#/components/schemas/WaiverVersion"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"WaiverDetail":{"allOf":[{"$ref":"#/components/schemas/Waiver"},{"type":"object","required":["current_version","versions"],"properties":{"current_version":{"allOf":[{"$ref":"#/components/schemas/WaiverVersion"},{"type":"object","required":["body"],"properties":{"body":{"type":"string","description":"The words to show the signer, as written."}}}]},"versions":{"type":"array","items":{"$ref":"#/components/schemas/WaiverVersion"},"description":"Newest first."}}}]},"WaiverList":{"type":"object","required":["waivers"],"properties":{"waivers":{"type":"array","items":{"$ref":"#/components/schemas/Waiver"}}}},"NewWaiver":{"type":"object","required":["business","title","body"],"additionalProperties":false,"properties":{"business":{"type":"string","enum":["tpa","365","lab","recruiting","vbl"],"description":"One the app can see."},"title":{"type":"string","minLength":3,"maxLength":160},"body":{"type":"string","maxLength":100000,"description":"The words, as they’ll be shown. Plain text or Markdown; the CRM keeps them as sent."},"valid_for_days":{"type":["integer","null"],"minimum":1,"maximum":3650,"description":"365 for a yearly waiver. Leave out for one that never runs out."}}},"NewWaiverVersion":{"type":"object","required":["body"],"additionalProperties":false,"properties":{"title":{"type":"string","minLength":3,"maxLength":160,"description":"Keeps the current title if left out."},"body":{"type":"string","maxLength":100000}}},"WaiverSettings":{"type":"object","additionalProperties":false,"properties":{"valid_for_days":{"type":["integer","null"],"minimum":1,"maximum":3650},"archived":{"type":"boolean"}}},"Signature":{"type":"object","required":["id","waiver_id","version","person_id","signer","signer_person_id","signer_name","signer_email","signed_at","expires_at","voided_at","voided_reason","app","sha256","updated_at"],"properties":{"id":{"type":"string","format":"uuid"},"waiver_id":{"type":"string","format":"uuid"},"version":{"type":"integer","description":"The version signed."},"person_id":{"type":"string","format":"uuid","description":"Who the waiver covers."},"signer":{"type":"string","enum":["self","parent","guardian"]},"signer_person_id":{"type":["string","null"],"format":"uuid","description":"The signer in the CRM, when they’re there."},"signer_name":{"type":"string","description":"The name they typed to sign."},"signer_email":{"type":["string","null"]},"signed_at":{"type":"string","format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time"},"voided_at":{"type":["string","null"],"format":"date-time"},"voided_reason":{"type":["string","null"]},"app":{"type":["string","null"],"description":"The app it was signed in."},"sha256":{"type":"string","description":"The version’s sha256 when it was signed."},"updated_at":{"type":"string","format":"date-time"}}},"SignatureDetail":{"allOf":[{"$ref":"#/components/schemas/Signature"},{"type":"object","required":["title","body","signature_image","ip_address","user_agent","recorded_at"],"properties":{"title":{"type":"string"},"body":{"type":"string","description":"The exact words signed."},"signature_image":{"type":["string","null"],"description":"The drawn signature, as a PNG data URL."},"ip_address":{"type":["string","null"]},"user_agent":{"type":["string","null"]},"recorded_at":{"type":"string","format":"date-time","description":"When the CRM got it."}}}]},"SignaturePage":{"type":"object","required":["signatures","next_cursor"],"properties":{"signatures":{"type":"array","items":{"$ref":"#/components/schemas/Signature"}},"next_cursor":{"type":["string","null"]}}},"PersonWaivers":{"type":"object","required":["person_id","waivers"],"properties":{"person_id":{"type":"string","format":"uuid"},"waivers":{"type":"array","items":{"type":"object","required":["waiver","status","signature"],"properties":{"waiver":{"$ref":"#/components/schemas/Waiver"},"status":{"type":"string","enum":["signed","outdated","expired","unsigned"]},"signature":{"oneOf":[{"$ref":"#/components/schemas/Signature"},{"type":"null"}],"description":"Their latest signature that isn’t voided."}}}}}},"NewSignature":{"type":"object","required":["waiver_id","version","agreed","signer","signer_name"],"additionalProperties":false,"properties":{"waiver_id":{"type":"string","format":"uuid"},"version":{"type":"integer","minimum":1,"description":"The version shown to the signer. It must be the current one."},"agreed":{"type":"boolean","const":true,"description":"The signer ticked “I agree”."},"signer":{"type":"string","enum":["self","parent","guardian"],"description":"self for an adult signing for themselves."},"signer_name":{"type":"string","minLength":2,"maxLength":120,"description":"The name they typed to sign."},"signer_person_id":{"type":"string","format":"uuid","description":"App tokens: the signer in the CRM (the person, or one of their parents). A person’s token always signs as its person."},"signer_email":{"type":"string","format":"email","description":"Needed for a parent or guardian without signer_person_id."},"signature_image":{"type":"string","maxLength":200000,"description":"A drawn signature, as a PNG data URL."},"signed_at":{"type":"string","format":"date-time","description":"App tokens only: when they signed, if not now. Not before the version was published."},"ip_address":{"type":"string","description":"The signer’s IP address, as the app saw it."},"user_agent":{"type":"string","maxLength":500,"description":"The signer’s browser."}}},"VoidSignature":{"type":"object","required":["reason"],"additionalProperties":false,"properties":{"reason":{"type":"string","minLength":3,"maxLength":300}}},"Signup":{"type":"object","required":["recorded_as","person_id","status","created"],"properties":{"recorded_as":{"type":"string","enum":["signup","booking"],"description":"booking for someone already a member."},"signup_id":{"type":"string","format":"uuid","description":"When recorded as a signup."},"booking_id":{"type":"string","format":"uuid","description":"When recorded as a booking."},"person_id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["new","contacted","enrolled","declined","requested","checkout_started","booked"],"description":"The signup’s status, or the booking’s."},"created":{"type":"boolean","description":"Their first signup for the program. Always false for a booking."}}}}}}