Skip to main content

TRAK-API-DOCS (1.0.0)

Download OpenAPI specification:Download

TRAK public integration API. Every endpoint requires authentication with an access token (OAuth2 Bearer or Token) in the Authorization header.

Physios

Endpoints to give access to a physio or activate/deactivate access on platform.

Create Physio

Create a physiotherapist. Requires an authenticated user with superAdmin permission on the team. The username is derived from the email (or from the integration identifier with a team prefix); it is not sent in the body.

Authorizations:
BearerToken
Request Body schema: application/json
email
required
string
name
string
surname
string
domicilio
string
nif
string
phone
string
center
string
city
string
send_email
boolean

If true, sends a welcome email to the physiotherapist.

integration_id
string

External identifier of the physiotherapist. Only for teams that integrate by identifier.

Responses

Request samples

Content type
application/json
{
  • "email": "physio_username@trak.es",
  • "name": "Physio Name",
  • "surname": "Surname",
  • "domicilio": "Madrid",
  • "nif": "11111111A",
  • "phone": "666666666",
  • "center": "Medical Center X",
  • "city": "Madrid",
  • "send_email": false,
  • "integration_id": "physio-123"
}

Response samples

Content type
application/json
{
  • "id": 10,
  • "name": "Physio Name",
  • "surname": "Surname",
  • "email": "physio_username@trak.es",
  • "domicilio": "Madrid",
  • "nif": "11111111A",
  • "phone": "666666666",
  • "center": "Medical Center X",
  • "city": "Madrid",
  • "integration_id": "physio-123"
}

Activate/Deactivate/Edit Physio

Activate/deactivate or edit a physiotherapist. Requires a superAdmin user on the same team. When deactivating, the patients can be transferred with transfer_patients_to_physio.

Authorizations:
BearerToken
path Parameters
physio_id
required
string

Physiotherapist username (email or identifier with a team prefix).

Request Body schema: application/json
active
required
boolean

true to activate, false to deactivate the physiotherapist's access.

email
string
name
string
surname
string
domicilio
string
nif
string
phone
string
center
string
city
string
transfer_patients_to_physio
string

When deactivating, email of the physiotherapist to transfer the patients to.

on_edit_send_email
boolean

If true, notifies the changes by email. Defaults to true.

Responses

Request samples

Content type
application/json
{
  • "active": false,
  • "email": "lira+physio_new1@trak.es",
  • "name": "Antonio",
  • "surname": "Lira",
  • "domicilio": "Cordoba",
  • "nif": "459429492S",
  • "phone": "658309867",
  • "center": "Medical Center X",
  • "city": "Cordoba",
  • "transfer_patients_to_physio": "otro_physio@trak.es",
  • "on_edit_send_email": true
}

Response samples

Content type
application/json
{
  • "active": true,
  • "name": "Antonio",
  • "surname": "Lira",
  • "email": "lira+physio_new1@trak.es",
  • "domicilio": "Cordoba",
  • "nif": "459429492S",
  • "phone": "658309867",
  • "center": "Medical Center X",
  • "city": "Cordoba",
  • "patients_transferred_count": 3
}

Access Token

Obtain temporary tokens to generate embedded frontend views.

Get Token

Returns a temporary token for a physiotherapist or a patient, used to generate embedded frontend views. Requires OAuth2 (Bearer) authentication.

Authorizations:
Bearer
path Parameters
integration_id
required
string

Identifier (email or integration id) of the physiotherapist or patient the token is requested for.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Protocols

Management of protocols and their assignment to patients.

List Protocols

Lists protocols. Besides the parameters shown, it supports other filters (body_region, favourite, materials, typologies, fase_protocol, name, right_left, n_exercises).

Authorizations:
BearerToken
query Parameters
patient_id
string

Patient identifier. If provided, returns the protocols assigned to that patient; otherwise, the physiotherapist's protocol templates.

date_start
string

Start date (ISO 8601). Filters protocols in session on that date. Requires patient_id.

date_end
string

End date (ISO 8601). Requires patient_id.

active
boolean

Filters by whether the protocol assignment to the patient is active or not. Requires patient_id.

Responses

Response samples

Content type
application/json
{
  • "count": 12,
  • "next": null,
  • "previous": null,
  • "results": [
    ]
}

Create protocol from template

Assigns a protocol template (protocol_id) to a patient (patient_id), scheduling the sessions in days. The endpoint also supports other modes (create a new template or a custom protocol by sending name and exercises).

Authorizations:
BearerToken
query Parameters
patient_id
string

Identifier of the patient to assign the protocol to.

Request Body schema: application/json
protocol_id
required
number

ID of the protocol template to assign.

days
required
Array of strings

Session dates (ISO 8601) to schedule.

physio_id
string

Physiotherapist to assign (optional).

