API reference

A broker between wearable data and AI agents. Ask a question; receive a small computed context packet at the level the user's grant allows. Developer requests are signed: HMAC-SHA256 over timestamp\nnonce\nMETHOD\npath\nsha256(body) with your signing secret, a single-use nonce and a 300-second window.

Base URLhttps://api.askwearables.app
VersionAskWearables API 1.0.0, OpenAPI 3.1.0
AuthenticationAn OAuth access token for an agent, or an API key: aw_own_ (owner), aw_dev_ (developer), aw_sync_ (device sync).
Machine-readableopenapi.json

Each endpoint lists the credentials that can call it. Errors and gate decisions are described in the overview, and the packet in packets and levels.

Endpoints

POST /v1/ask

Ask a question in plain language

operationId askOAuth tokenaw_dev_ (signed)signed for developer keys

Parameters

NameInTypeNotes
X-AskWearables-UserheaderstringDeveloper keys: your end user's external id.

With a developer key, also send X-AskWearables-Timestamp, X-AskWearables-Nonce and X-AskWearables-Signature; see signing.

Request body required

FieldTypeNotes
question requiredstringmin length 3; max length 500
purposestringRecorded, never used: the purpose is fixed in the grant.

Responses

StatusDescriptionBody
200OKAskResponse
403Denied, with reasonsAskResponse

POST /v1/query

Run a QuerySpec directly (agents: gated; owner keys: level 3)

operationId queryOAuth tokenaw_dev_ (signed)aw_own_ (level 3)signed for developer keys

Parameters

NameInTypeNotes
X-AskWearables-UserheaderstringDeveloper keys: your end user's external id.

With a developer key, also send X-AskWearables-Timestamp, X-AskWearables-Nonce and X-AskWearables-Signature; see signing.

Request body required

FieldTypeNotes
spec requiredQuerySpec

Responses

StatusDescriptionBody
200OKAskResponse

GET /v1/capabilities

Metrics, operations, levels and this agent's grant

operationId capabilitiesOAuth tokenaw_dev_ (signed)signed for developer keys

Parameters

NameInTypeNotes
X-AskWearables-UserheaderstringDeveloper keys: your end user's external id.

With a developer key, also send X-AskWearables-Timestamp, X-AskWearables-Nonce and X-AskWearables-Signature; see signing.

Responses

StatusDescriptionBody
200OKobject

GET /v1/packets/{packet_id}

A packet this agent received in the last 24 hours

operationId getPacketOAuth tokenaw_dev_ (signed)signed for developer keys

Parameters

NameInTypeNotes
packet_id requiredpathstring
X-AskWearables-UserheaderstringDeveloper keys: your end user's external id.

With a developer key, also send X-AskWearables-Timestamp, X-AskWearables-Nonce and X-AskWearables-Signature; see signing.

Responses

StatusDescriptionBody
200OKPacket
404Not foundobject

GET /v1/receipts

Owner: receipts, newest first, with chain verification

operationId receiptsaw_own_

Parameters

NameInTypeNotes
limitqueryinteger
beforequeryinteger

Responses

StatusDescriptionBody
200OKobject

DELETE /v1/grants/{grant_id}

Owner: revoke a grant

operationId revokeGrantaw_own_

Parameters

NameInTypeNotes
grant_id requiredpathstring

Responses

StatusDescriptionBody
200OKobject

POST /v1/users

Developer: register an end user by your own id

operationId createUseraw_dev_

Request body required

FieldTypeNotes
external_id requiredstring
tzstring

Responses

StatusDescriptionBody
200OKobject

POST /v1/ingest

Push normalized records (sync keys, owner keys, developer keys)

operationId ingestaw_dev_aw_own_aw_sync_

Parameters

NameInTypeNotes
X-AskWearables-UserheaderstringDeveloper keys: your end user's external id.

Request body required

FieldTypeNotes
sourceobject
recordsobject[]max items 2000

Responses

StatusDescriptionBody
200OKobject

GET /v1/usage

Developer: calls, packets and denials per day

operationId usageaw_dev_

Responses

StatusDescriptionBody
200OKany[]

GET /v1/export

Owner: export everything

operationId exportaw_own_

Responses

StatusDescriptionBody
200OKobject

Schemas

QuerySpec

FieldTypeNotes
metrics requiredstring[]one of steps, active_energy, resting_hr, heart_rate, hrv_rmssd, hrv_sdnn, sleep_duration, sleep_efficiency, sleep_stages, spo2, respiratory_rate, skin_temp_deviation, vo2max, weight, workout; min items 1; max items 2
operation requiredstringone of latest, aggregate, trend, compare_to_baseline, compare_periods, threshold_check, correlate, list_sessions
window requiredobjectno other keys
window.start requiredstringpattern ^\d{4}-\d{2}-\d{2}$
window.end requiredstringpattern ^\d{4}-\d{2}-\d{2}$
granularitystringone of day, week
paramsobjectno other keys
params.comparatorstringone of <, <=, >, >=
params.thresholdnumber
params.threshold_unitstring
params.modestringone of any, all, count
params.compare_windowobjectno other keys
params.compare_window.start requiredstringpattern ^\d{4}-\d{2}-\d{2}$
params.compare_window.end requiredstringpattern ^\d{4}-\d{2}-\d{2}$
params.lag_daysintegerone of 0, 1
params.session_kindstringone of workout, sleep
params.statisticstringone of total, mean, min, max

GrantRequest

FieldTypeNotes
purpose requiredstringone of scheduling, training_advice, sleep_coaching, general_wellness, personal_research
metrics requiredstring[]one of steps, active_energy, resting_hr, heart_rate, hrv_rmssd, hrv_sdnn, sleep_duration, sleep_efficiency, sleep_stages, spo2, respiratory_rate, skin_temp_deviation, vo2max, weight, workout, blood_glucose, menstrual_cycle, ecg_classification, breathing_disturbances
max_level requiredintegerone of 0, 1, 2, 3
max_window_days requiredintegermin 1; max 365
daily_packet_budget requiredintegermin 1
days requiredintegermin 1; max 90
return_urlstringformat uri

Finding

FieldTypeNotes
metric requiredstring
statement requiredstring
flagstringone of yes, no, unknown
directionstring
magnitudestring
valuenumber
unitstring
valuesobject[]
unknown_reasonstring

Packet

FieldTypeNotes
packet_version required"1"
packet_id requiredstring
level requiredinteger
operationstringone of latest, aggregate, trend, compare_to_baseline, compare_periods, threshold_check, correlate, list_sessions
metricsstring[]
windowobject
findings requiredFinding[]
data_quality requiredobject
data_quality.freshness_hoursnumber | null
data_quality.coveragenumber | null
data_quality.sourcesstring[]
data_quality.baseline_daysinteger | null
data_quality.caveatsstring[]
as_ofstring
data_version requiredstring
not_medical_advice requiredtrue

AskResponse

FieldTypeNotes
status requiredstringone of ok, denied, unsupported
packetPacket
receipt_idstring
reasonsstring[]
supportedstring[]