Reference

HTTP status codes

What each status code from the API means.

Errors are RFC 7807 problem details (application/problem+json), with title, status and detail, and, for validation problems, an errors list with every problem found.

StatusWhen
200 OKA read, or a replacement of something that existed.
201 CreatedA new entity, field, view, form, workflow, dashboard, index or resource. Comes with Location (and an ETag for entities and resources).
202 AcceptedA workflow run was queued.
204 No ContentA delete, or an update that removed an entity's last perspective (so deleted it).
206 Partial ContentA Range request for a resource.
304 Not ModifiedIf-None-Match matched the current version.
400 Bad RequestValidation failed (errors lists every problem); an invalid query (with parameter and 1-based position); malformed JSON; an invalid schema change; an invalid view, form, workflow or dashboard; a data source that can't run; a plugin that can't be installed.
401 UnauthorizedA missing, expired or invalid token. Also for a resource that isn't public, whether it exists or not, when the caller isn't signed in.
403 ForbiddenThe caller's roles don't allow it. Includes filtering, sorting or selecting on a field they can't read, and writing to the reserved webparts/ and forms/ resource folders.
404 Not FoundThe entity, field, perspective, index, role, view, form, workflow or dashboard doesn't exist, or the caller can't see it (its existence isn't revealed).
409 ConflictA version conflict with _version in the body (with expectedVersion and currentVersion); a duplicate id; a relationship would be broken (errors says why); a view that's out of date; a file and folder with the same resource name.
412 Precondition FailedA version conflict with If-Match; a resource's If-Match or If-None-Match: * failed.
413 Content Too LargeA resource larger than MaxFileBytes.
507 Insufficient StorageA resource upload would pass MaxBytesPerUser or MaxTotalBytes.

Handling conflicts

A 409 or 412 on a write usually means someone else saved first. Read the entity again, apply your change to the new version, and save with the new ETag. The portal tells the user and lets them discard their changes to see the other version.