Releasesv0.1.0
Api referenceEndpointsTags

Record a time tag

POST
/v1/users/{id}/tags

A time tag is an interval that gives context to the user's data: an illness, a trip, jet lag, a vaccination. It is context only: nothing is computed from it. end_at absent or null is a tag still ongoing; close it later with PATCH. start_at and end_at take an RFC 3339 time or a YYYY-MM-DD date (midnight UTC). label and note are free text and are treated as health data: never logged. See docs/time-tags.md.

Authorization

tenantKey
headerAuthorizationBearer <token>

Tenant API key, ohs_sk_ + 43 base62 characters.

Path Parameters

id*string
Formatuuid

Header Parameters

Idempotency-Key?string
Length1 <= length <= 255
Authorization*string

The tenant API key, as a bearer secret.

Request Body

application/json
  1. body
kind*TimeTagKind

The controlled vocabulary of time tags; see docs/time-tags.md.

Value in"illness""injury""travel""jet_lag""vaccination""medication""alcohol""other"
label?|

A short free text. Empty or null is none.

Lengthlength <= 100
start_at*|
end_at?||

After start_at. Absent or null for a tag still ongoing.

timezone?|

An IANA time zone name. Empty or null is none.

Lengthlength <= 64
note?|

Free text, treated as health data. Empty or null is none.

Lengthlength <= 2000
source?string

Who records the tag, for example your app's name. Absent means user.

Match^[A-Za-z0-9._:-]{1,64}$

Response Body

Created.

application/json
  1. response
id*string
Formatuuid
kind*TimeTagKind

The controlled vocabulary of time tags; see docs/time-tags.md.

Value in"illness""injury""travel""jet_lag""vaccination""medication""alcohol""other"
label*|
Lengthlength <= 100
start_at*string
Formatdate-time
end_at*|

Exclusive end; null while the tag is ongoing.

Formatdate-time
timezone*|

An IANA time zone, for example the destination zone of a trip.

note*|
Lengthlength <= 2000
source*string

Who recorded the tag; user unless the creator named itself.

created_at*string
Formatdate-time
updated_at*string
Formatdate-time
curl -X POST 'http://localhost:8080/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/tags' \  -H 'Authorization: Bearer ohs_sk_...' \  -H 'Content-Type: application/json' \  -d '{  "kind": "illness",  "start_at": "2019-08-24T14:15:22Z"}'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "kind": "illness",  "label": "string",  "start_at": "2019-08-24T14:15:22Z",  "end_at": "2019-08-24T14:15:22Z",  "timezone": "Asia/Tokyo",  "note": "string",  "source": "string",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
Edit on GitHub