type_protocol
string

Responses

Request samples

Content type
application/json
{
  • "protocol_id": 45705,
  • "days": [
    ],
  • "physio_id": "550e8400-e29b-41d4-a716-446655440000",
  • "type_protocol": "rehabilitation"
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Protocol for right shoulder tendinitis",
  • "patient_id": "lira@trak.es",
  • "sesions": [
    ]
}

Retrieve Protocol

Retrieves a protocol by its ID, with the full list of exercises.

Authorizations:
BearerToken
path Parameters
protocol_id
required
string
query Parameters
patient_id
string

Patient identifier. If provided, the assigned sessions are included.

date_start
string

Start date (ISO 8601). Requires patient_id.

date_end
string

End date (ISO 8601). Requires patient_id.

active
boolean

Filters by whether the protocol assignment to the patient is active or not. Requires patient_id.

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "name": "Protocol for right shoulder tendinitis",
  • "description": "Rehabilitation protocol.",
  • "body_region": "cervical",
  • "fase_protocol": "initial",
  • "n_exercises": 10,
  • "active": true,
  • "favourite": false,
  • "exercises": [],
  • "sesions": {
    }
}

Patients

Create, retrieve, edit and delete patients.

List Patients

Lists the patients of the authenticated physiotherapist. Supports filtering by query params and pagination.

Authorizations:
BearerToken

Responses

Response samples

Content type
application/json
{
  • "count": 42,
  • "previous": null,
  • "results": [
    ]
}

Create Patient

Creates a patient assigned to the physiotherapist indicated in careManager. The body follows a simplified HL7/FHIR-like format.

Authorizations:
BearerToken
Request Body schema: application/json
resourceType
string
identifier
required
string

Patient identifier (usually the email).

mrn
number

Medical record number.

Array of objects
telecom
string
phone
number
gender
string
birthDate
string
injury
string
commentary
string
required
Array of objects

Physiotherapist responsible for the patient.

document_type
string
document_number
string
email
string
language
string

Patient language. Defaults to 'es'.

object

Episode to associate with the patient (optional).

Responses

Request samples

Content type
application/json
{
  • "resourceType": "Patient",
  • "identifier": "lira@trak.es",
  • "mrn": 893629,
  • "name": [
    ],
  • "telecom": "lira@trak.es",
  • "phone": 666666666,
  • "gender": "male",
  • "birthDate": "2024-08-01",
  • "injury": "Tendinitis",
  • "commentary": "The patient had an injury while playing basketball; will need at least 3 weeks of rehabilitation.",
  • "careManager": [
    ],
  • "document_type": "DNI",
  • "document_number": "11111111A",
  • "email": "lira@trak.es",
  • "language": "es",
  • "episode": {
    }
}

Response samples

Content type
application/json
{
  • "id": 25654,
  • "email": "lira@trak.es",
  • "user_id": "lira@trak.es"
}

Retrieve Patient

Retrieves a patient by identifier.

Authorizations:
BearerToken
path Parameters
user_patient_id
required
string

Patient username (email or identifier with a team prefix).

Responses

Response samples

Content type
application/json
{
  • "id": 25654,
  • "username": "lira@trak.es",
  • "email": "lira@trak.es",
  • "name": "Antonio",
  • "surname": "Lira",
  • "phone": "666666666",
  • "gender": "male",
  • "bday": "2024-08-01",
  • "injury": "Tendinitis",
  • "physio": 10,
  • "commentary": "Injury while playing basketball.",
  • "active": true,
  • "mrn": 893629,
  • "document_type": "DNI",
  • "document_number": "11111111A"
}

Edit Patient

Edits a patient. Returns 204 with no content on success.

Authorizations:
BearerToken
path Parameters
user_patient_id
required
string

Patient username (email or identifier with a team prefix).

Request Body schema: application/json
name
string
surname
string
email
string
phone
string
gender
string
bday
string
injury
string
commentary
string
mrn
number
document_type
string
document_number
string
country_code
string
active
boolean
physio
string

Username of the physiotherapist to reassign the patient to.

Responses

Request samples

Content type
application/json
{
  • "name": "Antonio",
  • "surname": "Lira",
  • "email": "lira@trak.com",
  • "phone": "666666666",
  • "gender": "male",
  • "bday": "2024-08-01",
  • "injury": "Tendinitis",
  • "commentary": "Will need at least 3 weeks of rehabilitation.",
  • "mrn": 893629,
  • "document_type": "DNI",
  • "document_number": "11111111A",
  • "country_code": "ES",
  • "active": true,
  • "physio": "physio@trak.es"
}

Delete Patient

Soft delete of the patient: it is marked as deleted without removing its data.

Authorizations:
BearerToken
path Parameters
user_patient_id
required
string

Patient username (email or identifier with a team prefix).

Responses