Releasesv0.1.0
Api referenceEndpointsTags

Change a time tag

PATCH
/v1/users/{id}/tags/{tag_id}

Absent members stay as they are; null clears label, timezone, note or end_at (null end_at reopens the tag). kind and start_at cannot be null, and source cannot change. The tag after the change is checked as a whole: end_at must stay after start_at. A body that changes nothing returns the tag as it is.

Authorization

tenantKey
headerAuthorizationBearer <token>

Tenant API key, ohs_sk_ + 43 base62 characters.

Path Parameters

id*string
Formatuuid
tag_id*string

The id of a time tag of this user.

Formatuuid

Header Parameters

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?|
Lengthlength <= 100
start_at?|
end_at?||null
timezone?|
Lengthlength <= 64
note?|
Lengthlength <= 2000

Response Body

The tag after the change.

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 PATCH 'http://localhost:8080/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/tags/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Authorization: Bearer ohs_sk_...' \  -H 'Content-Type: application/json' \  -d '{}'
{  "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