Thrive AI Health
Api reference

Create or fully replace a meal log (enqueues async analysis)

Full-replacement semantics — each `PUT` sends the complete log payload, including on update. Each meal has at most one log. A successful `PUT` enqueues asynchronous analysis; the log's `insight_headline` and `insight_body` populate when the job completes. Status code is `201 Created` on first write, `200 OK` on replacement of an existing log.

PUT
/v1/users/{user_id}/meals/{meal_id}/log

Authorization

MemberBearer
AuthorizationBearer <token>

Member-scoped JWT minted by POST /v1/auth/token. Required on every /v1/users/{user_id}/... route; the token's sub claim must match the path user_id.

In: header

Path Parameters

user_id*User Id
Formatuuid
meal_id*Meal Id
Formatuuid

Header Parameters

org-id?string|null
x-user-id?string|null
x-request-id?string|null
traceparent?string|null
Idempotency-Key?|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X PUT "https://loading/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/meals/497f6eca-6276-4993-bfeb-53cbbbba6f08/log" \  -H "Content-Type: application/json" \  -d '{    "logged_at": "2019-08-24T14:15:22Z",    "title": "string"  }'
{
  "data": {
    "meal_log_id": "c2c0b876-c911-4853-aa93-0fff1aaf6753",
    "meal_id": "e8f91bba-a1fd-4250-b513-e8e22cf6d4ad",
    "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
    "logged_at": "2019-08-24T14:15:22Z",
    "title": "string",
    "notes": "string",
    "calories": 0,
    "protein": 0,
    "carbohydrates": 0,
    "fat": 0,
    "insight_headline": "string",
    "insight_body": "string"
  }
}
{
  "data": {
    "meal_log_id": "c2c0b876-c911-4853-aa93-0fff1aaf6753",
    "meal_id": "e8f91bba-a1fd-4250-b513-e8e22cf6d4ad",
    "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
    "logged_at": "2019-08-24T14:15:22Z",
    "title": "string",
    "notes": "string",
    "calories": 0,
    "protein": 0,
    "carbohydrates": 0,
    "fat": 0,
    "insight_headline": "string",
    "insight_body": "string"
  }
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}