Skip to content

Replace a meal

PUT
/api/v1/meals/{id}
curl --request PUT \
--url http://127.0.0.1:8080/api/v1/meals/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "date": "example", "dishes": [ { "display_name": "example", "entry_id": "example", "id": "example", "leftover_of": "example", "notes": "example", "plain_items": [ { "id": "example", "name": "example", "quantity": "example" } ], "recipe_revision": 1, "scale": "example" } ], "meal_type": "", "name": "example", "notes": "example", "skipped": true }'
id
required
string
If-Match

The current response body revision in double quotes, such as “4”. Do not use the GET response ETag or put revision in the body.

string

The current response body revision in double quotes, such as “4”. Do not use the GET response ETag or put revision in the body.

Media typeapplication/json
object
date
string
/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/
dishes
required
Array<object> | null
>= 1 items <= 50 items
object
display_name
required

A recipe dish named exactly as its recipe takes the recipe’s new title when the recipe is renamed.

string
>= 1 characters <= 200 characters
entry_id
string
id
string
leftover_of

Source dish ID for leftovers. Omit entry_id on this dish to avoid repeating the recipe requirement.

string
<= 201 characters
notes
string
<= 5000 characters
plain_items

Only for a dish without entry_id.

Array<object> | null
<= 100 items
object
id
string
name
required
string
>= 1 characters <= 200 characters
quantity
string
<= 200 characters
recipe_image_url
string
recipe_revision
integer format: int64
>= 1
recipe_status
string
Allowed values: available trashed removed
scale

Positive rational string multiplying the recipe quantities, such as 1/2 for half a batch. This is not a serving count.

string
<= 100 characters
shopping_choices
Array<string> | null
meal_type
string
Allowed values: "" breakfast lunch dinner snack
name
string
<= 200 characters
notes
string
<= 10000 characters
skipped
boolean

OK

Media typeapplication/json
object
created_at
required
string format: date-time
created_by
string
created_by_name
string
date
string
/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/
dishes
required
Array<object> | null
>= 1 items <= 50 items
object
display_name
required

A recipe dish named exactly as its recipe takes the recipe’s new title when the recipe is renamed.

string
>= 1 characters <= 200 characters
entry_id
string
id
string
leftover_of

Source dish ID for leftovers. Omit entry_id on this dish to avoid repeating the recipe requirement.

string
<= 201 characters
notes
string
<= 5000 characters
plain_items

Only for a dish without entry_id.

Array<object> | null
<= 100 items
object
id
string
name
required
string
>= 1 characters <= 200 characters
quantity
string
<= 200 characters
recipe_image_url
string
recipe_revision
integer format: int64
>= 1
recipe_status
string
Allowed values: available trashed removed
scale

Positive rational string multiplying the recipe quantities, such as 1/2 for half a batch. This is not a serving count.

string
<= 100 characters
shopping_choices
Array<string> | null
display_title
required
string
id
required
string
meal_type
string
Allowed values: "" breakfast lunch dinner snack
name
string
<= 200 characters
notes
string
<= 10000 characters
revision
required
integer format: int64
>= 1
skipped
required
boolean
updated_at
required
string format: date-time
updated_by
string
updated_by_name
string
key
additional properties
any

Example

{
"dishes": [
{
"recipe_status": "available"
}
],
"meal_type": ""
}
ETag

Validates this representation, including the recipe and shopping details it reads. If-Match takes the revision instead.

string
Location
string

Bad Request

Media typeapplication/problem+json
object
code

Stable application error code; clients may also use the problem type suffix.

string
detail

A human-readable explanation specific to this occurrence of the problem.

string
errors

Optional list of individual error details

Array<object> | null
object
location

Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’

string
message

Error message text

string
value

The value at the given location

key
additional properties
any
instance

A URI reference that identifies the specific occurrence of the problem.

string format: uri
params

Structured context for the stable error code.

object
key
additional properties
any
status

HTTP status code

integer format: int64
title

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

string
type

A URI reference to human-readable documentation for the error.

string format: uri
default: about:blank
violations
Array<object>
object
code
required
string
location
required
string
params
object
key
additional properties
any
key
additional properties
any

Example

{
"detail": "Property foo is required but is missing.",
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}

No valid session or API token (authentication-required), or the credential sent is invalid (invalid-credentials).

