409 avatar_handle_taken, and how a failed avatar frees its handle

avatar_handle_taken means the handle is in use. When an avatar creation fails at reservation, the old handle is renamed so you can reuse it. Code-verified.

4 min readSume
All posts

When you get avatar_handle_taken

POST /v1/avatar-1.0/generate checks whether your workspace and owner already have an avatar with that handle. If one exists, the API marks the new creation job failed with code avatar_handle_taken and answers 409. The details include handle and, on the lookup path, the avatar_id of the avatar that holds it.

A race can reach the same error: if two creates insert the same handle at once, the database rejects the second on a unique violation, and the API reports avatar_handle_taken for it as well.

What a failed creation does to the handle

If an avatar record was created but the job then fails at reservation, for example from a credit reservation error or 429 queue_full, the API marks the avatar failed and releases the handle. The released handle is renamed to the first 17 characters of the old handle, then _failed_, then the last 8 characters of the avatar id.

That rename frees the clean handle for your next attempt. You do not need to delete anything.

Handle states after a creation attempt
SituationHTTP resultCan you reuse the handle?
Another avatar already holds it409 avatar_handle_takenNo, pick another
Creation failed at reservationError such as 429 queue_fullYes, the handle is released
Avatar is processing or readyHandle heldNo

A safe retry pattern

  • On 429 queue_full, wait and resend with the same Idempotency-Key and the same handle.
  • On 409 avatar_handle_taken, read the avatar_id in details first. It may be your own earlier avatar, which you can use as is.
  • Never resend a changed body under an old Idempotency-Key; that is a different 409.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume