Use links not keys to represent relationships in APIs
Here is the problem with links in a nutshell:<p>> The server is now free to change the format of new URLs at any time without affecting clients (of course, the server must continue to honor all previously-issued URLs).<p>If you have to honor all previously-issued URLs then you aren't <i>changing</i> your format -- you are supporting two formats from now on, the old one and the new one.<p>You can of course tell your users that you will deprecate the old format, but unless you are as powerful as Google your users may prevent you from enforcing a deadline for deprecation.<p>If the URLs in your API responses are FQDNs rather than relative paths, all of this gets significantly harder to deal with.<p>Even if you figured all of that out, links are not idiomatic if your users consume your api via an RPC or GraphQL.