Deleting resources
Notation follows the APIs index.
- HTTP verb
MUSTbeDELETE. - API path
SHOULDfollow the pattern/api/v1/{resource plural}/{id}.
Example
DELETE /api/v1/users/62bed180-1f78-45d4-8a56-c996936a2947
Success responses
Upon success, APIs SHOULD return 204 but MAY return 202.
| Status | Description | Response |
|---|---|---|
202 Accepted | The resource is scheduled to be deleted. | The job that was scheduled to delete the resource. |
204 No Content | The resource was deleted. | Nothing. |
Soft deletes
Services MAY support "soft deletes" for any number of reasons. Services that do, SHOULD follow
the following guidelines:
- Delete APIs perform a soft delete by default and read-many APIs exclude soft-deletes by default.
- Read-one APIs
SHOULDreturn404for a soft-deleted resource unless the caller passesincludeDeleted=true. - If callers can request that a delete be "hard", callers pass
permanent=truequery parameter. - If callers can request that soft-deletes be included in responses, callers pass
includeDeleted=truequery parameter. - Soft-deleted resources
SHOULDcarrydeletedByanddeletedDatefields.
Examples
DELETE /api/v1/users/62bed180-1f78-45d4-8a56-c996936a2947?permanent=true
GET /api/v1/users?includeDeleted=true