Skip to content

docs: document allowCreate for PUT upsert#2307

Open
soyuka wants to merge 1 commit into
api-platform:4.3from
soyuka:docs/put-allow-create-upsert
Open

docs: document allowCreate for PUT upsert#2307
soyuka wants to merge 1 commit into
api-platform:4.3from
soyuka:docs/put-allow-create-upsert

Conversation

@soyuka

@soyuka soyuka commented Jun 16, 2026

Copy link
Copy Markdown
Member

Context

Follow-up to api-platform/core#8303. A PUT request to a non-existent item returns 404 Not Found by default. The Put operation has an allowCreate property that enables upsert behavior (update if found, create otherwise, 201 Created on creation) — but this was undocumented.

Changes

  • Add an Upsert: Creating a Resource With PUT section to core/operations.md with PHP/YAML/XML examples for allowCreate: true.
  • Fix the misleading mention in laravel/index.md that implied enabling PUT alone supports upsert; now links to the new section.

Closes api-platform/core#8303

PUT to a missing item returns 404 by default. The `allowCreate: true`
option on the Put operation enables upsert (create when not found,
201 response), but it was undocumented.

Add an "Upsert" section to core/operations.md with PHP/YAML/XML
examples, and fix the misleading Laravel mention that implied enabling
PUT alone supports upsert.

Closes #8303
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upsert on PUT configurable?

1 participant