@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Fitbit Plus API
@base https://api.twinehealth.com/pub
@version v7.78.1
@auth OAuth2
@endpoints 62
@hint download_for_search
@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)

@group oauth
@endpoint POST /oauth/token
@required {body: map}
@optional {include: any}
@returns(201)
@errors {401, 403, 409}

@endpoint GET /oauth/token/{id}/groups
@required {id: any}
@returns(200)
@errors {401, 403}

@endpoint GET /oauth/token/{id}/organization
@required {id: any}
@returns(200)
@errors {401, 403}

@endgroup

@group organization
@endpoint GET /organization/{id}
@required {id: any}
@returns(200)
@errors {401, 403}

@endgroup

@group group
@endpoint POST /group
@required {body: map}
@returns(201)
@errors {401, 403, 409}

@endpoint GET /group
@required {filter[organization]: any}
@optional {filter[name]: any}
@returns(200)
@errors {401, 403}

@endpoint GET /group/{id}
@required {id: any}
@returns(200)
@errors {401, 403}

@endgroup

@group coach
@endpoint GET /coach
@optional {filter[groups]: any, filter[organization]: any}
@returns(200)
@errors {401, 403}

@endpoint GET /coach/{id}
@required {id: any}
@returns(200)
@errors {401, 403}

@endgroup

@group reward_program
@endpoint POST /reward_program
@required {body: map}
@returns(200)
@errors {401, 403, 409}

@endpoint GET /reward_program
@optional {filter[groups]: any, filter[organization]: any}
@returns(200)
@errors {401, 403}

@endpoint GET /reward_program/{id}
@required {id: any}
@returns(200)
@errors {401, 403}

@endpoint GET /reward_program/{id}/group
@required {id: any}
@returns(200)
@errors {401, 403}

@endgroup

@group action
@endpoint POST /action
@required {body: map}
@returns(201)
@errors {401, 403, 409}

@endpoint GET /action/{id}
@required {id: any}
@returns(200)
@errors {401, 403}

@endpoint PATCH /action/{id}
@required {id: any, body: map}
@returns(200)
@errors {401, 403, 409}

@endgroup

@group bundle
@endpoint POST /bundle
@required {body: map}
@returns(200)
@errors {401, 403, 409}

@endpoint GET /bundle/{id}
@required {id: any}
@returns(200)
@errors {401, 403}

@endpoint PATCH /bundle/{id}
@required {id: any, body: map}
@returns(200)
@errors {401, 403, 409}

@endgroup

@group calendar_event
@endpoint POST /calendar_event
@required {body: map}
@returns(201)
@errors {401, 403, 409}

@endpoint GET /calendar_event
@optional {filter[patient]: any, filter[groups]: any, filter[organization]: any, filter[attendees]: any, filter[type]: any, filter[completed]: any, filter[start_at]: any, filter[end_at]: any, filter[completed_at]: any, filter[created_at]: any, filter[updated_at]: any, page[number]: any, page[size]: any, page[limit]: any, page[cursor]: any, include: any}
@returns(200)
@errors {401, 403, 409}

@endpoint GET /calendar_event/{id}
@required {id: any}
@returns(200)
@errors {401, 403}

@endpoint PATCH /calendar_event/{id}
@required {id: any, body: map}
@returns(200)
@errors {401, 403, 409}

@endpoint DELETE /calendar_event/{id}
@required {id: any}
@returns(200)
@errors {401, 403}

@endgroup

@group calendar_event_response
@endpoint POST /calendar_event_response
@required {body: map}
@returns(201)
@errors {401, 403, 409}

@endgroup

@group email_history
@endpoint GET /email_history
@optional {filter[receiver]: any, filter[sender]: any, filter[emailType]: any, sort: any}
@returns(200)
@errors {401, 403, 409}

@endpoint GET /email_history/{id}
@required {id: any}
@returns(200)
@errors {401, 403}

@endgroup

@group health_profile
@endpoint GET /health_profile
@optional {filter[patient]: any, filter[groups]: any, filter[organization]: any, page[number]: any, page[size]: any, page[limit]: any, page[cursor]: any, include: any}
@returns(200)
@errors {401, 403, 409}

@endpoint GET /health_profile/{id}
@required {id: any}
@optional {include: any}
@returns(200)
@errors {401, 403}

@endgroup

@group health_profile_question
@endpoint GET /health_profile_question
@optional {filter[patient]: any, filter[groups]: any, filter[organization]: any, include: any}
@returns(200)
@errors {401, 403, 409}

@endpoint GET /health_profile_question/{id}
@required {id: any}
@optional {include: any}
@returns(200)
@errors {401, 403}

@endgroup

