Handling collisions and upserts
Tag names are unique within a newsletter. By default, creating a tag whose name already exists returns a 400 status code with a name_already_exists code; the existing tag's id is included in the response metadata so you can reuse it:
If you'd rather treat the request as an upsert — "make sure this tag exists, and give it back to me" — provide a X-Buttondown-Collision-Behavior header of overwrite. When a tag with that name already exists, Buttondown updates it with the supplied values and returns it with a 200 status code instead of erroring:
If no tag with that name exists, the request creates one as usual and returns a 201.