Skip to main content

Records

A record is a piece of non-medical member information. The records API was inspired by FHIR and Airtable, but can be used for a broad range of usecases. Integrators can use records to share data between integrations.

Check out the OpenAPI docs.

Record types

Records are only readable by the admin role by default. To allow reading and manipulation by other roles, record types can be created. These types describe the permissions for a specific type. Integrations will typically create these types on installation.

A future version may also introduce record type schema which will reject invalid incoming data.

Example

If a user can buy credits, we can make the record type Credit. The user should be able to know how much credits they have, but should not be able to grant themselves credits, so let's set the permissions to read only:

POST /record-type?projectId=1

{ "type": "Credit", "permissions": { "user": { "read": true } } }

As an admin, we can now create Credits:

POST /record/Credit?projectId=1

{ "fields": { "value": 5, "orderedAt": "2022-12-12T12:12:12Z" }, "memberId": 1 }

As a user, we can now read how much Credits we have:

GET /record/Credit?projectId=1&actorId=1

[{ "fields": { "value": 5, "orderedAt": "2022-12-12T12:12:12Z" }, "memberId": 1 }]

Filters

You can filter based on type and fields.

To filter based on fields, pass a valid json object to the fields query param.
DONT FORGET TO ENCODE YOUR URL!

Example:

{ "value": 44 }

GET /record?projectId=1&actorId=1&fields=%7B%20%22value%22%3A%2044%20%7D

[{ "fields": { "value": 44, "orderedAt": "2022-12-12T12:12:12Z" }, "memberId": 1 }]