For the complete documentation index, see llms.txt. This page is also available as Markdown.

Food logs

Create and query an end user's food diary. A food log's id can be used to fetch, update, or delete that entry.

Each operation acts on one end user (End-user identity). Client-token scopes: food_logs:write to create, update, or delete; food_logs:read to list, summarize, or get.

Timestamps and ranges

  • created_at is when the meal was eaten (Days and timezones). Omit it on create to log the meal now, or on update to leave it unchanged.

  • Log a food by sending the food id and serving id from a search or food-analysis result as food_id and serving_id. Pass them back exactly as returned (Identifiers).

  • An update (PATCH) replaces any subset of foods, created_at, and name, and must set at least one of them.

  • The list and the summary take inclusive local calendar dates in an IANA timezone. The list spans at most 60 days and the summary at most 366, grouped by day or by week; a longer range fails with 400 date_range_too_large.

  • Creating a log is not idempotent: check with the list or get operation before you retry a create that timed out. Deleting is idempotent, and an unknown or already-deleted log also returns 204.

Each operation's description states what it costs — see Credits and pricing.

Log foods for a user

post

API key or client token.

Free up to your plan's free-call limit, then 1 credit per 100 calls.

Creates a food log from food + serving ids (from search or food-analysis results). The response echoes the log hydrated with full nutrition — save its id to update or delete the log, or fetch it again with GET /v1.2/food-logs/{log_id}. Not idempotent: verify with the list or get endpoint before retrying a timed-out create.

Callable with a client token carrying the food_logs:write scope.

Authorizations
AuthorizationstringRequired

Your credential, sent as Authorization: Bearer <credential>. Two kinds reach this API, and the prefix tells them apart.

API key (sk-…) — created in the Developer Dashboard, it authenticates your whole account. Use it only where you control the machine — never inside a mobile app or a browser. Every endpoint accepts it.

Client token (ct-…) — a short-lived credential bound to one of your end users, minted from your API key by POST /v1.2/auth/client-tokens on your backend and relayed to the device. Safe to hold on a phone: it expires within 2 hours and acts only as the user it was minted for. Endpoints that open with API key or client token accept one and name the scope it must carry; endpoints that open with API key only refuse it.

Header parameters
January-End-User-IDstringOptional

Your stable ID for the end user whose logs this request reads or writes. Opaque to January — use the same ID your system already uses for them.

CredentialHeaderResult
API key (sk-…)absent400 end_user_id_required
API key (sk-…)presentthe request acts on that end user
Client token (ct-…)absentfilled in from the token
Client token (ct-…)the end user the token is bound toaccepted
Client token (ct-…)any other end user403 end_user_id_mismatch
Body
created_atstring · date-timeOptional

When the meal was eaten — any ISO-8601 offset; stored and returned in UTC with milliseconds. Omitted = now.

Example: 2024-09-13T11:34:56Z
namestring · max: 256OptionalExample: Breakfast
Responses
201

The created log, hydrated with resolved food and nutrition; its id is in the Location header.

application/json
post/v1.2/food-logs
POST /v1.2/food-logs HTTP/1.1
Host: partners.january.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 129

