/api. <slug> is a collection slug and <global> is a global slug.
Collections
Auth collections
“Local strategy on” means
auth.disableLocalStrategy is not set. Login, forgot-password and unlock take email by default. With loginWithUsername they take username, or either one when allowEmailLogin is on.
Globals
System
POST /api/reorder is the drag-and-drop endpoint of orderable collections and orderable join fields. It is listed when Payload mounts it, and its collectionSlug is an enum of the documented collections that can be reordered. It needs a logged-in user with update access. A bad body returns 400 with { error }, not the usual error shape.
Preferences
Thepayload-preferences collection is hidden unless includeSystem is on. With it, the spec lists the routes that store admin panel preferences for the current user:
Here the
{id} segment is the preference key, such as nav. Payload matches these routes before the standard ones, so GET /count, POST /validate and POST /access on this collection would read or save a preference named count, validate or access. The spec leaves them out. PATCH /api/payload-preferences/{id} still updates by document ID. Every route needs a logged-in user.
Request and response bodies
Each collection gets a read schema (Posts), a create body (PostsCreate) and an update body (PostsUpdate). A global gets a read schema (GlobalSettings) and an update body (GlobalSettingsUpdate).
The read schema shows a relationship or upload as an ID or the populated document. Create and update bodies take only the ID, at any depth: top level, groups, tabs, arrays and blocks. A polymorphic relationship takes { relationTo, value }, and hasMany takes an array of them. The bodies follow the input types Payload generates, so they leave out join and virtual fields and createdAt/updatedAt, and a field with a defaultValue is optional. A field whose access.create or access.update is a function with no parameters that returns false, like () => false, is left out of that body, because Payload ignores it over REST. This covers the createdBy and updatedBy fields Payload adds. In an update body every field is optional.
The responses follow what Payload sends. Create returns 201 with { doc, message }. Update, delete and duplicate by ID return { doc, message }, and bulk update and delete return { docs, errors, message }. The global update returns { message, result }. A restored version is the document plus message for a collection, and { doc, message } for a global.
Write params
Create, update, delete and duplicate list the query params Payload reads for them:depth, locale, fallback-locale, select, populate, draft and trash. Bulk update and delete also take where. Bulk update also takes limit and sort, which pick how many matching documents it updates and in what order. These params depend on the config:
Payload sets
localizeStatus itself when localization is on and the collection or global has localized fields. Send selectedLocales[] once per locale, for example ?selectedLocales[]=en&selectedLocales[]=de.
Validate
POST /api/<slug>/validate checks data for a new document. The body is required and uses the create body (PostsCreate). POST /api/<slug>/{id}/validate checks changes to a saved document. Its body is optional and uses the update body (PostsUpdate). Payload merges it over the newest draft or the saved document. POST /api/globals/<global>/validate does the same for a global. Nothing is saved.
The response is 200 with { valid, errors }, also when a field is not valid. Each error has message and path, and can have label, locale and tableName. Payload returns 400 for a bad body or locale, 403 without access and 404 when the document does not exist.
The only query param is locale, and it is listed only when localization is on. It takes one or more locales or all. Send it once per locale, for example ?locale=en&locale=de. The security marking follows access.validate, which is access.update unless you set it.
Document access
POST /api/<slug>/access/{id} returns what the current user may do with one document: create, read, update, delete, validate, plus readVersions when the collection has versions and unlock when it sets auth.maxLoginAttempts. Each one is true or { permission, where }. fields is true or the permissions per field. Without {id}, Payload checks the collection, not a saved document. POST /api/globals/<global>/access returns read, update, validate and readVersions for a global. The body is optional: send document data to check access against it instead of the saved document. Payload leaves out an operation the user may not do.
Your own endpoints
Your own endpoints withcustom.openapi are added too. See Custom endpoints.
To drop a single endpoint, use excludeOperations in Filters. It works on every endpoint on this page, your own endpoints included.
New in Payload 4
- Upload instructions. A client can ask Payload where to send the file bytes before it saves the document. Call
POST /api/upload-instructionswithcollectionSlug,filename,filesizeandmimeType. The response tells you where to send the bytes (type: 'http') or which client handler to run (type: 'dispatch'). It also returns afileobject. Send that object as thefilefield of the create or update request. For staged uploads, send the bytes withPUT /api/upload-instructions/{uploadId}. Remove them withDELETE. You must be logged in and have create or update access. - Versions are on by default. Collections and globals have versions unless you set
versions: false. The version endpoints appear in the spec for each of them. - Folders and tags. See Folders and tags.
Folders and tags
In Payload 4, folders and tags are ordinary collections withfolders, tags or hierarchy set. There is no payload-folders system collection and no extra REST endpoint. The plugin documents a folder or tag collection like any other collection, with the standard collection endpoints, and includeSystem does not hide it.
The spec also covers the fields that Payload adds:
Payload fills
_h_slugPath and _h_titlePath only when you ask for them. The GET /api/<slug> and GET /api/<slug>/{id} operations of a folder or tag collection list a computeHierarchyPaths query param for this. Selecting either field with select computes them too. Both fields work in sort. If you rename them with slugPathFieldName or titlePathFieldName, the spec uses your names.
Official plugins
The spec documents the REST endpoints of these official Payload plugins. You don’t need to set anything. The plugin finds an installed plugin by itsslug in config.plugins, and the R2 adapter by its name in config.storage. It documents only the endpoints that are mounted, at the path they are mounted on. An endpoint with its own custom.openapi is documented from that instead.
Each plugin gets one tag. With nestedTags, the tags sit under a Plugins group. A plugin tag with the same name as a collection tag, such as Search, stays under that collection. Rules and functions in excludeOperations and security see these operations with kind: 'plugin' and the package name as plugin. An endpoint mounted on a collection has that collection’s slug, and the plugin documents it only when the collection passes your filters. See Filters.
@payloadcms/plugin-ecommerce
<carts> is the carts collection, found by its /:id/add-item endpoint. <method> is the name of each payment adapter. The Stripe adapter adds paymentIntentID to the confirm body and clientSecret to the initiate response.
@payloadcms/plugin-stripe
/api/stripe/rest is listed when rest is set. Its stripeMethod is an enum of rest.allowedMethods.
@payloadcms/plugin-mcp
The body and response are JSON-RPC messages, single or batched.
@payloadcms/plugin-seo
Each returns
{ result } from your generate function, or an empty string when you set none.
@payloadcms/plugin-search
<search> is searchOverrides.slug, search by default. The collections body field is an enum of the plugin’s collections.
@payloadcms/plugin-multi-tenant
<tenants> is tenantsSlug, tenants by default.
@payloadcms/plugin-import-export
<export> and <import> are the export and import collections the plugin creates. The collectionSlug body field is an enum of the collections they serve.
@payloadcms/storage-r2
Listed when
clientUploads is on. One route takes three steps, chosen by the query params: start the upload, send each part as application/octet-stream, and complete it with the JSON list of parts. If another adapter already uses the path, the storage plugin adds a -N suffix, and the spec uses it.