Set nutrition figures

Send your own calories, protein, carbs and fat per dish to fill the figures the restaurant left empty in Tamr.

PUT/api/v1/catalog/nutritionServer API · secret key

Your own figures, per serving, by Tamr's dishId or your externalId. They only fill the gaps: a figure the restaurant typed in Tamr always wins, and Tamr never estimates one. A field left out is unchanged and null removes your figure. Up to 500 rows, all or nothing: a refused call is a 400 whose data.rows gives each bad row's reason (unknown_dish, unknown_external_id, out_of_range, duplicate). updated counts the dishes whose figures changed.

Per serving: calories (0 to 10,000) and proteinGrams, carbsGrams, fatGrams (0 to 2,000 each). A field left out is unchanged; null removes your figure. Your figures only fill the gaps: a figure the restaurant typed in Tamr always wins.

Authentication

Server API. Send a secret API key with the Catalog ids (SDK) permission (catalog:sdk) as Authorization: Bearer <key>. Secret keys are made in Settings > API keys by an owner or admin. Keep them on your server: no browser can call this route.

Request body

FieldTypeRequiredDescription
dishesarray of objectYes1 to 500 items.
dishes[].dishIdstringNo1 to 200 characters.
dishes[].externalIdstringNo1 to 200 characters.
dishes[].caloriesinteger or nullNo-9,007,199,254,740,991 to 9,007,199,254,740,991.
dishes[].proteinGramsinteger or nullNo-9,007,199,254,740,991 to 9,007,199,254,740,991.
dishes[].carbsGramsinteger or nullNo-9,007,199,254,740,991 to 9,007,199,254,740,991.
dishes[].fatGramsinteger or nullNo-9,007,199,254,740,991 to 9,007,199,254,740,991.

Response

FieldTypeDescription
updatedinteger0 to 9,007,199,254,740,991.

Example

curl -X PUT https://tamr.link/api/v1/catalog/nutrition \
  -H "Authorization: Bearer $TAMR_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{
  "dishes": [
    {
      "externalId": "SKU-1042",
      "calories": 640,
      "proteinGrams": 42
    },
    {
      "dishId": "cmdish0001",
      "carbsGrams": 18,
      "fatGrams": null
    }
  ]
}'

Example response

{
  "updated": 3
}

Errors

Every error has the same body; switch on data.code. See Errors and rate limits.

data.codeStatusWhat to do
other401No secret key, or one Tamr doesn't accept: wrong, revoked, or made by someone who is no longer an owner or admin.
other403The key doesn't have the catalog:sdk permission.
invalid_request400A field doesn't match the spec. The message says which.
rate_limited429Wait retryAfter seconds (also in the Retry-After header), then try again.
sdk_disabled403The SDK isn't switched on for this restaurant. Ask Tamr.