Record the user's own ratings
1 to 100 self reports: how the person feels, their mood, stress, energy, sleep
quality, muscle soreness, the effort of a session or pain, each a whole number on the
kind's scale (docs/self-reports.md). Each report is stored as a quantity sample of type
reported_<kind> from the source self_report, read back like any other sample
(/samples, /samples/stats, FHIR with category survey, exports). Sending a report
again with the same id replaces its value, also when start_at moved. The reports
go through the same processing as an upload, so the answer is 202. A tenant key records
reports for any user of the tenant; a user token with scope upload only for its own
user, and another user is a 404. Values are health data: never logged, never quoted in
an error. While the user's self reports are being deleted the answer is 409 and nothing
is kept.
AuthorizationBearer <token>Tenant API key, ohs_sk_ + 43 base62 characters.
id*stringuuidIdempotency-Key?string1 <= length <= 255application/json- body
reports*array<>1 <= items <= 100Stored, and queued for processing.
application/json- response
reports*array<>The reports as stored, in request order, each with its id.
duplicate*booleantrue when these exact reports had already been received.
curl -X POST 'http://localhost:8080/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/self-reports' \ -H 'Authorization: Bearer ohs_sk_...' \ -H 'Content-Type: application/json' \ -d '{ "reports": [ { "kind": "feeling", "value": 0, "start_at": "2019-08-24T14:15:22Z" } ]}'{ "reports": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "kind": "feeling", "type": "reported_feeling", "value": 0, "start_at": "2019-08-24T14:15:22Z", "end_at": "2019-08-24T14:15:22Z", "timezone": "string" } ], "duplicate": true}