UNPKG

openapi-directory

Version:

Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS

1 lines 165 kB
{"openapi":"3.0.0","servers":[{"url":"https://api.twinehealth.com/pub"}],"info":{"contact":{"email":"apiteam@twinehealth.com"},"description":"# Overview\nThe Fitbit Plus API is a RESTful API. The requests and responses are formated according to the\n[JSON API](http://jsonapi.org/format/1.0/) specification.\n\nIn addition to this documentation, we also provide an\n[OpenAPI](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md) \"yaml\" file describing the API:\n[Fitbit Plus API Specification](swagger.yaml).\n\n# Authentication\nAuthentication for the Fitbit Plus API is based on the\n[OAuth 2.0 Authorization Framework](https://tools.ietf.org/html/rfc6749). Fitbit Plus currently supports grant\ntypes of **client_credentials** and **refresh_token**.\n\nSee [POST /oauth/token](#operation/createToken) for details on the request and response formats.\n<!-- ReDoc-Inject: <security-definitions> -->\n\n## Building Integrations\nWe will provide customers with unique client credentials for each application/integration they build, allowing us\nto enforce appropriate access controls and monitor API usage.\nThe client credentials will be scoped to the organization, and allow full access to all patients and related data\nwithin that organization.\n\nThese credentials are appropriate for creating an integration that does one of the following:\n - background reporting/analysis\n - synchronizing data with another system (such as an EMR)\n\nThe API credentials and oauth flows we currently support are **not** well suited for creating a user-facing\napplication that allows a user (patient, coach, or admin) to login and have access to data which is appropriate to\nthat specific user. It is possible to build such an application, but it is not possible to use Fitbit Plus as a\nfederated identity provider. You would need to have a separate means of verifying a user's identity. We do not\ncurrently support the required password-based oauth flow to make this possible.\n\n# Paging\nThe Fitbit Plus API supports two different pagination strategies for GET collection endpoints.\n\n#### Skip-based paging\n\nSkip-based paging uses the query parameters `page[size]` and `page[number]` to specify the max number of resources returned and the page number. We default to skip-based paging if there are no page parameters. The response will include a `links` object containing links to the first, last, prev, and next pages of data.\n\nIf the contents of the collection change while you are iterating through the collection, you will see duplicate or missing documents. For example, if you are iterating through the `calender_event` resource via `GET /pub/calendar_event?sort=start_at&page[size]=50&page[number]=1`, and a new `calendar_event` is created that has a `start_at` value before the first `calendar_event`, when you fetch the next page at `GET /pub/calendar_event?sort=start_at&page[size]=50&page[number]=2`, the first entry in the second response will be a duplicate of the last entry in the first response.\n\n#### Cursor-based paging\nCursor-based paging uses the query parameters `page[limit]` and `page[after]` to specify the max number of entries returned and identify where to begin the next page. Add `page[limit]` to the parameters to use cursor-based paging. The response will include a `links` object containing a link to the next page of data, if the next page exists.\n\nCursor-based paging is not subject to duplication if new resources are added to the collection. For example, if you are iterating through the `calender_event` resource via `GET /pub/calendar_event?sort=start_at&page[limit]=50`, and a new `calendar_event` is created that has a `start_at` value before the first `calendar_event`, you will not see a duplicate entry when you fetch the next page at `GET /pub/calendar_event?sort=start_at&page[limit]=50&page[after]=<cursor>`.\n\nWe encourage the use of cursor-based paging for performance reasons.\n\nIn either form of paging, you can determine whether any resources were missed by comparing the number of fetched resources against `meta.count`. Set `page[size]` or `page[limit]` to 0 to get only the count.\n\nIt is not valid to mix the two strategies.\n","title":"Fitbit Plus API","version":"v7.78.1","x-apisguru-categories":["support"],"x-logo":{"url":"http://developer.twinehealth.com/images/Fitbit_Plus_lockup_2C_RGB-32.png"},"x-origin":[{"format":"openapi","url":"https://raw.githubusercontent.com/TwineHealth/TwineDeveloperDocs/master/spec/swagger.yaml","version":"3.0"}],"x-providerName":"twinehealth.com"},"tags":[{"description":"Authentication operations","name":"oauth"},{"description":"An organization is a Fitbit Plus customer. No data is accessible across organizations.","name":"organization"},{"description":"A group is a cohort of patients within an organization. The creation of groups allows for the segmentation of dashboards and analytics. For example, a group might correspond to the patients in a particular practice or the employees of a particular employer.","name":"group"},{"description":"A coach is a person that supports a patient","name":"coach"},{"description":"A reward program provides the details for a rewards program for a group. Different rewards programs can be created for different periods of time specified by the start_at and end_at dates. A reward program can activated for a patient any time between these dates. An activated reward program for a patient is called a reward program activation.","name":"reward program"},{"description":"An action is an actionable item in a patient's plan.","name":"action"},{"description":"A bundle is a collection of actions (an action plan) in a patient's plan summary.","name":"bundle"},{"description":"A calendar event represents an event involving or relevant to a patient which will or has occurred on a specific date or during a specific period of time.","name":"calendar event"},{"description":"A calendar event response indicates the attendee's response to a calendar event. Only `POST` for creation is allowed as the responses are updated into the corresponding calendar events.","name":"calendar event response"},{"description":"Email history represents a single email that was sent using Fitbit Plus.","name":"email history"},{"description":"A health profile contains a set of health questions and answers for a patient.","name":"health profile"},{"description":"A health profile answer is the answer to a question for a patient.","name":"health profile answer"},{"description":"A health profile question contains a health question and the corresponding answer for a patient.","name":"health profile question"},{"description":"A health question definition specifies a health question and the corresponding answer choices.","name":"health question definition"},{"description":"A metric is a quantitative result for a patient. For example, vital signs, lab results, etc. are all metrics.","name":"metric"},{"description":"A patient is the core user of Fitbit Plus.","name":"patient"},{"description":"A plan is the set of actions and associated goals for a patient.","name":"plan"},{"description":"A patient health result is a quantitative result for a patient.","name":"result"},{"description":"A reward allocates a portion of the budget from the reward program activation for achieving a particular goal and sets a target date.","name":"reward"},{"description":"A reward earning specifies the portion of a reward that was earned and at what date.","name":"reward earning"},{"description":"A reward earning fulfillment specifies the portion of a reward earning that was fulfilled and at what date.","name":"reward earning fulfillment"},{"description":"A reward program activation is the activation of a reward program for a specific patient.","name":"reward program activation"}],"paths":{"/action":{"post":{"description":"Create a plan action","operationId":"createAction","requestBody":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateActionRequest"}}},"required":true},"responses":{"201":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateActionResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Forbidden"},"409":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Invalid Request"}},"summary":"Create action","tags":["action"]}},"/action/{id}":{"get":{"description":"Get a health action from a patient's plan.","operationId":"fetchAction","parameters":[{"description":"Action identifier","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchActionResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"}},"summary":"Get an action","tags":["action"]},"patch":{"description":"Update a health action from a patient's plan.","operationId":"updateAction","parameters":[{"description":"Action identifier","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/UpdateActionRequest"}}},"required":true},"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/UpdateActionResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"},"409":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Invalid Request"}},"summary":"Update an action","tags":["action"]}},"/bundle":{"post":{"description":"Create a bundle in a patient's plan","operationId":"createBundle","requestBody":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateBundleRequest"}}},"required":true},"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateBundleResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Forbidden"},"409":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Invalid Request"}},"summary":"Create bundle","tags":["bundle"]}},"/bundle/{id}":{"get":{"description":"Get a bundle from a patient's plan.","operationId":"fetchBundle","parameters":[{"description":"Bundle identifier","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchBundleResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"}},"summary":"Get a bundle","tags":["bundle"]},"patch":{"description":"Updte a bundle from a patient's plan.","operationId":"updateBundle","parameters":[{"description":"Bundle identifier","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/UpdateBundleRequest"}}},"required":true},"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/UpdateBundleResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"},"409":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Invalid Request"}},"summary":"Update a bundle","tags":["bundle"]}},"/calendar_event":{"get":{"description":"Get a list of calendar events","operationId":"fetchCalendarEvents","parameters":[{"description":"Patient id to fetch calendar event. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, `filter[organization]`, or `filter[attendees]`.\n","in":"query","name":"filter[patient]","schema":{"type":"string"}},{"description":"Comma-separated list of group ids. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, `filter[organization]`, or `filter[attendees]`.\n","in":"query","name":"filter[groups]","schema":{"type":"string"}},{"description":"Fitbit Plus organization id. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, `filter[organization]`, or `filter[attendees]`.\n","in":"query","name":"filter[organization]","schema":{"type":"string"}},{"description":"Comma-separated list of coach or patient ids. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, `filter[organization]`, or `filter[attendees]`.\n","in":"query","name":"filter[attendees]","schema":{"type":"string"}},{"description":"Calendar event type","in":"query","name":"filter[type]","schema":{"enum":["plan-check-in","reminder","telephone-call","office-visit","video-call"],"type":"string"}},{"description":"If not specified, return all calendar events. If set to `true` return only events marked as completed, if set to `false`, return only events not marked as completed yet.","in":"query","name":"filter[completed]","schema":{"type":"boolean"}},{"description":"The start (inclusive) and end (exclusive) dates are ISO date and time strings separated by `..`. Example for events starting in November 2017 (America/New_York): `filter[start_at]=2017-11-01T00:00:00-04:00..2017-12-01T00:00:00-05:00`\n","in":"query","name":"filter[start_at]","schema":{"type":"string"}},{"description":"The start (inclusive) and end (exclusive) dates are ISO date and time strings separated by `..`. Example for events ending in November 2017 (America/New_York): `filter[end_at]=2017-11-01T00:00:00-04:00..2017-12-01T00:00:00-05:00`\n","in":"query","name":"filter[end_at]","schema":{"type":"string"}},{"description":"The start (inclusive) and end (exclusive) dates are ISO date and time strings separated by `..`. Example for events completed in November 2017 (America/New_York): `filter[completed_at]=2017-11-01T00:00:00-04:00..2017-12-01T00:00:00-05:00`\n","in":"query","name":"filter[completed_at]","schema":{"type":"string"}},{"description":"The start (inclusive) and end (exclusive) dates are ISO date and time strings separated by `..`. Example for events created in November 2017 (America/New_York): `filter[created_at]=2017-11-01T00:00:00-04:00..2017-12-01T00:00:00-05:00`\n","in":"query","name":"filter[created_at]","schema":{"type":"string"}},{"description":"The start (inclusive) and end (exclusive) dates are ISO date and time strings separated by `..`. Example for events updated in November 2017 (America/New_York): `filter[updated_at]=2017-11-01T00:00:00-04:00..2017-12-01T00:00:00-05:00`\n","in":"query","name":"filter[updated_at]","schema":{"type":"string"}},{"description":"Page number","in":"query","name":"page[number]","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Page size","in":"query","name":"page[size]","required":false,"schema":{"default":10,"maximum":50,"minimum":0,"type":"integer"}},{"description":"Page limit","in":"query","name":"page[limit]","required":false,"schema":{"default":50,"minimum":0,"type":"integer"}},{"description":"Page cursor","in":"query","name":"page[cursor]","required":false,"schema":{"type":"string"}},{"description":"List of related resources to include in the response","in":"query","name":"include","required":false,"schema":{"enum":["owner"],"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchCalendarEventsResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"},"409":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Invalid Request"}},"summary":"List calendar events","tags":["calendar event"]},"post":{"description":"Create a calendar event for a patient. Attribute `all_day` must be set to `true` and `end_at` cannot be set for `plan-check-in` event type.","operationId":"createCalendarEvent","requestBody":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateCalendarEventRequest"}}},"required":true},"responses":{"201":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateCalendarEventResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Forbidden"},"409":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Invalid Request"}},"summary":"Create calendar event","tags":["calendar event"]}},"/calendar_event/{id}":{"delete":{"description":"Delete a calendar event by id","operationId":"deleteCalendarEvent","parameters":[{"description":"Calendar event identifier","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"}},"summary":"Delete a calendar event","tags":["calendar event"]},"get":{"description":"Get a calendar event by id","operationId":"fetchCalendarEvent","parameters":[{"description":"Calendar event identifier","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchCalendarEventResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"}},"summary":"Get a calendar event","tags":["calendar event"]},"patch":{"description":"Update a calendar event for a patient. Attribute `all_day` must be true and `end_at` cannot be specified for `plan-check-in` event type. To mark a calendar event as 'completed', set `completed_at` and `completed_by` to desired values. To mark a completed calendar event as 'not completed', set `completed_at` and `completed_by` to `null`. Attendees can be added or removed, but response status cannot be updated. Use the calendar event response api for response status updates instead.","operationId":"updateCalendarEvent","parameters":[{"description":"Calendar event identifier","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/UpdateCalendarEventRequest"}}},"required":true},"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/UpdateCalendarEventResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"},"409":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Invalid Request"}},"summary":"Update a calendar event","tags":["calendar event"]}},"/calendar_event_response":{"post":{"description":"Create a calendar event response for an attendee of a calendar event, the attendee can be a coach or patient. Calendar event responses cannot be fetched, updated nor deleted. Use calendar event api to fetch the response status for attendees.","operationId":"createCalendarEventResponse","requestBody":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateCalendarEventResponseRequest"}}},"required":true},"responses":{"201":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateCalendarEventResponseRequest"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Forbidden"},"409":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Invalid Request"}},"summary":"Create calendar event response","tags":["calendar event response"]}},"/coach":{"get":{"description":"Get a list of coaches matching the specified filters.","operationId":"fetchCoaches","parameters":[{"description":"Comma-separated list of group ids. Note that one of the following filters must be specified: `filter[groups]`, `filter[organization]`.\n","in":"query","name":"filter[groups]","schema":{"type":"string"}},{"description":"Fitbit Plus organization id. Note that one of the following filters must be specified: `filter[groups]`, `filter[organization]`.\n","in":"query","name":"filter[organization]","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchCoachesResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"}},"summary":"List coaches","tags":["coach"]}},"/coach/{id}":{"get":{"description":"Get a coach record by id.","operationId":"fetchCoach","parameters":[{"description":"Coach identifier","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchCoachResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"}},"summary":"Get a coach","tags":["coach"]}},"/email_history":{"get":{"description":"Get a list of email histories","operationId":"fetchEmailHistories","parameters":[{"description":"Fitbit Plus user id of email recipient. Required if filter[sender] is not defined.","in":"query","name":"filter[receiver]","schema":{"type":"string"}},{"description":"Fitbit Plus user id of email sender. Required if filter[receiver] is not defined.","in":"query","name":"filter[sender]","schema":{"type":"string"}},{"description":"Type of email","in":"query","name":"filter[emailType]","schema":{"type":"string"}},{"description":"valid sorts:\n * send_time - ascending by send_time\n * -send_time - descending by send_time\n","in":"query","name":"sort","schema":{"enum":["send_time","-send_time"],"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchEmailHistoriesResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"},"409":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Invalid Request"}},"summary":"List email histories","tags":["email history"]}},"/email_history/{id}":{"get":{"description":"Get an email history by id","operationId":"fetchEmailHistory","parameters":[{"description":"Email history identifier","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchEmailHistoryResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"}},"summary":"Get an email history","tags":["email history"]}},"/group":{"get":{"description":"Get a list of groups matching the specified filters.","operationId":"fetchGroups","parameters":[{"description":"Organization identifier","in":"query","name":"filter[organization]","required":true,"schema":{"type":"string"}},{"description":"Group name","in":"query","name":"filter[name]","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchGroupsResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"}},"summary":"List groups","tags":["group"]},"post":{"description":"Create a group record.","operationId":"createGroup","requestBody":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateGroupRequest"}}},"required":true},"responses":{"201":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateGroupResponse"}}},"description":"Created"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Forbidden"},"409":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Invalid Request"}},"summary":"Create a group","tags":["group"]}},"/group/{id}":{"get":{"description":"Get a group record by id.","operationId":"fetchGroup","parameters":[{"description":"Group identifier","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchGroupResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"}},"summary":"Get a group","tags":["group"]}},"/health_profile":{"get":{"description":"Get a list of health profiles","operationId":"fetchHealthProfiles","parameters":[{"description":"Patient id to fetch health profile. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, or `filter[organization]`.\n","in":"query","name":"filter[patient]","schema":{"type":"string"}},{"description":"Comma-separated list of group ids. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, or `filter[organization]`.\n","in":"query","name":"filter[groups]","schema":{"type":"string"}},{"description":"Fitbit Plus organization id. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, or `filter[organization]`.\n","in":"query","name":"filter[organization]","schema":{"type":"string"}},{"description":"Page number","in":"query","name":"page[number]","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Page size","in":"query","name":"page[size]","required":false,"schema":{"default":10,"maximum":50,"minimum":0,"type":"integer"}},{"description":"Page limit","in":"query","name":"page[limit]","required":false,"schema":{"default":50,"minimum":0,"type":"integer"}},{"description":"Page cursor","in":"query","name":"page[cursor]","required":false,"schema":{"type":"string"}},{"description":"List of related resources to include in the response","in":"query","name":"include","required":false,"schema":{"enum":["patient","questions"],"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchHealthProfilesResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"},"409":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Invalid Request"}},"summary":"List health profiles","tags":["health profile"]}},"/health_profile/{id}":{"get":{"description":"Get a health profile by id","operationId":"fetchHealthProfile","parameters":[{"description":"Health profile identifier","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"List of related resources to include in the response","in":"query","name":"include","required":false,"schema":{"enum":["patient","questions"],"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchHealthProfileResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"}},"summary":"Get a health profile","tags":["health profile"]}},"/health_profile_answer":{"get":{"description":"Get a list of health profile answers","operationId":"fetchHealthProfileAnswers","parameters":[{"description":"Patient id to fetch healt profile answers. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, or `filter[organization]`.\n","in":"query","name":"filter[patient]","schema":{"type":"string"}},{"description":"Comma-separated list of group ids. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, or `filter[organization]`.\n","in":"query","name":"filter[groups]","schema":{"type":"string"}},{"description":"Fitbit Plus organization id. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, or `filter[organization]`.\n","in":"query","name":"filter[organization]","schema":{"type":"string"}},{"description":"Page number","in":"query","name":"page[number]","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Page size","in":"query","name":"page[size]","required":false,"schema":{"default":50,"maximum":100,"minimum":0,"type":"integer"}},{"description":"Page limit","in":"query","name":"page[limit]","required":false,"schema":{"default":50,"minimum":0,"type":"integer"}},{"description":"Page cursor","in":"query","name":"page[cursor]","required":false,"schema":{"type":"string"}},{"description":"List of related resources to include in the response","in":"query","name":"include","required":false,"schema":{"enum":["patient"],"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchHealthProfileAnswersResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"},"409":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Invalid Request"}},"summary":"List health profile answers","tags":["health profile answer"]}},"/health_profile_answer/{id}":{"get":{"description":"Get a health profile answer by id","operationId":"fetchHealthProfileAnswer","parameters":[{"description":"Health profile answer identifier","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"List of related resources to include in the response","in":"query","name":"include","required":false,"schema":{"enum":["patient"],"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchHealthProfileAnswerResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"}},"summary":"Get a health profile answer","tags":["health profile answer"]}},"/health_profile_question":{"get":{"description":"Get a list of health profile questions","operationId":"fetchHealthProfileQuestions","parameters":[{"description":"Patient id to fetch healt profile questions. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, or `filter[organization]`.\n","in":"query","name":"filter[patient]","schema":{"type":"string"}},{"description":"Comma-separated list of group ids. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, or `filter[organization]`.\n","in":"query","name":"filter[groups]","schema":{"type":"string"}},{"description":"Fitbit Plus organization id. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, or `filter[organization]`.\n","in":"query","name":"filter[organization]","schema":{"type":"string"}},{"description":"List of related resources to include in the response","in":"query","name":"include","required":false,"schema":{"enum":["question_definition","answer"],"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchHealthProfileQuestionsResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"},"409":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Invalid Request"}},"summary":"List health profile questions","tags":["health profile question"]}},"/health_profile_question/{id}":{"get":{"description":"Get a health profile by id","operationId":"fetchHealthProfileQuestion","parameters":[{"description":"Health profile question identifier","in":"path","name":"id","required":true,"schema":{"type":"string"}},{"description":"List of related resources to include in the response","in":"query","name":"include","required":false,"schema":{"enum":["question_definition","answer"],"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchHealthProfileQuestionResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"}},"summary":"Get a health profile question","tags":["health profile question"]}},"/health_question_definition":{"get":{"description":"Get a list of all health question definitions","operationId":"fetchHealthQuestionDefinitions","responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchHealthQuestionDefinitionsResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"},"409":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Invalid Request"}},"summary":"List health question definitions","tags":["health question definition"]}},"/health_question_definition/{id}":{"get":{"description":"Get a health question definition by id","operationId":"fetchHealthQuestionDefinition","parameters":[{"description":"Health question definition identifier","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchHealthQuestionDefinitionResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"}},"summary":"Get a health question definition","tags":["health question definition"]}},"/oauth/token":{"post":{"description":"Create an OAuth 2.0 Bearer token. A valid bearer token is required for all other API requests.\n\nBe sure to set the header `Content-Type: \"application/vnd.api+json\"`. Otherwise, you will get an error\n403 Forbidden. Using `Content-Type: \"application/json\"` is permitted (to support older oauth clients) but when\nusing `application/json` the body should have a body in the following format instead of nesting under\n`data.attributes`:\n```\n{\n \"grant_type\": \"client_credentials\",\n \"client_id\": \"95c78ab2-167f-40b8-8bec-8398d4b87454\",\n \"client_secret\": \"35d18dc9-a3dd-4948-b787-063a490b9354\"\n}\n```\n","operationId":"createToken","parameters":[{"description":"List of related resources to include in the response","in":"query","name":"include","required":false,"schema":{"enum":["groups","organization"],"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTokenRequest"}},"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateTokenRequest"}}},"required":true},"responses":{"201":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateTokenResponse"}}},"description":"Created"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Forbidden"},"409":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Invalid Request"}},"security":[{"OAuth2":["group","organization"]}],"summary":"Create an oauth token","tags":["oauth"]}},"/oauth/token/{id}/groups":{"get":{"description":"Get the list of groups a token can be used to access.","operationId":"fetchTokenGroups","parameters":[{"description":"Token identifier","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchGroupsResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"}},"security":[{"OAuth2":["group","organization"]}],"summary":"Get the groups for a token","tags":["oauth"]}},"/oauth/token/{id}/organization":{"get":{"description":"Get the organization a token can be used to access.","operationId":"fetchTokenOrganization","parameters":[{"description":"Token identifier","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchOrganizationResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"}},"summary":"Get the organization for a token","tags":["oauth"]}},"/organization/{id}":{"get":{"description":"Get an organization record by id.","operationId":"fetchOrganization","parameters":[{"description":"Organization identifier","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchOrganizationResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"}},"summary":"Get an organization","tags":["organization"]}},"/patient":{"get":{"description":"Get a list of patients.","operationId":"fetchPatients","parameters":[{"description":"Comma-separated list of group ids. Note that either `filter[group]` or `filter[organization]` must be specified.","in":"query","name":"filter[groups]","schema":{"type":"string"}},{"description":"Fitbit Plus organization id. Note that either `filter[group]` or `filter[organization]` must be specified.","in":"query","name":"filter[organization]","schema":{"type":"string"}},{"description":"Identifier system (example: \"MyEHR\") - requires a \"filter[identifier][value]\" parameter","in":"query","name":"filter[identifier][system]","schema":{"type":"string"}},{"description":"Identifier value (example: \"12345\") - requires a \"filter[identifier][system]\" parameter","in":"query","name":"filter[identifier][value]","schema":{"type":"string"}},{"description":"If not specified, return all patients. If set to 'true' return only archived patients, if set to 'false', return only patients who are not archived.","in":"query","name":"filter[archived]","schema":{"type":"boolean"}},{"description":"The start (inclusive) and end (exclusive) dates are ISO date and time strings separated by `..`. Example for patients created in November 2017 (America/New_York): `filter[created_at]=2017-11-01T00:00:00-04:00..2017-12-01T00:00:00-05:00`\n","in":"query","name":"filter[created_at]","schema":{"type":"string"}},{"description":"The start (inclusive) and end (exclusive) dates are ISO date and time strings separated by `..`. Example for patients updated in November 2017 (America/New_York): `filter[updated_at]=2017-11-01T00:00:00-04:00..2017-12-01T00:00:00-05:00`\n","in":"query","name":"filter[updated_at]","schema":{"type":"string"}},{"description":"Page number","in":"query","name":"page[number]","required":false,"schema":{"default":1,"type":"integer"}},{"description":"Page size","in":"query","name":"page[size]","required":false,"schema":{"default":10,"maximum":50,"minimum":0,"type":"integer"}},{"description":"Page limit","in":"query","name":"page[limit]","required":false,"schema":{"default":50,"minimum":0,"type":"integer"}},{"description":"Page cursor","in":"query","name":"page[cursor]","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchPatientsResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"},"409":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Invalid Request"}},"summary":"List patients","tags":["patient"]},"post":{"description":"Create a patient record.\n\nExample for creating a patient with a group specified using `meta.query` instead of `id`:\n\n```JSON\n{\n \"data\": {\n \"type\": \"patient\",\n \"attributes\": {\n \"first_name\": \"Andrew\",\n \"last_name\": \"Smith\"\n },\n \"relationships\": {\n \"groups\": {\n \"data\": [\n {\n \"type\": \"group\",\n \"meta\": {\n \"query\": {\n \"organization\": \"58c88de7c93eb96357a87033\",\n \"name\": \"Patients Lead\"\n }\n }\n }\n ]\n }\n }\n }\n}\n```\n","operationId":"createPatient","requestBody":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreatePatientRequest"}}},"required":true},"responses":{"201":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreatePatientResponse"}}},"description":"Created"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Forbidden"},"409":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Invalid Request"}},"summary":"Create a patient","tags":["patient"]},"put":{"description":"Create a new patient or update an existing patient","operationId":"upsertPatient","requestBody":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/UpsertPatientRequest"}}},"required":true},"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreatePatientResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Forbidden"},"409":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Invalid Request"}},"summary":"Upsert patient","tags":["patient"]}},"/patient/{id}":{"get":{"description":"Gets a patient record by id.","operationId":"fetchPatient","parameters":[{"description":"Patient identifier","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchPatientResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/FetchErrorResponse"}}},"description":"Forbidden"}},"summary":"Get a patient","tags":["patient"]},"patch":{"description":"Update a patient record.","operationId":"updatePatient","parameters":[{"description":"Patient identifier","in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/UpdatePatientRequest"}}},"required":true},"responses":{"200":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/UpdatePatientResponse"}}},"description":"OK"},"401":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Unauthorized"},"403":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Forbidden"},"409":{"content":{"application/vnd.api+json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdateErrorResponse"}}},"description":"Invalid Request"}},"summary":"Update a patient","tags":["patient"]}},"/patient/{id}/coaches":{"get":{"description":"Get the list of coaches for a patient.","operationId":"fetchPatientCoaches","parameters":[{"description":"Patient identifier","in":"path","name":"id","required":true,"schema":{"type":"stri