Account
Get the signed-in customer
Who the session belongs to, their organizations, and the one the request works in.
Updated
https://cloud.cahaves.com/api/me
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"
Responses
application/json
The signed-in customer.
idstring<uuid>required
namestringrequired
rolestringrequired
Allowed values: "customer"
emailstring<email>required
realmstringrequired
Allowed values: "customers"
statusstringrequired
`suspended` while Cahaves holds a suspension, or while the account state job processes a lifted suspension or a reinstated ban. The account can return to active while a blocked service is still being retried. A banned account never reaches an answer: every request it makes answers 401.
Allowed values: "active""suspended"
picturestring<uri> | nullrequired
The account's picture at the provider it last signed in with.
providersstring[]required
The sign-in providers connected to the account, sorted.
organizationsobject[]required
Every organization the customer owns, oldest first. Empty until they create one.
workspace_readybooleanrequired
Whether the current organization's workspace has been prepared. False with no organization.
current_organizationobject | nullrequired
The organization this request works in, or null for a customer with none.
can_create_organizationbooleanrequired
Whether another organization can be created now, given permission, count and account standing. A first organization needs no approval.
multiple_organizations_enabledbooleanrequired
Whether Cahaves has enabled additional organizations. False for new accounts.
The answer is the customer object itself rather than an envelope, as Get the billing account and Get this month are too.
organizations lists every organization the customer owns, oldest first, each as List organizations answers it. current_organization is the one this request works in: the one X-Cloud-Organization names, or the oldest without the header. A header that names none of the customer's answers 404 with reason: "organization" here as everywhere (Authentication).
A new account has no organization: organizations is empty, current_organization is null and workspace_ready is false, and every route that works in an organization answers 409 with "Create an organization first." until Create an organization makes one.
current_organization alone also carries billing_stop, whether its paid services are stopped for billing, as Get the billing account answers it, so a client can say so wherever it is, and archives_kept, how many of its services archived for billing still have their final backups kept (List archived services). The entries of organizations carry neither.
Check workspace_ready before creating anything. It is the current organization's: until it is true, creating a project or a service there answers 409 with "Your workspace is still being prepared." providers lists the sign-in providers connected to the account, and both it and picture come from the account's sign-in, not from Cloud.