{
  "foods": [
    {
      "food_id": "101963552",
      "serving_id": "68051535",
      "quantity": 1.4
    }
  ],
  "created_at": "2024-09-13T11:34:56Z",
  "name": "Breakfast"
}
{
  "id": "78129823-8ba2-4183-b13b-71f0e963c606",
  "foods": [
    {
      "food_id": "101963552",
      "name": "Greek Yogurt, Plain, Whole Milk",
      "brand_name": null,
      "image_url": null,
      "glycemic_index": 11.3,
      "glycemic_load": 1.4,
      "nutrients": {
        "calories": {
          "value": 300,
          "unit": "g"
        },
        "protein": {
          "value": 300,
          "unit": "g"
        },
        "carbohydrates": {
          "value": 300,
          "unit": "g"
        },
        "net_carbohydrates": {
          "value": 300,
          "unit": "g"
        },
        "total_fat": {
          "value": 300,
          "unit": "g"
        },
        "trans_fat": {
          "value": 300,
          "unit": "g"
        },
        "saturated_fat": {
          "value": 300,
          "unit": "g"
        },
        "fiber": {
          "value": 300,
          "unit": "g"
        },
        "total_sugars": {
          "value": 300,
          "unit": "g"
        },
        "added_sugars": {
          "value": 300,
          "unit": "g"
        },
        "cholesterol": {
          "value": 300,
          "unit": "g"
        },
        "calcium": {
          "value": 300,
          "unit": "g"
        },
        "iron": {
          "value": 300,
          "unit": "g"
        },
        "potassium": {
          "value": 300,
          "unit": "g"
        },
        "sodium": {
          "value": 300,
          "unit": "g"
        },
        "vitamin_d": {
          "value": 300,
          "unit": "g"
        }
      },
      "quantity": 1.4,
      "serving": {
        "id": "34237662",
        "unit": "cup",
        "weight_grams": 60,
        "quantity": 1
      }
    }
  ],
  "created_at": "2024-09-13T11:34:56.000Z",
  "name": "Breakfast"
}

List a user's food logs in a date range

get

API key or client token.

Free up to your plan's free-call limit, then 1 credit per 100 calls.

Returns the logs between start_date and end_date (both inclusive local calendar dates in timezone; the range spans at most 60 days), ordered by timestamp. An empty list is a valid result.

Callable with a client token carrying the food_logs:read scope.

Authorizations
AuthorizationstringRequired

Your credential, sent as Authorization: Bearer <credential>. Two kinds reach this API, and the prefix tells them apart.

API key (sk-…) — created in the Developer Dashboard, it authenticates your whole account. Use it only where you control the machine — never inside a mobile app or a browser. Every endpoint accepts it.

Client token (ct-…) — a short-lived credential bound to one of your end users, minted from your API key by POST /v1.2/auth/client-tokens on your backend and relayed to the device. Safe to hold on a phone: it expires within 2 hours and acts only as the user it was minted for. Endpoints that open with API key or client token accept one and name the scope it must carry; endpoints that open with API key only refuse it.

Query parameters
start_datestring · dateRequired

First local calendar date in timezone, inclusive.

Example: 2024-09-01
end_datestring · dateRequired

Last local calendar date in timezone, inclusive. May equal start_date for a single day. The inclusive range may not exceed 60 calendar days.

Example: 2024-09-08
timezonestringRequired

IANA timezone that defines the local calendar days this range covers. Required: without it the days would be cut in UTC, which silently shifts anything logged near midnight into the wrong day for anyone not on UTC.

Example: America/Los_Angeles
Header parameters
January-End-User-IDstringOptional

Your stable ID for the end user whose logs this request reads or writes. Opaque to January — use the same ID your system already uses for them.

CredentialHeaderResult
API key (sk-…)absent400 end_user_id_required
API key (sk-…)presentthe request acts on that end user
Client token (ct-…)absentfilled in from the token
Client token (ct-…)the end user the token is bound toaccepted
Client token (ct-…)any other end user403 end_user_id_mismatch
Responses
200

The logs in the requested date range, ordered by timestamp; an empty array is a valid result.

