Skip to main content
An organization is the top of the resource hierarchy — it owns environments, tenants, billing, and the people who work in it. Organization administration is a dashboard operation, so every endpoint here requires a user session.
All endpoints on this page are [User] — they require a signed-in user session and are not available to API keys. See Authentication.

Roles

Members hold one role per organization, which determines what they can do:
RoleCan do
ownerEverything, including deleting the organization and changing roles.
billing_adminManage billing and most administration below ownership.
developerWork with environments, tenants, and content.
viewerRead-only access.
See Members & roles for the full permission matrix.

Endpoints

MethodPathDescriptionAuth
GET/organizationsList organizations the user belongs to, with role[User]
GET/organizations/:idGet a single organization[User]
POST/organizationsCreate an organization[User]
PATCH/organizations/:idUpdate name or status[User]
DELETE/organizations/:idDelete an organization[User]
GET/organizations/:id/membersList members and pending invites[User]
POST/organizations/:id/membersInvite a member by email[User]
POST/organizations/:id/members/roleAssign or change a member’s role[User]
DELETE/organizations/:id/members/:member_idRemove a member[User]
DELETE/organizations/:id/invites/:invite_idRevoke a pending invite[User]

List organizations

GET /organizations Returns every organization the signed-in user belongs to, each with the user’s role in it.
curl "https://api.autosage.ai/api/v1/organizations" \
  -H "Cookie: YOUR_SESSION_COOKIE"

Get an organization

GET /organizations/:id
id
string
required
The organization ID.

Create an organization

POST /organizations Creates an organization and auto-provisions a default environment, a default tenant inside it, and a starting credit balance — so you can begin working immediately.
name
string
required
Display name for the organization.
slug
string
required
Unique URL-safe slug using lowercase letters, numbers, and hyphens.
type
string
business or personal. Defaults to business.
curl -X POST "https://api.autosage.ai/api/v1/organizations" \
  -H "Cookie: YOUR_SESSION_COOKIE" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Inc",
    "slug": "acme-inc",
    "type": "business"
  }'
The creator becomes the owner. AutoSage also provisions a default environment, tenant, and starting credits; use Current caller to discover those resource IDs.

Update an organization

PATCH /organizations/:id Updates the organization’s name or status. Requires an administrative role.
id
string
required
The organization ID.
name
string
New display name.
status
string
New status — active, inactive, or suspended.
Only administrative roles (owner, billing_admin) may update an organization.

Delete an organization

DELETE /organizations/:id Permanently deletes the organization and everything under it.
id
string
required
The organization ID.
Only the owner may delete an organization. This is irreversible and removes all environments, tenants, and content.

List members

GET /organizations/:id/members Returns the organization’s active members (with their roles) and any pending invitations.
id
string
required
The organization ID.
curl "https://api.autosage.ai/api/v1/organizations/ORG_ID/members" \
  -H "Cookie: YOUR_SESSION_COOKIE"

Invite a member

POST /organizations/:id/members Sends an invitation to an email address with an assigned role. The invitee accepts through the invites flow.
id
string
required
The organization ID.
email
string
required
Email address to invite.
role
string
Role to grant on acceptance — billing_admin, developer, or viewer. Defaults to viewer; ownership is assigned separately after the user joins.
curl -X POST "https://api.autosage.ai/api/v1/organizations/ORG_ID/members" \
  -H "Cookie: YOUR_SESSION_COOKIE" \
  -H "Content-Type: application/json" \
  -d '{ "email": "teammate@acme.com", "role": "developer" }'
Only the owner may invite members. Invitations expire after 7 days — see Invites.

Assign a role

POST /organizations/:id/members/role Changes an existing member’s role.
id
string
required
The organization ID.
user_id
string
required
The member’s user ID.
role
string
required
The new role — one of owner, billing_admin, developer, viewer.
Only the owner may change member roles.

Remove a member

DELETE /organizations/:id/members/:member_id Removes a member from the organization, revoking their access immediately.
id
string
required
The organization ID.
member_id
string
required
The member’s user ID.
Only the owner may remove members.

Revoke an invite

DELETE /organizations/:id/invites/:invite_id Cancels a pending invitation before it is accepted.
id
string
required
The organization ID.
invite_id
string
required
The pending invitation ID.
Only the owner may revoke invitations.

Next steps

Members & roles

Understand exactly what each role can do.

Environments

Add environments to isolate dev, staging, and production.

Invites

See how invitees accept and join.