Skip to content

Create an organization

Make an organization of your own, which starts preparing its workspace and its billing.

Updated

post

https://cloud.cahaves.com/api/organizations

Authorization

cahaves.cloud.sessionstringcookierequired

The session cookie Cloud sets when a customer signs in to the console with GitHub or Google. It is HttpOnly, so scripts cannot read it, and there are no API keys or tokens yet.

Headers

X-Cloud-Organizationstring<uuid>

The id of the organization the request works in, one the signed-in customer owns. Left out or empty, the request works in their oldest organization. Any other value answers 404 with `reason: "organization"`. A customer with no organization yet gets 409 "Create an organization first." from every route that works in one.

Example: "2f6c8e0a-4b1d-4e7f-9a3c-5d7e9f1b3a5c"

Body

application/jsonrequired

namestringrequired

1 to 80 characters once each run of spaces is one space and the ends are trimmed, with no control characters.

Responses

application/json

The new organization, its workspace being prepared.

organizationobjectrequired

Makes an organization the customer owns, with no projects and its own billing, and starts preparing its workspace, so the answer has workspace_ready: false. List organizations shows when it turns true. This route answers for an account with no organization yet, which is how the console makes the first one.

A normal customer can create their first organization. Additional organizations require Cahaves to enable them on the account; contact Support to request access. An enabled account can own at most 10. Turning permission off preserves existing organizations and blocks further creation. The permission and count are checked under the same account lock, including when two requests arrive together.

A name is 1 to 80 characters once each run of spaces in it is one space and the spaces at either end are dropped, and the answer carries the name as it is kept. No two of the customer's organizations share a name, compared without regard to case; another customer's may have the same one.

StatusSentenceWhen
422Give the organization a name.The name is empty, field is name
422An organization name is at most 80 characters.The name is longer, field is name
422An organization name cannot contain control characters.The name holds one, field is name
422You already have an organization with that name.Another of the customer's organizations has it, field is name
422Contact us to create another organization.The customer already has an organization and additional creation is not enabled; field is null
422You can have up to 10 organizations. Contact support for more.The customer owns 10 already, field is null. It is checked before the name.
409This account is suspended by Cahaves. Contact support to have the suspension lifted.Cahaves has suspended the account, which would hold a new organization with the rest
429Too many new organizations at once. Try again in an hour.10 attempts in the last hour, refused ones included

The new organization is not the one later requests work in until they name it: send its id in X-Cloud-Organization (Authentication). Without the header, requests keep working in the oldest.