application/json
get/v1.2/food-logs
GET /v1.2/food-logs?start_date=2024-09-01&end_date=2024-09-08&timezone=America%2FLos_Angeles HTTP/1.1
Host: partners.january.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "items": [
    {
      "id": "78129823-8ba2-4183-b13b-71f0e963c606",
      "foods": [
        {
          "food_id": "101963552",
          "name": "Greek Yogurt, Plain, Whole Milk",
          "brand_name": null,
          "image_url": null,
          "glycemic_index": 11.3,
          "glycemic_load": 1.4,
          "nutrients": {
            "calories": {
              "value": 300,
              "unit": "g"
            },
            "protein": {
              "value": 300,
              "unit": "g"
            },
            "carbohydrates": {
              "value": 300,
              "unit": "g"
            },
            "net_carbohydrates": {
              "value": 300,
              "unit": "g"
            },
            "total_fat": {
              "value": 300,
              "unit": "g"
            },
            "trans_fat": {
              "value": 300,
              "unit": "g"
            },
            "saturated_fat": {
              "value": 300,
              "unit": "g"
            },
            "fiber": {
              "value": 300,
              "unit": "g"
            },
            "total_sugars": {
              "value": 300,
              "unit": "g"
            },
            "added_sugars": {
              "value": 300,
              "unit": "g"
            },
            "cholesterol": {
              "value": 300,
              "unit": "g"
            },
            "calcium": {
              "value": 300,
              "unit": "g"
            },
            "iron": {
              "value": 300,
              "unit": "g"
            },
            "potassium": {
              "value": 300,
              "unit": "g"
            },
            "sodium": {
              "value": 300,
              "unit": "g"
            },
            "vitamin_d": {
              "value": 300,
              "unit": "g"
            }
          },
          "quantity": 1.4,
          "serving": {
            "id": "34237662",
            "unit": "cup",
            "weight_grams": 60,
            "quantity": 1
          }
        }
      ],
      "created_at": "2024-09-13T11:34:56.000Z",
      "name": "Breakfast"
    }
  ]
}

Summarize a user's food logs over a date range

get

API key or client token.

Aggregates the logs between start_date and end_date (both inclusive local calendar dates in timezone) into per-day or per-week buckets, each with summed nutrients, plus totals for the range and an average per logged day. The range spans at most 366 days — wide enough for a year at a time; the 366-day cap bounds the number of buckets. The buckets tile the whole range in chronological order: a day or week with no logs is still returned, with zero counts, and under group_by=week the first and last buckets are clipped to the dates you asked for. nutrients is sparse, so read logs_count to tell a bucket with no logs from one whose logs could not be resolved.

Callable with a client token carrying the food_logs:read scope.

Authorizations
AuthorizationstringRequired

Your credential, sent as Authorization: Bearer <credential>. Two kinds reach this API, and the prefix tells them apart.

API key (sk-…) — created in the Developer Dashboard, it authenticates your whole account. Use it only where you control the machine — never inside a mobile app or a browser. Every endpoint accepts it.

Client token (ct-…) — a short-lived credential bound to one of your end users, minted from your API key by POST /v1.2/auth/client-tokens on your backend and relayed to the device. Safe to hold on a phone: it expires within 2 hours and acts only as the user it was minted for. Endpoints that open with API key or client token accept one and name the scope it must carry; endpoints that open with API key only refuse it.

Query parameters
start_datestring · dateRequired

First local calendar date in timezone, inclusive.

Example: 2024-09-01
end_datestring · dateRequired

Last local calendar date in timezone, inclusive. May equal start_date for a single day. The inclusive range may not exceed 366 calendar days.

Example: 2024-09-30
timezonestringRequired

IANA timezone that defines the local calendar days this range covers. Required: without it the days would be cut in UTC, which silently shifts anything logged near midnight into the wrong day for anyone not on UTC.

Example: America/Los_Angeles
group_bystring · enumOptional

Bucket size. day is one bucket per local calendar date; week is one per week, with the first and last clipped to the range.

Default: dayPossible values:
week_startstring · enumOptional

Which weekday a week bucket begins on. Ignored when group_by=day, where the response reports week_start: null.

Default: mondayPossible values:
Header parameters
January-End-User-IDstringOptional

Your stable ID for the end user whose logs this request reads or writes. Opaque to January — use the same ID your system already uses for them.

