{"note":"OpenAPI conversion -- returning structured metadata","name":"twinehealth-com","description":"Fitbit Plus API","version":"v7.78.1","base_url":"https://api.twinehealth.com/pub","endpoints":62,"raw":"@lap v0.3\n# Machine-readable API spec. Each @endpoint block is one API call.\n@api Fitbit Plus API\n@base https://api.twinehealth.com/pub\n@version v7.78.1\n@auth OAuth2\n@endpoints 62\n@hint download_for_search\n@toc oauth(3), organization(1), group(3), coach(2), reward_program(4), action(3), bundle(3), calendar_event(5), calendar_event_response(1), email_history(2), health_profile(2), health_profile_question(2), health_profile_answer(2), health_question_definition(2), patient_health_metric(3), patient(7), patient_plan_summary(3), result(2), reward(3), reward_earning(3), reward_earning_fulfillment(3), reward_program_activation(3)\n\n@group oauth\n@endpoint POST /oauth/token\n@desc Create an oauth token\n@required {body: map}\n@optional {include: any # List of related resources to include in the response}\n@returns(201) Created\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /oauth/token/{id}/groups\n@desc Get the groups for a token\n@required {id: any # Token identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endpoint GET /oauth/token/{id}/organization\n@desc Get the organization for a token\n@required {id: any # Token identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endgroup\n\n@group organization\n@endpoint GET /organization/{id}\n@desc Get an organization\n@required {id: any # Organization identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endgroup\n\n@group group\n@endpoint POST /group\n@desc Create a group\n@required {body: map}\n@returns(201) Created\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /group\n@desc List groups\n@required {filter[organization]: any # Organization identifier}\n@optional {filter[name]: any # Group name}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endpoint GET /group/{id}\n@desc Get a group\n@required {id: any # Group identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endgroup\n\n@group coach\n@endpoint GET /coach\n@desc List coaches\n@optional {filter[groups]: any # Comma-separated list of group ids. Note that one of the following filters must be specified: `filter[groups]`, `filter[organization]`., filter[organization]: any # Fitbit Plus organization id. Note that one of the following filters must be specified: `filter[groups]`, `filter[organization]`.}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endpoint GET /coach/{id}\n@desc Get a coach\n@required {id: any # Coach identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endgroup\n\n@group reward_program\n@endpoint POST /reward_program\n@desc Create a reward program\n@required {body: map}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /reward_program\n@desc List reward programs\n@optional {filter[groups]: any # Comma-separated list of group identifiers. Note that one of the following filters must be specified: `filter[groups]`, `filter[organization]`., filter[organization]: any # Fitbit Plus organization id. Note that one of the following filters must be specified: `filter[groups]`, `filter[organization]`.}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endpoint GET /reward_program/{id}\n@desc Get a reward program\n@required {id: any # Reward program identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endpoint GET /reward_program/{id}/group\n@desc Get group for a reward program\n@required {id: any # Reward program identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endgroup\n\n@group action\n@endpoint POST /action\n@desc Create action\n@required {body: map}\n@returns(201) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /action/{id}\n@desc Get an action\n@required {id: any # Action identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endpoint PATCH /action/{id}\n@desc Update an action\n@required {id: any # Action identifier, body: map}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endgroup\n\n@group bundle\n@endpoint POST /bundle\n@desc Create bundle\n@required {body: map}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /bundle/{id}\n@desc Get a bundle\n@required {id: any # Bundle identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endpoint PATCH /bundle/{id}\n@desc Update a bundle\n@required {id: any # Bundle identifier, body: map}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endgroup\n\n@group calendar_event\n@endpoint POST /calendar_event\n@desc Create calendar event\n@required {body: map}\n@returns(201) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /calendar_event\n@desc List calendar events\n@optional {filter[patient]: any # 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]`., filter[groups]: any # 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]`., filter[organization]: any # Fitbit Plus organization id. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, `filter[organization]`, or `filter[attendees]`., filter[attendees]: any # 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]`., filter[type]: any # Calendar event type, filter[completed]: any # 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., filter[start_at]: any # 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`, filter[end_at]: any # 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`, filter[completed_at]: any # 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`, filter[created_at]: any # 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`, filter[updated_at]: any # 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`, page[number]: any # Page number, page[size]: any # Page size, page[limit]: any # Page limit, page[cursor]: any # Page cursor, include: any # List of related resources to include in the response}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /calendar_event/{id}\n@desc Get a calendar event\n@required {id: any # Calendar event identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endpoint PATCH /calendar_event/{id}\n@desc Update a calendar event\n@required {id: any # Calendar event identifier, body: map}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint DELETE /calendar_event/{id}\n@desc Delete a calendar event\n@required {id: any # Calendar event identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endgroup\n\n@group calendar_event_response\n@endpoint POST /calendar_event_response\n@desc Create calendar event response\n@required {body: map}\n@returns(201) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endgroup\n\n@group email_history\n@endpoint GET /email_history\n@desc List email histories\n@optional {filter[receiver]: any # Fitbit Plus user id of email recipient. Required if filter[sender] is not defined., filter[sender]: any # Fitbit Plus user id of email sender. Required if filter[receiver] is not defined., filter[emailType]: any # Type of email, sort: any # valid sorts:   * send_time - ascending by send_time   * -send_time - descending by send_time}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /email_history/{id}\n@desc Get an email history\n@required {id: any # Email history identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endgroup\n\n@group health_profile\n@endpoint GET /health_profile\n@desc List health profiles\n@optional {filter[patient]: any # Patient id to fetch health profile. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, or `filter[organization]`., filter[groups]: any # Comma-separated list of group ids. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, or `filter[organization]`., filter[organization]: any # Fitbit Plus organization id. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, or `filter[organization]`., page[number]: any # Page number, page[size]: any # Page size, page[limit]: any # Page limit, page[cursor]: any # Page cursor, include: any # List of related resources to include in the response}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /health_profile/{id}\n@desc Get a health profile\n@required {id: any # Health profile identifier}\n@optional {include: any # List of related resources to include in the response}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endgroup\n\n@group health_profile_question\n@endpoint GET /health_profile_question\n@desc List health profile questions\n@optional {filter[patient]: any # Patient id to fetch healt profile questions. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, or `filter[organization]`., filter[groups]: any # Comma-separated list of group ids. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, or `filter[organization]`., filter[organization]: any # Fitbit Plus organization id. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, or `filter[organization]`., include: any # List of related resources to include in the response}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /health_profile_question/{id}\n@desc Get a health profile question\n@required {id: any # Health profile question identifier}\n@optional {include: any # List of related resources to include in the response}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endgroup\n\n@group health_profile_answer\n@endpoint GET /health_profile_answer\n@desc List health profile answers\n@optional {filter[patient]: any # Patient id to fetch healt profile answers. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, or `filter[organization]`., filter[groups]: any # Comma-separated list of group ids. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, or `filter[organization]`., filter[organization]: any # Fitbit Plus organization id. Note that one of the following filters must be specified: `filter[patient]`, `filter[group]`, or `filter[organization]`., page[number]: any # Page number, page[size]: any # Page size, page[limit]: any # Page limit, page[cursor]: any # Page cursor, include: any # List of related resources to include in the response}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /health_profile_answer/{id}\n@desc Get a health profile answer\n@required {id: any # Health profile answer identifier}\n@optional {include: any # List of related resources to include in the response}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endgroup\n\n@group health_question_definition\n@endpoint GET /health_question_definition\n@desc List health question definitions\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /health_question_definition/{id}\n@desc Get a health question definition\n@required {id: any # Health question definition identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endgroup\n\n@group patient_health_metric\n@endpoint POST /patient_health_metric\n@desc Create patient health metrics\n@required {body: map}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /patient_health_metric\n@desc List patient health metrics\n@optional {filter[patient]: any # Filter the patient health metrics for a specified patient. Note that one of the following filters must be specified: `filter[patient]`, `filter[groups]`, `filter[organization]`., filter[groups]: any # Comma-separated list of group ids. Note that one of the following filters must be specified: `filter[patient]`, `filter[groups]`, `filter[organization]`., filter[organization]: any # Fitbit Plus organization id. Note that one of the following filters must be specified: `filter[patient]`, `filter[groups]`, `filter[organization]`., page[number]: any # Page number, page[size]: any # Page size, page[limit]: any # Page limit, page[cursor]: any # Page cursor}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /patient_health_metric/{id}\n@desc Get a patient health metric\n@required {id: any # Patient health metric identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endgroup\n\n@group patient\n@endpoint POST /patient\n@desc Create a patient\n@required {body: map}\n@returns(201) Created\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /patient\n@desc List patients\n@optional {filter[groups]: any # Comma-separated list of group ids. Note that either `filter[group]` or `filter[organization]` must be specified., filter[organization]: any # Fitbit Plus organization id. Note that either `filter[group]` or `filter[organization]` must be specified., filter[identifier][system]: any # Identifier system (example: \"MyEHR\") - requires a \"filter[identifier][value]\" parameter, filter[identifier][value]: any # Identifier value (example: \"12345\") - requires a \"filter[identifier][system]\" parameter, filter[archived]: any # 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., filter[created_at]: any # 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`, filter[updated_at]: any # 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`, page[number]: any # Page number, page[size]: any # Page size, page[limit]: any # Page limit, page[cursor]: any # Page cursor}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint PUT /patient\n@desc Upsert patient\n@required {body: map}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /patient/{id}\n@desc Get a patient\n@required {id: any # Patient identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endpoint PATCH /patient/{id}\n@desc Update a patient\n@required {id: any # Patient identifier, body: map}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /patient/{id}/groups\n@desc List groups for a patient\n@required {id: any # Patient identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endpoint GET /patient/{id}/coaches\n@desc List coaches for a patient\n@required {id: any # Patient identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endgroup\n\n@group patient_plan_summary\n@endpoint GET /patient_plan_summary\n@desc List patient plan summaries\n@optional {filter[patient]: any # Patient id to fetch plan summary for. Note that one of the following filters must be specified: `filter[patient]`, `filter[groups]`, `filter[organization]`., filter[groups]: any # Comma-separated list of group ids. Note that one of the following filters must be specified: `filter[patient]`, `filter[groups]`, `filter[organization]`., filter[organization]: any # Fitbit Plus organization id. Note that one of the following filters must be specified: `filter[patient]`, `filter[groups]`, `filter[organization]`., include: any # List of related resources to include in the response}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endpoint GET /patient_plan_summary/{id}\n@desc Get the plan summary for a patient\n@required {id: any # Plan summary identifier}\n@optional {include: any # List of related resources to include in the response}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endpoint PATCH /patient_plan_summary/{id}\n@desc Update a plan summary\n@required {id: any # Plan summary identifier, body: map}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endgroup\n\n@group result\n@endpoint GET /result\n@desc List patient health results\n@required {filter[patient]: any # Filter the patient health results for a specified patient}\n@optional {filter[actions]: any # A comma-separated list of action identifiers, filter[start_at]: any # Filter results that occurred after the passed ISO date and time string, filter[end_at]: any # Filter results that occurred before the passed ISO date and time string, filter[threads]: any # A comma-separated list of thread identifiers, filter[created_at]: any # The start (inclusive) and end (exclusive) dates are ISO date and time strings separated by `..`. Example for results created in November 2017 (America/New_York): `filter[created_at]=2017-11-01T00:00:00-04:00..2017-12-01T00:00:00-05:00`, filter[updated_at]: any # The start (inclusive) and end (exclusive) dates are ISO date and time strings separated by `..`. Example for results updated in November 2017 (America/New_York): `filter[updated_at]=2017-11-01T00:00:00-04:00..2017-12-01T00:00:00-05:00`, page[number]: any # Page number, page[size]: any # Page size, page[limit]: any # Page limit, page[after]: any # Page cursor}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /result/{id}\n@desc Get a patient health result\n@required {id: any # Patient health result identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endgroup\n\n@group reward\n@endpoint POST /reward\n@desc Create a reward\n@required {body: map}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /reward\n@desc List rewards\n@optional {filter[patient]: any # Patient identifier. Note that one of the following filters must be specified: `filter[patient]`, `filter[groups]`, `filter[organization]`., filter[reward_program_activation]: any # Reward program activation identifier, filter[thread]: any # Thread identifier, filter[groups]: any # Comma-separated list of group ids. Note that one of the following filters must be specified: `filter[patient]`, `filter[groups]`, `filter[organization]`., filter[organization]: any # Fitbit Plus organization id. Note that one of the following filters must be specified: `filter[patient]`, `filter[groups]`, `filter[organization]`.}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endpoint GET /reward/{id}\n@desc Get a reward\n@required {id: any # Reward identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endgroup\n\n@group reward_earning\n@endpoint POST /reward_earning\n@desc Create a reward earning\n@required {body: map}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /reward_earning\n@desc List reward earnings\n@required {filter[groups]: any # Group identifiers, filter[patient]: any # Patient identifier}\n@optional {filter[ready_for_fulfillment]: any # If true, only returns those reward earnings for which ready_for_fulfillment is true and fulfilled_at is null. If false, only returns those reward earnings for which ready_for_fulfillment is false and fulfilled_at is null.}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endpoint GET /reward_earning/{id}\n@desc Get a reward earning\n@required {id: any # Reward earning identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endgroup\n\n@group reward_earning_fulfillment\n@endpoint POST /reward_earning_fulfillment\n@desc Create a reward earning fulfillment\n@required {body: map}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /reward_earning_fulfillment\n@desc List reward earning fulfillments\n@required {filter[patient]: any # Patient identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endpoint GET /reward_earning_fulfillment/{id}\n@desc Get a reward earning fulfillment\n@required {id: any # Reward earning fulfillment identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endgroup\n\n@group reward_program_activation\n@endpoint POST /reward_program_activation\n@desc Create a reward program activation\n@required {body: map}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden, 409: Invalid Request}\n\n@endpoint GET /reward_program_activation\n@desc List reward program activations\n@optional {filter[patient]: any # Patient identifier. Note that one of the following filters must be specified: `filter[patient]`, `filter[groups]`, `filter[organization]`., filter[groups]: any # Comma-separated list of group ids. Note that one of the following filters must be specified: `filter[patient]`, `filter[groups]`, `filter[organization]`., filter[organization]: any # Fitbit Plus organization id. Note that one of the following filters must be specified: `filter[patient]`, `filter[groups]`, `filter[organization]`.}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endpoint GET /reward_program_activation/{id}\n@desc Get a reward program activation\n@required {id: any # Reward program activation identifier}\n@returns(200) OK\n@errors {401: Unauthorized, 403: Forbidden}\n\n@endgroup\n\n@end\n"}