Given a DELETE request that will delete resource at an integer index, does the possibility of recreation of a resource at that index break strict idempotency?
e.g. a DELETE request is made to /api/resource/123 deletes the resource at 123. Then a post request is made which creates a new resource which can be retrieved by a GET request to the same url.
It seems to me that for the original DELETE to be properly idempotent, the API should never create a new, different, resource with a previously used id, but I can't find a clear reference.
No.
RFC 7231
Notice: a generic client can retry the request; the client doesn't need to know anything about your particular implementation.
That's not at all the case. Think about a static website. Can you, the website owner, delete
foobar.html
? Of course you can. Can you recreate it later? Of course. If that's true, then it ought to be true for remoted editing as well.And if it is true for remote editing of a web site, it should also be true for any other REST API. The point of the uniform interface is that consumers don't need to know if they are talking to a file system, a document store, a database, or some sophisticated service. The job of the API is to act as an integration layer, so that the underlying implementation acts just like the web.