Custom domain API feedback

We are using the API to implement an interface to add custom domains for our application.

Currently, the first addition of a new domain results in a 200. If you add the same domain again, it results in a 400. Is this intended? Perhaps it would be better to return a 200 with an objection containing an error code and reason?

Hello! First off, thanks for the API feedback.

It’s semi-intended that we return something in the 4xx range for adding the same domain, since we don’t want the API to be misleading about when it has truly succeeded in ‘creating’ something. It’s not very clear what the issue is from a 400 error though, so we’re considering returning a 409 (Conflict) for that situation instead.

Regardless of the error code, that’s a great point about returning a reason with failures- we’ll be updating this error to return an error payload. I’ll post again here when the API is updated with this!

2 Likes