Media typeapplication/problem+json
object
code
required
string
detail
required
string
status
required
integer format: int64
title
required
string
type
required
string
key
additional properties
any

Example generated

{
"code": "example",
"detail": "example",
"status": 1,
"title": "example",
"type": "example"
}

Not Found

Media typeapplication/problem+json
object
code

Stable application error code; clients may also use the problem type suffix.

string
detail

A human-readable explanation specific to this occurrence of the problem.

string
errors

Optional list of individual error details

Array<object> | null
object
location

Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’

string
message

Error message text

string
value

The value at the given location

key
additional properties
any
instance

A URI reference that identifies the specific occurrence of the problem.

string format: uri
params

Structured context for the stable error code.

object
key
additional properties
any
status

HTTP status code

integer format: int64
title

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

string
type

A URI reference to human-readable documentation for the error.

string format: uri
default: about:blank
violations
Array<object>
object
code
required
string
location
required
string
params
object
key
additional properties
any
key
additional properties
any

Example

{
"detail": "Property foo is required but is missing.",
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}

Precondition Failed

Media typeapplication/problem+json
object
code

Stable application error code; clients may also use the problem type suffix.

string
detail

A human-readable explanation specific to this occurrence of the problem.

string
errors

Optional list of individual error details

Array<object> | null
object
location

Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’

string
message

Error message text

string
value

The value at the given location

key
additional properties
any
instance

A URI reference that identifies the specific occurrence of the problem.

string format: uri
params

Structured context for the stable error code.

object
key
additional properties
any
status

HTTP status code

integer format: int64
title

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

string
type

A URI reference to human-readable documentation for the error.

string format: uri
default: about:blank
violations
Array<object>
object
code
required
string
location
required
string
params
object
key
additional properties
any
key
additional properties
any

Example

{
"detail": "Property foo is required but is missing.",
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}

Unprocessable Entity

Media typeapplication/problem+json
object
code

Stable application error code; clients may also use the problem type suffix.

string
detail

A human-readable explanation specific to this occurrence of the problem.

string
errors

Optional list of individual error details

Array<object> | null
object
location

Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’

string
message

Error message text

string
value

The value at the given location

key
additional properties
any
instance

A URI reference that identifies the specific occurrence of the problem.

string format: uri
params

Structured context for the stable error code.

object
key
additional properties
any
status

HTTP status code

integer format: int64
title

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

string
type

A URI reference to human-readable documentation for the error.

string format: uri
default: about:blank
violations
Array<object>
object
code
required
string
location
required
string
params
object
key
additional properties
any
key
additional properties
any

Example

{
"detail": "Property foo is required but is missing.",
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}

Precondition Required

Media typeapplication/problem+json
object
code

Stable application error code; clients may also use the problem type suffix.

string
detail

A human-readable explanation specific to this occurrence of the problem.

string
errors

Optional list of individual error details

Array<object> | null
object
location

Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’

string
message

Error message text

string
value

The value at the given location

key
additional properties
any
instance

A URI reference that identifies the specific occurrence of the problem.

string format: uri
params

Structured context for the stable error code.

object
key
additional properties
any
status

HTTP status code

integer format: int64
title

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

string
type

A URI reference to human-readable documentation for the error.

string format: uri
default: about:blank
violations
Array<object>
object
code
required
string
location
required
string
params
object
key
additional properties
any
key
additional properties
any

Example

{
"detail": "Property foo is required but is missing.",
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}

Internal Server Error

Media typeapplication/problem+json
object
code

Stable application error code; clients may also use the problem type suffix.

string
detail

A human-readable explanation specific to this occurrence of the problem.

string
errors

Optional list of individual error details

Array<object> | null
object
location

Where the error occurred, e.g. ‘body.items[3].tags’ or ‘path.thing-id’

string
message

Error message text

string
value

The value at the given location

key
additional properties
any
instance

A URI reference that identifies the specific occurrence of the problem.

string format: uri
params

Structured context for the stable error code.

object
key
additional properties
any
status

HTTP status code

integer format: int64
title

A short, human-readable summary of the problem type. This value should not change between occurrences of the error.

string
type

A URI reference to human-readable documentation for the error.

string format: uri
default: about:blank
violations
Array<object>
object
code
required
string
location
required
string
params
object
key
additional properties
any
key
additional properties
any

Example

{
"detail": "Property foo is required but is missing.",
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "about:blank"
}