{"openapi":"3.1.0","info":{"title":"Vitadel Data API","version":"1.0.0","description":"Read health data that people choose to share with your application. Send a person to a link session; once they agree, they appear in /users under an id that is yours alone to use. Your application may make 300 requests per 60 seconds, counted across all its keys. Add a webhook endpoint in the console to hear when people connect, change what they share, stop, or have new data. Events carry ids and what changed, never health data: read the data through this API. An event may arrive more than once or out of order; use its id to ignore repeats."},"servers":[{"url":"/api/v1"}],"security":[{"apiKey":[]}],"paths":{"/link/sessions":{"post":{"summary":"Open a link session","description":"A consent link for one person, valid for an hour. redirectUrl must equal a registered redirect URL exactly.","security":[{"apiKey":["link:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkSessionRequest"}}}},"responses":{"201":{"description":"The link to send the person to.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkSession"}}}},"400":{"description":"The request is invalid. `code` says why.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing, wrong, revoked or expired.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Reads only: the user is past your plan's limit on connected users, so their data is locked until the plan covers them. `code` is plan_limit_exceeded.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope, the application is not approved, or sharing has ended.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No user with this id shares data with the application.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Link sessions only: every connected-user place on your plan is taken, and this externalUserId holds none. `code` is plan_limit_reached.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Your application made too many requests. Wait for the number of seconds in Retry-After.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The request could not be counted against the rate limit, so it was refused.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/users":{"get":{"summary":"List users who share data now","security":[{"apiKey":["data:read"]}],"parameters":[{"name":"cursor","in":"query","description":"nextCursor from the previous page.","schema":{"type":"string"}},{"name":"externalUserId","in":"query","description":"Only the user linked under this id of yours.","schema":{"type":"string"}}],"responses":{"200":{"description":"Up to 100 users, ordered by id.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserList"}}}},"400":{"description":"The request is invalid. `code` says why.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing, wrong, revoked or expired.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Reads only: the user is past your plan's limit on connected users, so their data is locked until the plan covers them. `code` is plan_limit_exceeded.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope, the application is not approved, or sharing has ended.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No user with this id shares data with the application.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Link sessions only: every connected-user place on your plan is taken, and this externalUserId holds none. `code` is plan_limit_reached.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Your application made too many requests. Wait for the number of seconds in Retry-After.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The request could not be counted against the rate limit, so it was refused.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/users/{userId}":{"get":{"summary":"Get one user","description":"Also answers for a user who stopped sharing, with status ended.","security":[{"apiKey":["data:read"]}],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string","pattern":"^usr_[0-9a-f]{24}$"}}],"responses":{"200":{"description":"The user.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"description":"The request is invalid. `code` says why.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing, wrong, revoked or expired.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Reads only: the user is past your plan's limit on connected users, so their data is locked until the plan covers them. `code` is plan_limit_exceeded.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope, the application is not approved, or sharing has ended.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No user with this id shares data with the application.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Link sessions only: every connected-user place on your plan is taken, and this externalUserId holds none. `code` is plan_limit_reached.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Your application made too many requests. Wait for the number of seconds in Retry-After.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The request could not be counted against the rate limit, so it was refused.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Stop receiving a user's data","description":"Ends sharing for good. The person sees that your application ended it. Ending it twice changes nothing.","security":[{"apiKey":["data:read"]}],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string","pattern":"^usr_[0-9a-f]{24}$"}}],"responses":{"200":{"description":"The user, now ended.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"description":"The request is invalid. `code` says why.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing, wrong, revoked or expired.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Reads only: the user is past your plan's limit on connected users, so their data is locked until the plan covers them. `code` is plan_limit_exceeded.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope, the application is not approved, or sharing has ended.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No user with this id shares data with the application.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Link sessions only: every connected-user place on your plan is taken, and this externalUserId holds none. `code` is plan_limit_reached.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Your application made too many requests. Wait for the number of seconds in Retry-After.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The request could not be counted against the rate limit, so it was refused.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/users/{userId}/profile":{"get":{"summary":"Profile","description":"Needs the person to share profile. Every read is logged where the person can see it.","security":[{"apiKey":["data:read"]}],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string","pattern":"^usr_[0-9a-f]{24}$"}}],"responses":{"200":{"description":"Profile","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Profile"}}}},"400":{"description":"The request is invalid. `code` says why.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing, wrong, revoked or expired.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Reads only: the user is past your plan's limit on connected users, so their data is locked until the plan covers them. `code` is plan_limit_exceeded.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope, the application is not approved, or sharing has ended.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No user with this id shares data with the application.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Link sessions only: every connected-user place on your plan is taken, and this externalUserId holds none. `code` is plan_limit_reached.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Your application made too many requests. Wait for the number of seconds in Retry-After.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The request could not be counted against the rate limit, so it was refused.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/users/{userId}/connections":{"get":{"summary":"Connected providers","description":"Needs the person to share any data. Every read is logged where the person can see it.","security":[{"apiKey":["data:read"]}],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string","pattern":"^usr_[0-9a-f]{24}$"}}],"responses":{"200":{"description":"Connected providers","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Connections"}}}},"400":{"description":"The request is invalid. `code` says why.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing, wrong, revoked or expired.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Reads only: the user is past your plan's limit on connected users, so their data is locked until the plan covers them. `code` is plan_limit_exceeded.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope, the application is not approved, or sharing has ended.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No user with this id shares data with the application.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Link sessions only: every connected-user place on your plan is taken, and this externalUserId holds none. `code` is plan_limit_reached.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Your application made too many requests. Wait for the number of seconds in Retry-After.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The request could not be counted against the rate limit, so it was refused.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/users/{userId}/daily":{"get":{"summary":"Daily summaries","description":"Needs the person to share sleep, recovery, activity or nutrition. Every read is logged where the person can see it.","security":[{"apiKey":["data:read"]}],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string","pattern":"^usr_[0-9a-f]{24}$"}},{"name":"start","in":"query","description":"First local date, YYYY-MM-DD. Defaults to 27 days before end.","schema":{"type":"string","format":"date"}},{"name":"end","in":"query","description":"Last local date, YYYY-MM-DD, at most 366 days after start. Defaults to the person's today.","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Daily summaries","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Daily"}}}},"400":{"description":"The request is invalid. `code` says why.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing, wrong, revoked or expired.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Reads only: the user is past your plan's limit on connected users, so their data is locked until the plan covers them. `code` is plan_limit_exceeded.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope, the application is not approved, or sharing has ended.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No user with this id shares data with the application.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Link sessions only: every connected-user place on your plan is taken, and this externalUserId holds none. `code` is plan_limit_reached.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Your application made too many requests. Wait for the number of seconds in Retry-After.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The request could not be counted against the rate limit, so it was refused.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/users/{userId}/sleep":{"get":{"summary":"Sleep sessions","description":"Needs the person to share sleep. Every read is logged where the person can see it.","security":[{"apiKey":["data:read"]}],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string","pattern":"^usr_[0-9a-f]{24}$"}},{"name":"start","in":"query","description":"First local date, YYYY-MM-DD. Defaults to 27 days before end.","schema":{"type":"string","format":"date"}},{"name":"end","in":"query","description":"Last local date, YYYY-MM-DD, at most 366 days after start. Defaults to the person's today.","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Sleep sessions","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SleepSessions"}}}},"400":{"description":"The request is invalid. `code` says why.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing, wrong, revoked or expired.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Reads only: the user is past your plan's limit on connected users, so their data is locked until the plan covers them. `code` is plan_limit_exceeded.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope, the application is not approved, or sharing has ended.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No user with this id shares data with the application.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Link sessions only: every connected-user place on your plan is taken, and this externalUserId holds none. `code` is plan_limit_reached.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Your application made too many requests. Wait for the number of seconds in Retry-After.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The request could not be counted against the rate limit, so it was refused.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/users/{userId}/activities":{"get":{"summary":"Workouts, newest first","description":"Needs the person to share activity. Every read is logged where the person can see it.","security":[{"apiKey":["data:read"]}],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string","pattern":"^usr_[0-9a-f]{24}$"}},{"name":"start","in":"query","description":"First local date, YYYY-MM-DD. Defaults to 27 days before end.","schema":{"type":"string","format":"date"}},{"name":"end","in":"query","description":"Last local date, YYYY-MM-DD, at most 366 days after start. Defaults to the person's today.","schema":{"type":"string","format":"date"}},{"name":"cursor","in":"query","description":"nextCursor from the previous page.","schema":{"type":"string"}}],"responses":{"200":{"description":"Workouts, newest first","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Activities"}}}},"400":{"description":"The request is invalid. `code` says why.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing, wrong, revoked or expired.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Reads only: the user is past your plan's limit on connected users, so their data is locked until the plan covers them. `code` is plan_limit_exceeded.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope, the application is not approved, or sharing has ended.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No user with this id shares data with the application.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Link sessions only: every connected-user place on your plan is taken, and this externalUserId holds none. `code` is plan_limit_reached.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Your application made too many requests. Wait for the number of seconds in Retry-After.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The request could not be counted against the rate limit, so it was refused.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/users/{userId}/body":{"get":{"summary":"Weight readings","description":"Needs the person to share body. Every read is logged where the person can see it.","security":[{"apiKey":["data:read"]}],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string","pattern":"^usr_[0-9a-f]{24}$"}},{"name":"start","in":"query","description":"First local date, YYYY-MM-DD. Defaults to 27 days before end.","schema":{"type":"string","format":"date"}},{"name":"end","in":"query","description":"Last local date, YYYY-MM-DD, at most 366 days after start. Defaults to the person's today.","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Weight readings","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BodyMetrics"}}}},"400":{"description":"The request is invalid. `code` says why.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing, wrong, revoked or expired.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Reads only: the user is past your plan's limit on connected users, so their data is locked until the plan covers them. `code` is plan_limit_exceeded.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope, the application is not approved, or sharing has ended.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No user with this id shares data with the application.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Link sessions only: every connected-user place on your plan is taken, and this externalUserId holds none. `code` is plan_limit_reached.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Your application made too many requests. Wait for the number of seconds in Retry-After.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The request could not be counted against the rate limit, so it was refused.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/users/{userId}/nutrition":{"get":{"summary":"Meals by day","description":"Needs the person to share nutrition. Every read is logged where the person can see it.","security":[{"apiKey":["data:read"]}],"parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string","pattern":"^usr_[0-9a-f]{24}$"}},{"name":"start","in":"query","description":"First local date, YYYY-MM-DD. Defaults to 27 days before end.","schema":{"type":"string","format":"date"}},{"name":"end","in":"query","description":"Last local date, YYYY-MM-DD, at most 366 days after start. Defaults to the person's today.","schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Meals by day","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NutritionDays"}}}},"400":{"description":"The request is invalid. `code` says why.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"The API key is missing, wrong, revoked or expired.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Reads only: the user is past your plan's limit on connected users, so their data is locked until the plan covers them. `code` is plan_limit_exceeded.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The key lacks the scope, the application is not approved, or sharing has ended.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No user with this id shares data with the application.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Link sessions only: every connected-user place on your plan is taken, and this externalUserId holds none. `code` is plan_limit_reached.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Your application made too many requests. Wait for the number of seconds in Retry-After.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"The request could not be counted against the rate limit, so it was refused.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/RateLimitLimit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/RateLimitRemaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/RateLimitReset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{"user.connected":{"post":{"summary":"A person connected","description":"They agreed in a link session. scopes are the kinds of data you may read now.","parameters":[{"name":"Vitadel-Signature","in":"header","required":true,"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">, keyed with your endpoint's whole secret, whsec_ included. Compute it over the raw body before you parse it, compare in constant time, and refuse a t more than 5 minutes from your clock.","schema":{"type":"string","pattern":"^t=[0-9]+,v1=[0-9a-f]{64}$"}},{"name":"Vitadel-Event-Id","in":"header","required":true,"description":"The id in the body.","schema":{"type":"string"}},{"name":"Vitadel-Event-Type","in":"header","required":true,"description":"The type in the body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserConnectedEvent"}}}},"responses":{"2XX":{"description":"Received. Any other answer, a redirect included, or none within 5 seconds, is tried again after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours; after that the event is marked failed. An endpoint that fails for 72 hours straight is turned off."}}}},"user.updated":{"post":{"summary":"A person changed what they share","description":"scopes are what you may read now; previousScopes what you could read before.","parameters":[{"name":"Vitadel-Signature","in":"header","required":true,"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">, keyed with your endpoint's whole secret, whsec_ included. Compute it over the raw body before you parse it, compare in constant time, and refuse a t more than 5 minutes from your clock.","schema":{"type":"string","pattern":"^t=[0-9]+,v1=[0-9a-f]{64}$"}},{"name":"Vitadel-Event-Id","in":"header","required":true,"description":"The id in the body.","schema":{"type":"string"}},{"name":"Vitadel-Event-Type","in":"header","required":true,"description":"The type in the body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdatedEvent"}}}},"responses":{"2XX":{"description":"Received. Any other answer, a redirect included, or none within 5 seconds, is tried again after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours; after that the event is marked failed. An endpoint that fails for 72 hours straight is turned off."}}}},"user.ended":{"post":{"summary":"Sharing ended","description":"endedBy says who ended it: the person, your application, or Vitadel. Reads for this user are refused from now on.","parameters":[{"name":"Vitadel-Signature","in":"header","required":true,"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">, keyed with your endpoint's whole secret, whsec_ included. Compute it over the raw body before you parse it, compare in constant time, and refuse a t more than 5 minutes from your clock.","schema":{"type":"string","pattern":"^t=[0-9]+,v1=[0-9a-f]{64}$"}},{"name":"Vitadel-Event-Id","in":"header","required":true,"description":"The id in the body.","schema":{"type":"string"}},{"name":"Vitadel-Event-Type","in":"header","required":true,"description":"The type in the body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEndedEvent"}}}},"responses":{"2XX":{"description":"Received. Any other answer, a redirect included, or none within 5 seconds, is tried again after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours; after that the event is marked failed. An endpoint that fails for 72 hours straight is turned off."}}}},"data.updated":{"post":{"summary":"New data","description":"Records for these kinds of data changed between start and end, local dates; read that range again. Counts only data your application may receive. Sent at most once per user every few minutes.","parameters":[{"name":"Vitadel-Signature","in":"header","required":true,"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">, keyed with your endpoint's whole secret, whsec_ included. Compute it over the raw body before you parse it, compare in constant time, and refuse a t more than 5 minutes from your clock.","schema":{"type":"string","pattern":"^t=[0-9]+,v1=[0-9a-f]{64}$"}},{"name":"Vitadel-Event-Id","in":"header","required":true,"description":"The id in the body.","schema":{"type":"string"}},{"name":"Vitadel-Event-Type","in":"header","required":true,"description":"The type in the body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataUpdatedEvent"}}}},"responses":{"2XX":{"description":"Received. Any other answer, a redirect included, or none within 5 seconds, is tried again after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours; after that the event is marked failed. An endpoint that fails for 72 hours straight is turned off."}}}},"webhook.test":{"post":{"summary":"Test event","description":"Sent when you ask for one in the console. data is empty.","parameters":[{"name":"Vitadel-Signature","in":"header","required":true,"description":"t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">, keyed with your endpoint's whole secret, whsec_ included. Compute it over the raw body before you parse it, compare in constant time, and refuse a t more than 5 minutes from your clock.","schema":{"type":"string","pattern":"^t=[0-9]+,v1=[0-9a-f]{64}$"}},{"name":"Vitadel-Event-Id","in":"header","required":true,"description":"The id in the body.","schema":{"type":"string"}},{"name":"Vitadel-Event-Type","in":"header","required":true,"description":"The type in the body.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestEvent"}}}},"responses":{"2XX":{"description":"Received. Any other answer, a redirect included, or none within 5 seconds, is tried again after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours; after that the event is marked failed. An endpoint that fails for 72 hours straight is turned off."}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key of your application, vtd_sk_…"}},"headers":{"RateLimitLimit":{"description":"Requests your application may make per window, across all its keys.","schema":{"type":"integer"}},"RateLimitRemaining":{"description":"Requests your application has left in this window.","schema":{"type":"integer"}},"RateLimitReset":{"description":"When the window resets, in Unix seconds.","schema":{"type":"integer"}},"RetryAfter":{"description":"Seconds to wait before trying again.","schema":{"type":"integer"}}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error","code"],"additionalProperties":false},"LinkSession":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"},"url":{"type":"string","format":"uri"},"expiresAt":{"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))$"}},"required":["id","url","expiresAt"],"additionalProperties":false},"User":{"type":"object","properties":{"id":{"type":"string","pattern":"^usr_[0-9a-f]{24}$"},"externalUserId":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["profile","activity","sleep","recovery","body","nutrition"]}},"status":{"type":"string","enum":["active","ended"]},"grantedAt":{"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))$"},"endedAt":{"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))$"},{"type":"null"}]},"endedBy":{"anyOf":[{"type":"string","enum":["user","application","system"]},{"type":"null"}]},"locked":{"type":"boolean"}},"required":["id","externalUserId","scopes","status","grantedAt","endedAt","endedBy","locked"],"additionalProperties":false},"UserList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/User"}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","nextCursor"],"additionalProperties":false},"Profile":{"type":"object","properties":{"data":{"anyOf":[{"type":"object","properties":{"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"ageYears":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"gender":{"anyOf":[{"type":"string","enum":["female","male","other","prefer_not_to_say"]},{"type":"null"}]},"heightCm":{"anyOf":[{"type":"number","exclusiveMinimum":0},{"type":"null"}]},"timeZone":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["firstName","ageYears","gender","heightCm","timeZone"],"additionalProperties":false},{"type":"null"}]},"sources":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"}},"withheld":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"}},"locked":{"type":"array","items":{"type":"string","enum":["profile","activity","sleep","recovery","body","nutrition","labs","medications"]}}},"required":["data","sources","withheld","locked"],"additionalProperties":false},"Connections":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"status":{"type":"string","enum":["connected","disconnected","error"]},"lastSyncAt":{"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))$"},{"type":"null"}]},"lastDataDate":{"anyOf":[{"type":"string","format":"date","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])))$"},{"type":"null"}]},"devices":{"type":"array","items":{"type":"string"}},"shared":{"type":"boolean"}},"required":["provider","status","lastSyncAt","lastDataDate","devices","shared"],"additionalProperties":false}},"sources":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"}},"withheld":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"}},"locked":{"type":"array","items":{"type":"string","enum":["profile","activity","sleep","recovery","body","nutrition","labs","medications"]}}},"required":["data","sources","withheld","locked"],"additionalProperties":false},"Daily":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","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])))$"},"sleep":{"type":"object","properties":{"score":{"anyOf":[{"type":"object","properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"source":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},{"type":"null"}]},"withheld":{"type":"boolean"}},"required":["value","source","withheld"],"additionalProperties":false},{"type":"null"}]},"durationMinutes":{"anyOf":[{"type":"object","properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"source":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},{"type":"null"}]},"withheld":{"type":"boolean"}},"required":["value","source","withheld"],"additionalProperties":false},{"type":"null"}]}},"required":["score","durationMinutes"],"additionalProperties":false},"recovery":{"type":"object","properties":{"hrvRmssdMs":{"anyOf":[{"type":"object","properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"source":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},{"type":"null"}]},"withheld":{"type":"boolean"}},"required":["value","source","withheld"],"additionalProperties":false},{"type":"null"}]},"restingHeartRateBpm":{"anyOf":[{"type":"object","properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"source":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},{"type":"null"}]},"withheld":{"type":"boolean"}},"required":["value","source","withheld"],"additionalProperties":false},{"type":"null"}]},"recoveryScore":{"anyOf":[{"type":"object","properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"source":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},{"type":"null"}]},"withheld":{"type":"boolean"}},"required":["value","source","withheld"],"additionalProperties":false},{"type":"null"}]},"strainScore":{"anyOf":[{"type":"object","properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"source":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},{"type":"null"}]},"withheld":{"type":"boolean"}},"required":["value","source","withheld"],"additionalProperties":false},{"type":"null"}]}},"required":["hrvRmssdMs","restingHeartRateBpm","recoveryScore","strainScore"],"additionalProperties":false},"activity":{"type":"object","properties":{"steps":{"anyOf":[{"type":"object","properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"source":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},{"type":"null"}]},"withheld":{"type":"boolean"}},"required":["value","source","withheld"],"additionalProperties":false},{"type":"null"}]},"activeEnergyKcal":{"anyOf":[{"type":"object","properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"source":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},{"type":"null"}]},"withheld":{"type":"boolean"}},"required":["value","source","withheld"],"additionalProperties":false},{"type":"null"}]}},"required":["steps","activeEnergyKcal"],"additionalProperties":false},"nutrition":{"type":"object","properties":{"energyKcal":{"anyOf":[{"type":"object","properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"source":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},{"type":"null"}]},"withheld":{"type":"boolean"}},"required":["value","source","withheld"],"additionalProperties":false},{"type":"null"}]},"proteinGrams":{"anyOf":[{"type":"object","properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"source":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},{"type":"null"}]},"withheld":{"type":"boolean"}},"required":["value","source","withheld"],"additionalProperties":false},{"type":"null"}]},"carbsGrams":{"anyOf":[{"type":"object","properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"source":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},{"type":"null"}]},"withheld":{"type":"boolean"}},"required":["value","source","withheld"],"additionalProperties":false},{"type":"null"}]},"fatGrams":{"anyOf":[{"type":"object","properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"source":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},{"type":"null"}]},"withheld":{"type":"boolean"}},"required":["value","source","withheld"],"additionalProperties":false},{"type":"null"}]},"fiberGrams":{"anyOf":[{"type":"object","properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"source":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},{"type":"null"}]},"withheld":{"type":"boolean"}},"required":["value","source","withheld"],"additionalProperties":false},{"type":"null"}]},"logCount":{"anyOf":[{"type":"object","properties":{"value":{"anyOf":[{"type":"number"},{"type":"null"}]},"source":{"anyOf":[{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},{"type":"null"}]},"withheld":{"type":"boolean"}},"required":["value","source","withheld"],"additionalProperties":false},{"type":"null"}]}},"required":["energyKcal","proteinGrams","carbsGrams","fatGrams","fiberGrams","logCount"],"additionalProperties":false}},"required":["date"],"additionalProperties":false}},"range":{"type":"object","properties":{"start":{"type":"string","format":"date","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])))$"},"end":{"type":"string","format":"date","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])))$"}},"required":["start","end"],"additionalProperties":false},"today":{"type":"string","format":"date","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])))$"},"sources":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"}},"withheld":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"}},"locked":{"type":"array","items":{"type":"string","enum":["profile","activity","sleep","recovery","body","nutrition","labs","medications"]}}},"required":["data","range","today","sources","withheld","locked"],"additionalProperties":false},"SleepSessions":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"date":{"type":"string","format":"date","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])))$"},"startTime":{"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))$"},"endTime":{"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))$"},"isNap":{"type":"boolean"},"isMain":{"type":"boolean"},"durationSeconds":{"type":"integer","minimum":0,"maximum":9007199254740991},"efficiencyPercent":{"anyOf":[{"type":"number"},{"type":"null"}]},"latencySeconds":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"wakeCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"stages":{"anyOf":[{"type":"object","properties":{"awakeSeconds":{"type":"integer","minimum":0,"maximum":9007199254740991},"lightSeconds":{"type":"integer","minimum":0,"maximum":9007199254740991},"deepSeconds":{"type":"integer","minimum":0,"maximum":9007199254740991},"remSeconds":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["awakeSeconds","lightSeconds","deepSeconds","remSeconds"],"additionalProperties":false},{"type":"null"}]}},"required":["id","source","date","startTime","endTime","isNap","isMain","durationSeconds","efficiencyPercent","latencySeconds","wakeCount","stages"],"additionalProperties":false}},"range":{"type":"object","properties":{"start":{"type":"string","format":"date","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])))$"},"end":{"type":"string","format":"date","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])))$"}},"required":["start","end"],"additionalProperties":false},"today":{"type":"string","format":"date","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])))$"},"sources":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"}},"withheld":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"}},"locked":{"type":"array","items":{"type":"string","enum":["profile","activity","sleep","recovery","body","nutrition","labs","medications"]}}},"required":["data","range","today","sources","withheld","locked"],"additionalProperties":false},"Activities":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"contributingSources":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"}},"deviceName":{"anyOf":[{"type":"string"},{"type":"null"}]},"activityType":{"type":"string"},"sport":{"anyOf":[{"type":"string"},{"type":"null"}]},"startTime":{"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))$"},"endTime":{"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))$"},"date":{"anyOf":[{"type":"string","format":"date","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])))$"},{"type":"null"}]},"durationSeconds":{"type":"integer","minimum":0,"maximum":9007199254740991},"distanceMeters":{"anyOf":[{"type":"number"},{"type":"null"}]},"energyKcal":{"anyOf":[{"type":"number"},{"type":"null"}]},"averageHeartRateBpm":{"anyOf":[{"type":"number"},{"type":"null"}]},"maxHeartRateBpm":{"anyOf":[{"type":"number"},{"type":"null"}]},"elevationGainMeters":{"anyOf":[{"type":"number"},{"type":"null"}]},"steps":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["id","source","contributingSources","deviceName","activityType","sport","startTime","endTime","date","durationSeconds","distanceMeters","energyKcal","averageHeartRateBpm","maxHeartRateBpm","elevationGainMeters","steps"],"additionalProperties":false}},"range":{"type":"object","properties":{"start":{"type":"string","format":"date","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])))$"},"end":{"type":"string","format":"date","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])))$"}},"required":["start","end"],"additionalProperties":false},"today":{"type":"string","format":"date","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])))$"},"sources":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"}},"withheld":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"}},"locked":{"type":"array","items":{"type":"string","enum":["profile","activity","sleep","recovery","body","nutrition","labs","medications"]}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","range","today","sources","withheld","locked","nextCursor"],"additionalProperties":false},"BodyMetrics":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"measuredAt":{"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))$"},"date":{"type":"string","format":"date","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])))$"},"weightKg":{"type":"number","exclusiveMinimum":0},"source":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"}},"required":["measuredAt","date","weightKg","source"],"additionalProperties":false}},"range":{"type":"object","properties":{"start":{"type":"string","format":"date","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])))$"},"end":{"type":"string","format":"date","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])))$"}},"required":["start","end"],"additionalProperties":false},"today":{"type":"string","format":"date","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])))$"},"sources":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"}},"withheld":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"}},"locked":{"type":"array","items":{"type":"string","enum":["profile","activity","sleep","recovery","body","nutrition","labs","medications"]}}},"required":["data","range","today","sources","withheld","locked"],"additionalProperties":false},"NutritionDays":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date","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])))$"},"totals":{"type":"object","properties":{"energyKcal":{"type":"number","minimum":0},"proteinGrams":{"type":"number","minimum":0},"carbsGrams":{"type":"number","minimum":0},"fatGrams":{"type":"number","minimum":0},"fiberGrams":{"type":"number","minimum":0}},"required":["energyKcal","proteinGrams","carbsGrams","fatGrams","fiberGrams"],"additionalProperties":false},"meals":{"type":"array","items":{"type":"object","properties":{"energyKcal":{"type":"number","minimum":0},"proteinGrams":{"type":"number","minimum":0},"carbsGrams":{"type":"number","minimum":0},"fatGrams":{"type":"number","minimum":0},"fiberGrams":{"type":"number","minimum":0},"id":{"type":"string"},"loggedAt":{"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))$"},"mealSlot":{"type":"string","enum":["breakfast","lunch","dinner","snack"]},"foodName":{"type":"string"},"quantity":{"type":"number","exclusiveMinimum":0},"unit":{"type":"string"}},"required":["energyKcal","proteinGrams","carbsGrams","fatGrams","fiberGrams","id","loggedAt","mealSlot","foodName","quantity","unit"],"additionalProperties":false}}},"required":["date","totals","meals"],"additionalProperties":false}},"range":{"type":"object","properties":{"start":{"type":"string","format":"date","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])))$"},"end":{"type":"string","format":"date","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])))$"}},"required":["start","end"],"additionalProperties":false},"today":{"type":"string","format":"date","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])))$"},"sources":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"}},"withheld":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"}},"locked":{"type":"array","items":{"type":"string","enum":["profile","activity","sleep","recovery","body","nutrition","labs","medications"]}}},"required":["data","range","today","sources","withheld","locked"],"additionalProperties":false},"UserConnectedEvent":{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-f]{24}$"},"type":{"type":"string","const":"user.connected"},"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))$"},"data":{"type":"object","properties":{"userId":{"type":"string","pattern":"^usr_[0-9a-f]{24}$"},"externalUserId":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["profile","activity","sleep","recovery","body","nutrition"]}}},"required":["userId","externalUserId","scopes"],"additionalProperties":false}},"required":["id","type","createdAt","data"],"additionalProperties":false},"UserUpdatedEvent":{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-f]{24}$"},"type":{"type":"string","const":"user.updated"},"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))$"},"data":{"type":"object","properties":{"userId":{"type":"string","pattern":"^usr_[0-9a-f]{24}$"},"externalUserId":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["profile","activity","sleep","recovery","body","nutrition"]}},"previousScopes":{"type":"array","items":{"type":"string","enum":["profile","activity","sleep","recovery","body","nutrition"]}}},"required":["userId","externalUserId","scopes","previousScopes"],"additionalProperties":false}},"required":["id","type","createdAt","data"],"additionalProperties":false},"UserEndedEvent":{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-f]{24}$"},"type":{"type":"string","const":"user.ended"},"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))$"},"data":{"type":"object","properties":{"userId":{"type":"string","pattern":"^usr_[0-9a-f]{24}$"},"externalUserId":{"type":"string"},"endedBy":{"type":"string","enum":["user","application","system"]}},"required":["userId","externalUserId","endedBy"],"additionalProperties":false}},"required":["id","type","createdAt","data"],"additionalProperties":false},"DataUpdatedEvent":{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-f]{24}$"},"type":{"type":"string","const":"data.updated"},"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))$"},"data":{"type":"object","properties":{"userId":{"type":"string","pattern":"^usr_[0-9a-f]{24}$"},"externalUserId":{"type":"string"},"scopes":{"type":"array","items":{"type":"string","enum":["profile","activity","sleep","recovery","body","nutrition"]}},"start":{"type":"string","format":"date","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])))$"},"end":{"type":"string","format":"date","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])))$"}},"required":["userId","externalUserId","scopes","start","end"],"additionalProperties":false}},"required":["id","type","createdAt","data"],"additionalProperties":false},"WebhookTestEvent":{"type":"object","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-f]{24}$"},"type":{"type":"string","const":"webhook.test"},"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))$"},"data":{"type":"object","properties":{},"additionalProperties":false}},"required":["id","type","createdAt","data"],"additionalProperties":false},"LinkSessionRequest":{"type":"object","properties":{"externalUserId":{"type":"string","pattern":"^[\\x21-\\x7e]{1,255}$"},"scopes":{"minItems":1,"type":"array","items":{"type":"string","enum":["profile","activity","sleep","recovery","body","nutrition"]}},"redirectUrl":{"type":"string","maxLength":2000},"state":{"type":"string","pattern":"^[\\x21-\\x7e]{1,500}$"}},"required":["externalUserId","scopes","redirectUrl"]}}}}