@group health_profile_answer
@endpoint GET /health_profile_answer
@optional {filter[patient]: any, filter[groups]: any, filter[organization]: any, page[number]: any, page[size]: any, page[limit]: any, page[cursor]: any, include: any}
@returns(200)
@errors {401, 403, 409}

@endpoint GET /health_profile_answer/{id}
@required {id: any}
@optional {include: any}
@returns(200)
@errors {401, 403}

@endgroup

@group health_question_definition
@endpoint GET /health_question_definition
@returns(200)
@errors {401, 403, 409}

@endpoint GET /health_question_definition/{id}
@required {id: any}
@returns(200)
@errors {401, 403}

@endgroup

@group patient_health_metric
@endpoint POST /patient_health_metric
@required {body: map}
@returns(200)
@errors {401, 403, 409}

@endpoint GET /patient_health_metric
@optional {filter[patient]: any, filter[groups]: any, filter[organization]: any, page[number]: any, page[size]: any, page[limit]: any, page[cursor]: any}
@returns(200)
@errors {401, 403, 409}

@endpoint GET /patient_health_metric/{id}
@required {id: any}
@returns(200)
@errors {401, 403}

@endgroup

@group patient
@endpoint POST /patient
@required {body: map}
@returns(201)
@errors {401, 403, 409}

@endpoint GET /patient
@optional {filter[groups]: any, filter[organization]: any, filter[identifier][system]: any, filter[identifier][value]: any, filter[archived]: any, filter[created_at]: any, filter[updated_at]: any, page[number]: any, page[size]: any, page[limit]: any, page[cursor]: any}
@returns(200)
@errors {401, 403, 409}

@endpoint PUT /patient
@required {body: map}
@returns(200)
@errors {401, 403, 409}

@endpoint GET /patient/{id}
@required {id: any}
@returns(200)
@errors {401, 403}

@endpoint PATCH /patient/{id}
@required {id: any, body: map}
@returns(200)
@errors {401, 403, 409}

@endpoint GET /patient/{id}/groups
@required {id: any}
@returns(200)
@errors {401, 403}

@endpoint GET /patient/{id}/coaches
@required {id: any}
@returns(200)
@errors {401, 403}

@endgroup

@group patient_plan_summary
@endpoint GET /patient_plan_summary
@optional {filter[patient]: any, filter[groups]: any, filter[organization]: any, include: any}
@returns(200)
@errors {401, 403}

@endpoint GET /patient_plan_summary/{id}
@required {id: any}
@optional {include: any}
@returns(200)
@errors {401, 403}

@endpoint PATCH /patient_plan_summary/{id}
@required {id: any, body: map}
@returns(200)
@errors {401, 403, 409}

@endgroup

@group result
@endpoint GET /result
@required {filter[patient]: any}
@optional {filter[actions]: any, filter[start_at]: any, filter[end_at]: any, filter[threads]: any, filter[created_at]: any, filter[updated_at]: any, page[number]: any, page[size]: any, page[limit]: any, page[after]: any}
@returns(200)
@errors {401, 403, 409}

@endpoint GET /result/{id}
@required {id: any}
@returns(200)
@errors {401, 403}

@endgroup

@group reward
@endpoint POST /reward
@required {body: map}
@returns(200)
@errors {401, 403, 409}

@endpoint GET /reward
@optional {filter[patient]: any, filter[reward_program_activation]: any, filter[thread]: any, filter[groups]: any, filter[organization]: any}
@returns(200)
@errors {401, 403}

@endpoint GET /reward/{id}
@required {id: any}
@returns(200)
@errors {401, 403}

@endgroup

@group reward_earning
@endpoint POST /reward_earning
@required {body: map}
@returns(200)
@errors {401, 403, 409}

@endpoint GET /reward_earning
@required {filter[groups]: any, filter[patient]: any}
@optional {filter[ready_for_fulfillment]: any}
@returns(200)
@errors {401, 403}

@endpoint GET /reward_earning/{id}
@required {id: any}
@returns(200)
@errors {401, 403}

@endgroup

@group reward_earning_fulfillment
@endpoint POST /reward_earning_fulfillment
@required {body: map}
@returns(200)
@errors {401, 403, 409}

@endpoint GET /reward_earning_fulfillment
@required {filter[patient]: any}
@returns(200)
@errors {401, 403}

@endpoint GET /reward_earning_fulfillment/{id}
@required {id: any}
@returns(200)
@errors {401, 403}

@endgroup

@group reward_program_activation
@endpoint POST /reward_program_activation
@required {body: map}
@returns(200)
@errors {401, 403, 409}

@endpoint GET /reward_program_activation
@optional {filter[patient]: any, filter[groups]: any, filter[organization]: any}
@returns(200)
@errors {401, 403}

@endpoint GET /reward_program_activation/{id}
@required {id: any}
@returns(200)
@errors {401, 403}

@endgroup

@end