CredentialHeaderResult
API key (sk-…)absent400 end_user_id_required
API key (sk-…)presentthe request acts on that end user
Client token (ct-…)absentfilled in from the token
Client token (ct-…)the end user the token is bound toaccepted
Client token (ct-…)any other end user403 end_user_id_mismatch
Responses
200

The aggregated summary. A range with no logs is a valid result: buckets are still returned, with zero counts.

application/json
group_bystring · enumRequired

The bucket size used, echoing the request.

Example: weekPossible values:
week_startstring · enum · nullableRequired

The weekday week buckets begin on. Always present; null when group_by=day, where it does not apply.

Example: mondayPossible values:
timezonestringRequired

The IANA timezone the buckets were cut in — the canonical spelling of what was requested.

Example: America/Los_Angeles
start_datestring · dateRequired

First local calendar date of the summarized range, echoing the request.

Example: 2024-09-01
end_datestring · dateRequired

Last local calendar date of the summarized range, inclusive.

Example: 2024-09-30
get/v1.2/food-logs/summary
GET /v1.2/food-logs/summary?start_date=2024-09-01&end_date=2024-09-30&timezone=America%2FLos_Angeles HTTP/1.1
Host: partners.january.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "group_by": "week",
  "week_start": "monday",
  "timezone": "America/Los_Angeles",
  "start_date": "2024-09-01",
  "end_date": "2024-09-30",
  "buckets": [
    {
      "start_date": "2024-09-01",
      "end_date": "2024-09-07",
      "logs_count": 5,
      "days_with_logs": 3,
      "nutrients": {
        "calories": {
          "value": 300,
          "unit": "g"
        },
        "protein": {
          "value": 300,
          "unit": "g"
        },
        "carbohydrates": {
          "value": 300,
          "unit": "g"
        },
        "net_carbohydrates": {
          "value": 300,
          "unit": "g"
        },
        "total_fat": {
          "value": 300,
          "unit": "g"
        },
        "trans_fat": {
          "value": 300,
          "unit": "g"
        },
        "saturated_fat": {
          "value": 300,
          "unit": "g"
        },
        "fiber": {
          "value": 300,
          "unit": "g"
        },
        "total_sugars": {
          "value": 300,
          "unit": "g"
        },
        "added_sugars": {
          "value": 300,
          "unit": "g"
        },
        "cholesterol": {
          "value": 300,
          "unit": "g"
        },
        "calcium": {
          "value": 300,
          "unit": "g"
        },
        "iron": {
          "value": 300,
          "unit": "g"
        },
        "potassium": {
          "value": 300,
          "unit": "g"
        },
        "sodium": {
          "value": 300,
          "unit": "g"
        },
        "vitamin_d": {
          "value": 300,
          "unit": "g"
        }
      }
    }
  ],
  "totals": {
    "logs_count": 41,
    "days_with_logs": 28,
    "nutrients": {
      "calories": {
        "value": 300,
        "unit": "g"
      },
      "protein": {
        "value": 300,
        "unit": "g"
      },
      "carbohydrates": {
        "value": 300,
        "unit": "g"
      },
      "net_carbohydrates": {
        "value": 300,
        "unit": "g"
      },
      "total_fat": {
        "value": 300,
        "unit": "g"
      },
      "trans_fat": {
        "value": 300,
        "unit": "g"
      },
      "saturated_fat": {
        "value": 300,
        "unit": "g"
      },
      "fiber": {
        "value": 300,
        "unit": "g"
      },
      "total_sugars": {
        "value": 300,
        "unit": "g"
      },
      "added_sugars": {
        "value": 300,
        "unit": "g"
      },
      "cholesterol": {
        "value": 300,
        "unit": "g"
      },
      "calcium": {
        "value": 300,
        "unit": "g"
      },
      "iron": {
        "value": 300,
        "unit": "g"
      },
      "potassium": {
        "value": 300,
        "unit": "g"
      },
      "sodium": {
        "value": 300,
        "unit": "g"
      },
      "vitamin_d": {
        "value": 300,
        "unit": "g"
      }
    }
  },
  "average_per_logged_day": {
    "nutrients": {
      "calories": {
        "value": 300,
        "unit": "g"
      },
      "protein": {
        "value": 300,
        "unit": "g"
      },
      "carbohydrates": {
        "value": 300,
        "unit": "g"
      },
      "net_carbohydrates": {
        "value": 300,
        "unit": "g"
      },
      "total_fat": {
        "value": 300,
        "unit": "g"
      },
      "trans_fat": {
        "value": 300,
        "unit": "g"
      },
      "saturated_fat": {
        "value": 300,
        "unit": "g"
      },
      "fiber": {
        "value": 300,
        "unit": "g"
      },
      "total_sugars": {
        "value": 300,
        "unit": "g"
      },
      "added_sugars": {
        "value": 300,
        "unit": "g"
      },
      "cholesterol": {
        "value": 300,
        "unit": "g"
      },
      "calcium": {
        "value": 300,
        "unit": "g"
      },
      "iron": {
        "value": 300,
        "unit": "g"
      },
      "potassium": {
        "value": 300,
        "unit": "g"
      },
      "sodium": {
        "value": 300,
        "unit": "g"
      },
      "vitamin_d": {
        "value": 300,
        "unit": "g"
      }
    }
  }
}

