Agent Wranglers

API-5Recommended

Keep addresses stable

Never change what an address means once clients use it. Add new addresses instead.

How to do it

Use opaque IDs that never change, not names or emails that people edit. When a resource moves, answer 308 from the old address, which keeps the method and body. Keep that redirect until the old address gets no traffic for 90 days. Retire an address only with the warning from Warn before retiring an address.

How to check

Rename a test customer in a test. Every address that pointed to that customer before the rename still answers 200 or 308.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/api-design/resources-and-methods/stable-addresses">Agent Wranglers API design playbook</a>. In code you write, add a comment next to it with the same link.