From 756863f298f9e4277863f9e8758e253c5ae95923 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Fri, 11 Oct 2024 22:57:56 -0400 Subject: Return a distinct error when an invite username is in use. I've also aligned channel creation with this (it's 409 Conflict). To make server setup more distinct, it now returns 503 Service Unavailable if setup has not been completed. --- docs/api.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/api.md b/docs/api.md index f91780e..d544689 100644 --- a/docs/api.md +++ b/docs/api.md @@ -10,7 +10,7 @@ Requests that require a JSON body must include a `content-type: application/json ## Initial setup -The `hi` service requires setup before it can enter service. This setup is performed online, via the `hi` API. Any request to an API endpoint before setup has been completed will return a 409 Conflict response, unless the endpoint is documented as allowing requests before setup. +The `hi` service requires setup before it can enter service. This setup is performed online, via the `hi` API. Any request to an API endpoint before setup has been completed will return a 503 Service Unavailable response, unless the endpoint is documented as allowing requests before setup. ### `POST /api/setup` @@ -197,6 +197,10 @@ This endpoint returns a 204 No Content response on success, with a `Set-Cookie` This endpoint returns a 404 Not Found response if the invite ID in the path does not exist, or has already been accepted. +#### Name already used + +This endpoint returns a 409 Conflict response if the requested login name has already been taken. The invite can be re-accepted with a different name. + ## Working with channels Channels are the containers for conversations. The API supports listing channels, creating new channels, and send messages to an existing channel. @@ -224,7 +228,7 @@ Creates a channel. #### On duplicate channel name -Channel names must be unique. If a channel with the same name already exists, this will return a 400 Bad Request error. +Channel names must be unique. If a channel with the same name already exists, this will return a 409 Conflict error. ## Events -- cgit v1.2.3