Get a food log

get

API key or client token.

Free up to your plan's free-call limit, then 1 credit per 100 calls.

Fetches one food log by the id returned when it was created.

Callable with a client token carrying the food_logs:read scope.

Authorizations
AuthorizationstringRequired

Your credential, sent as Authorization: Bearer <credential>. Two kinds reach this API, and the prefix tells them apart.

API key (sk-…) — created in the Developer Dashboard, it authenticates your whole account. Use it only where you control the machine — never inside a mobile app or a browser. Every endpoint accepts it.

Client token (ct-…) — a short-lived credential bound to one of your end users, minted from your API key by POST /v1.2/auth/client-tokens on your backend and relayed to the device. Safe to hold on a phone: it expires within 2 hours and acts only as the user it was minted for. Endpoints that open with API key or client token accept one and name the scope it must carry; endpoints that open with API key only refuse it.

Path parameters
log_idstringRequired

The log id returned when the log was created.

Example: 78129823-8ba2-4183-b13b-71f0e963c606Pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Header parameters
January-End-User-IDstringOptional

Your stable ID for the end user whose logs this request reads or writes. Opaque to January — use the same ID your system already uses for them.

CredentialHeaderResult
API key (sk-…)absent400 end_user_id_required
API key (sk-…)presentthe request acts on that end user
Client token (ct-…)absentfilled in from the token
Client token (ct-…)the end user the token is bound toaccepted
Client token (ct-…)any other end user403 end_user_id_mismatch
Responses
200

The requested food log, hydrated with resolved food and nutrition.

application/json
idstring · nullableRequired

Save this id to update or delete the log. Null only when the upstream sent a log with no id — such a log cannot be addressed.

Example: 78129823-8ba2-4183-b13b-71f0e963c606
created_atstring · date-timeRequired

When the meal was eaten. UTC, with milliseconds.

Example: 2024-09-13T11:34:56.000Z
namestring · nullableRequired

Null when no name was given.

Example: Breakfast
get/v1.2/food-logs/{log_id}
GET /v1.2/food-logs/{log_id} HTTP/1.1
Host: partners.january.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "78129823-8ba2-4183-b13b-71f0e963c606",
  "foods": [
    {
      "food_id": "101963552",
      "name": "Greek Yogurt, Plain, Whole Milk",
      "brand_name": null,
      "image_url": null,
      "glycemic_index": 11.3,
      "glycemic_load": 1.4,
      "nutrients": {
        "calories": {
          "value": 300,
          "unit": "g"
        },
        "protein": {
          "value": 300,
          "unit": "g"
        },
        "carbohydrates": {
          "value": 300,
          "unit": "g"
        },
        "net_carbohydrates": {
          "value": 300,
          "unit": "g"
        },
        "total_fat": {
          "value": 300,
          "unit": "g"
        },
        "trans_fat": {
          "value": 300,
          "unit": "g"
        },
        "saturated_fat": {
          "value": 300,
          "unit": "g"
        },
        "fiber": {
          "value": 300,
          "unit": "g"
        },
        "total_sugars": {
          "value": 300,
          "unit": "g"
        },
        "added_sugars": {
          "value": 300,
          "unit": "g"
        },
        "cholesterol": {
          "value": 300,
          "unit": "g"
        },
        "calcium": {
          "value": 300,
          "unit": "g"
        },
        "iron": {
          "value": 300,
          "unit": "g"
        },
        "potassium": {
          "value": 300,
          "unit": "g"
        },
        "sodium": {
          "value": 300,
          "unit": "g"
        },
        "vitamin_d": {
          "value": 300,
          "unit": "g"
        }
      },
      "quantity": 1.4,
      "serving": {
        "id": "34237662",
        "unit": "cup",
        "weight_grams": 60,
        "quantity": 1
      }
    }
  ],
  "created_at": "2024-09-13T11:34:56.000Z",
  "name": "Breakfast"
}

Update a food log

patch

API key or client token.

Free up to your plan's free-call limit, then 1 credit per 100 calls.

Replaces any subset of the log: foods, created_at, name. Omitted fields are left unchanged.

Callable with a client token carrying the food_logs:write scope.

Authorizations
AuthorizationstringRequired

Your credential, sent as Authorization: Bearer <credential>. Two kinds reach this API, and the prefix tells them apart.

API key (sk-…) — created in the Developer Dashboard, it authenticates your whole account. Use it only where you control the machine — never inside a mobile app or a browser. Every endpoint accepts it.

Client token (ct-…) — a short-lived credential bound to one of your end users, minted from your API key by POST /v1.2/auth/client-tokens on your backend and relayed to the device. Safe to hold on a phone: it expires within 2 hours and acts only as the user it was minted for. Endpoints that open with API key or client token accept one and name the scope it must carry; endpoints that open with API key only refuse it.

Path parameters
log_idstringRequired

The log id returned when the log was created.

Example: 78129823-8ba2-4183-b13b-71f0e963c606Pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Header parameters
January-End-User-IDstringOptional

Your stable ID for the end user whose logs this request reads or writes. Opaque to January — use the same ID your system already uses for them.

CredentialHeaderResult
API key (sk-…)absent400 end_user_id_required
API key (sk-…)presentthe request acts on that end user
Client token (ct-…)absentfilled in from the token
Client token (ct-…)the end user the token is bound toaccepted
Client token (ct-…)any other end user403 end_user_id_mismatch
Body
created_atstring · date-timeOptional

When the meal was eaten — any ISO-8601 offset; stored and returned in UTC with milliseconds. Omit to leave it unchanged.

Example: 2024-09-13T11:34:56Z
namestring · max: 256OptionalExample: Breakfast
Responses
200

The updated log, hydrated with resolved food and nutrition, reflecting the applied changes.

application/json
idstring · nullableRequired

Save this id to update or delete the log. Null only when the upstream sent a log with no id — such a log cannot be addressed.

Example: 78129823-8ba2-4183-b13b-71f0e963c606
created_atstring · date-timeRequired

When the meal was eaten. UTC, with milliseconds.

Example: 2024-09-13T11:34:56.000Z
namestring · nullableRequired

Null when no name was given.

Example: Breakfast
patch/v1.2/food-logs/{log_id}
PATCH /v1.2/food-logs/{log_id} HTTP/1.1
Host: partners.january.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 129

{
  "foods": [
    {
      "food_id": "101963552",
      "serving_id": "68051535",
      "quantity": 1.4
    }
  ],
  "created_at": "2024-09-13T11:34:56Z",
  "name": "Breakfast"
}
{
  "id": "78129823-8ba2-4183-b13b-71f0e963c606",
  "foods": [
    {
      "food_id": "101963552",
      "name": "Greek Yogurt, Plain, Whole Milk",
      "brand_name": null,
      "image_url": null,
      "glycemic_index": 11.3,
      "glycemic_load": 1.4,
      "nutrients": {
        "calories": {
          "value": 300,
          "unit": "g"
        },
        "protein": {
          "value": 300,
          "unit": "g"
        },
        "carbohydrates": {
          "value": 300,
          "unit": "g"
        },
        "net_carbohydrates": {
          "value": 300,
          "unit": "g"
        },
        "total_fat": {
          "value": 300,
          "unit": "g"
        },
        "trans_fat": {
          "value": 300,
          "unit": "g"
        },
        "saturated_fat": {
          "value": 300,
          "unit": "g"
        },
        "fiber": {
          "value": 300,
          "unit": "g"
        },
        "total_sugars": {
          "value": 300,
          "unit": "g"
        },
        "added_sugars": {
          "value": 300,
          "unit": "g"
        },
        "cholesterol": {
          "value": 300,
          "unit": "g"
        },
        "calcium": {
          "value": 300,
          "unit": "g"
        },
        "iron": {
          "value": 300,
          "unit": "g"
        },
        "potassium": {
          "value": 300,
          "unit": "g"
        },
        "sodium": {
          "value": 300,
          "unit": "g"
        },
        "vitamin_d": {
          "value": 300,
          "unit": "g"
        }
      },
      "quantity": 1.4,
      "serving": {
        "id": "34237662",
        "unit": "cup",
        "weight_grams": 60,
        "quantity": 1
      }
    }
  ],
  "created_at": "2024-09-13T11:34:56.000Z",
  "name": "Breakfast"
}

Delete a food log

delete

API key or client token.

Free up to your plan's free-call limit, then 1 credit per 100 calls.

Idempotent: deleting an unknown or already-deleted log answers the same 204, so it is safe to retry.

Callable with a client token carrying the food_logs:write scope.

Authorizations
AuthorizationstringRequired

Your credential, sent as Authorization: Bearer <credential>. Two kinds reach this API, and the prefix tells them apart.

API key (sk-…) — created in the Developer Dashboard, it authenticates your whole account. Use it only where you control the machine — never inside a mobile app or a browser. Every endpoint accepts it.

Client token (ct-…) — a short-lived credential bound to one of your end users, minted from your API key by POST /v1.2/auth/client-tokens on your backend and relayed to the device. Safe to hold on a phone: it expires within 2 hours and acts only as the user it was minted for. Endpoints that open with API key or client token accept one and name the scope it must carry; endpoints that open with API key only refuse it.

Path parameters
log_idstringRequired

The log id returned when the log was created.

Example: 78129823-8ba2-4183-b13b-71f0e963c606Pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
Header parameters
January-End-User-IDstringOptional

Your stable ID for the end user whose logs this request reads or writes. Opaque to January — use the same ID your system already uses for them.

CredentialHeaderResult
API key (sk-…)absent400 end_user_id_required
API key (sk-…)presentthe request acts on that end user
Client token (ct-…)absentfilled in from the token
Client token (ct-…)the end user the token is bound toaccepted
Client token (ct-…)any other end user403 end_user_id_mismatch
Responses
204

The log was deleted; empty body. Idempotent — deleting an already-deleted or unknown log also answers 204.

No content

delete/v1.2/food-logs/{log_id}
DELETE /v1.2/food-logs/{log_id} HTTP/1.1
Host: partners.january.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Last updated

Was this helpful?