Auth Organization
Top-level organization operations and permission checks.
Top-level organization operations are documented here. Invitation and member sub-surfaces are split into:
Endpoints and Methods
auth.organization.create()->POST /organization/createauth.organization.update()->POST /organization/updateauth.organization.delete()->POST /organization/deleteauth.organization.setActive()->POST /organization/set-activeauth.organization.list()->GET /organization/listauth.organization.getFull()->GET /organization/get-full-organizationauth.organization.checkSlug()->POST /organization/check-slugauth.organization.leave()->POST /organization/leaveauth.organization.listUserInvitations()->GET /organization/list-user-invitationsauth.organization.hasPermission()->POST /organization/has-permission
Examples
ATHENA_AUTH_BASE_URL="http://localhost:3001/api/auth"
ATHENA_AUTH_TOKEN="<bearer-token>"
# Adjust payload fields using the OpenAPI schema in this page.
# auth.organization.create() -> POST /organization/create
curl -X POST "$ATHENA_AUTH_BASE_URL/organization/create" \
-H "content-type: application/json" \
-H "authorization: Bearer $ATHENA_AUTH_TOKEN" \
-d '{"...":"See OpenAPI requestBody schema"}'
# auth.organization.update() -> POST /organization/update
curl -X POST "$ATHENA_AUTH_BASE_URL/organization/update" \
-H "content-type: application/json" \
-H "authorization: Bearer $ATHENA_AUTH_TOKEN" \
-d '{"...":"See OpenAPI requestBody schema"}'
# auth.organization.delete() -> POST /organization/delete
curl -X POST "$ATHENA_AUTH_BASE_URL/organization/delete" \
-H "content-type: application/json" \
-H "authorization: Bearer $ATHENA_AUTH_TOKEN" \
-d '{"...":"See OpenAPI requestBody schema"}'
# auth.organization.setActive() -> POST /organization/set-active
curl -X POST "$ATHENA_AUTH_BASE_URL/organization/set-active" \
-H "content-type: application/json" \
-H "authorization: Bearer $ATHENA_AUTH_TOKEN" \
-d '{"...":"See OpenAPI requestBody schema"}'
# auth.organization.list() -> GET /organization/list
curl -X GET "$ATHENA_AUTH_BASE_URL/organization/list" \
-H "authorization: Bearer $ATHENA_AUTH_TOKEN"
# auth.organization.getFull() -> GET /organization/get-full-organization
curl -X GET "$ATHENA_AUTH_BASE_URL/organization/get-full-organization" \
-H "authorization: Bearer $ATHENA_AUTH_TOKEN"
# auth.organization.checkSlug() -> POST /organization/check-slug
curl -X POST "$ATHENA_AUTH_BASE_URL/organization/check-slug" \
-H "content-type: application/json" \
-H "authorization: Bearer $ATHENA_AUTH_TOKEN" \
-d '{"...":"See OpenAPI requestBody schema"}'
# auth.organization.leave() -> POST /organization/leave
curl -X POST "$ATHENA_AUTH_BASE_URL/organization/leave" \
-H "content-type: application/json" \
-H "authorization: Bearer $ATHENA_AUTH_TOKEN" \
-d '{"...":"See OpenAPI requestBody schema"}'
# auth.organization.listUserInvitations() -> GET /organization/list-user-invitations
curl -X GET "$ATHENA_AUTH_BASE_URL/organization/list-user-invitations" \
-H "authorization: Bearer $ATHENA_AUTH_TOKEN"
# auth.organization.hasPermission() -> POST /organization/has-permission
curl -X POST "$ATHENA_AUTH_BASE_URL/organization/has-permission" \
-H "content-type: application/json" \
-H "authorization: Bearer $ATHENA_AUTH_TOKEN" \
-d '{"...":"See OpenAPI requestBody schema"}'use reqwest::Client;
use serde_json::json;
let base_url = "http://localhost:3001/api/auth";
let token = "<bearer-token>";
let http = Client::new();
// Adjust payload fields using the OpenAPI schema in this page.
// auth.organization.create() -> POST /organization/create
let response = http
.post(format!("{base_url}/organization/create"))
.bearer_auth(token)
.json(&json!({
"...": "See OpenAPI requestBody schema"
}))
.send()
.await?;
let _ = response.error_for_status()?;
// auth.organization.update() -> POST /organization/update
let response = http
.post(format!("{base_url}/organization/update"))
.bearer_auth(token)
.json(&json!({
"...": "See OpenAPI requestBody schema"
}))
.send()
.await?;
let _ = response.error_for_status()?;
// auth.organization.delete() -> POST /organization/delete
let response = http
.post(format!("{base_url}/organization/delete"))
.bearer_auth(token)
.json(&json!({
"...": "See OpenAPI requestBody schema"
}))
.send()
.await?;
let _ = response.error_for_status()?;
// auth.organization.setActive() -> POST /organization/set-active
let response = http
.post(format!("{base_url}/organization/set-active"))
.bearer_auth(token)
.json(&json!({
"...": "See OpenAPI requestBody schema"
}))
.send()
.await?;
let _ = response.error_for_status()?;
// auth.organization.list() -> GET /organization/list
let response = http
.get(format!("{base_url}/organization/list"))
.bearer_auth(token)
.send()
.await?;
let _ = response.error_for_status()?;
// auth.organization.getFull() -> GET /organization/get-full-organization
let response = http
.get(format!("{base_url}/organization/get-full-organization"))
.bearer_auth(token)
.send()
.await?;
let _ = response.error_for_status()?;
// auth.organization.checkSlug() -> POST /organization/check-slug
let response = http
.post(format!("{base_url}/organization/check-slug"))
.bearer_auth(token)
.json(&json!({
"...": "See OpenAPI requestBody schema"
}))
.send()
.await?;
let _ = response.error_for_status()?;
// auth.organization.leave() -> POST /organization/leave
let response = http
.post(format!("{base_url}/organization/leave"))
.bearer_auth(token)
.json(&json!({
"...": "See OpenAPI requestBody schema"
}))
.send()
.await?;
let _ = response.error_for_status()?;
// auth.organization.listUserInvitations() -> GET /organization/list-user-invitations
let response = http
.get(format!("{base_url}/organization/list-user-invitations"))
.bearer_auth(token)
.send()
.await?;
let _ = response.error_for_status()?;
// auth.organization.hasPermission() -> POST /organization/has-permission
let response = http
.post(format!("{base_url}/organization/has-permission"))
.bearer_auth(token)
.json(&json!({
"...": "See OpenAPI requestBody schema"
}))
.send()
.await?;
let _ = response.error_for_status()?;import { client } from "./auth-client"
await client.auth.organization.create({
name: "Acme",
slug: "acme",
})
await client.auth.organization.update({
organizationId: "org_1",
data: { name: "Acme Updated" },
})
await client.auth.organization.delete({
organizationId: "org_1",
})
await client.auth.organization.setActive({
organizationId: "org_1",
})
await client.auth.organization.list()
await client.auth.organization.getFull({
query: { organizationId: "org_1" },
})
await client.auth.organization.checkSlug({
slug: "acme",
})
await client.auth.organization.leave({
organizationId: "org_1",
})
await client.auth.organization.listUserInvitations()
await client.auth.organization.hasPermission({
permissions: { project: ["create"] },
})OpenAPI Contract
Authorization
bearerAuth Bearer token authentication
In: header
Request Body
application/json
The name of the organization
The slug of the organization
The user id of the organization creator. If not provided, the current user will be used. Should only be used by admins or when called by the server.
The logo of the organization
The metadata of the organization
Whether to keep the current active organization active after creating a new one
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3001/api/auth/organization/create" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "slug": "string" }'{
"id": "string",
"name": "string",
"slug": "string",
"logo": "string",
"createdAt": null,
"metadata": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}Authorization
bearerAuth Bearer token authentication
In: header
Request Body
application/json
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3001/api/auth/organization/update" \ -H "Content-Type: application/json" \ -d '{ "data": {} }'{
"id": "string",
"name": "string",
"slug": "string",
"logo": "string",
"createdAt": null,
"metadata": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}Authorization
bearerAuth Bearer token authentication
In: header
Request Body
application/json
The organization id to delete
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3001/api/auth/organization/delete" \ -H "Content-Type: application/json" \ -d '{ "organizationId": "string" }'"string"{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}Authorization
bearerAuth Bearer token authentication
In: header
Request Body
application/json
The organization id to set as active. It can be null to unset the active organization
The organization slug to set as active. It can be null to unset the active organization if organizationId is not provided
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3001/api/auth/organization/set-active" \ -H "Content-Type: application/json" \ -d '{}'{
"id": "string",
"name": "string",
"slug": "string",
"logo": "string",
"createdAt": null,
"metadata": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}Authorization
bearerAuth Bearer token authentication
In: header
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "http://localhost:3001/api/auth/organization/list"[
{
"id": "string",
"name": "string",
"slug": "string",
"logo": "string",
"createdAt": null,
"metadata": "string"
}
]{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}Authorization
bearerAuth Bearer token authentication
In: header
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "http://localhost:3001/api/auth/organization/get-full-organization"{
"id": "string",
"name": "string",
"slug": "string",
"logo": "string",
"createdAt": null,
"metadata": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}Authorization
bearerAuth Bearer token authentication
In: header
Request Body
application/json
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3001/api/auth/organization/check-slug" \ -H "Content-Type: application/json" \ -d '{ "slug": "string" }'{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}Authorization
bearerAuth Bearer token authentication
In: header
Request Body
application/json
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3001/api/auth/organization/leave" \ -H "Content-Type: application/json" \ -d '{ "organizationId": "string" }'{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}Authorization
bearerAuth Bearer token authentication
In: header
Response Body
application/json
curl -X GET "http://localhost:3001/api/auth/organization/list-user-invitations"[
{}
]Authorization
bearerAuth Bearer token authentication
In: header
Request Body
application/json
The permission to check
The permission to check
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3001/api/auth/organization/has-permission" \ -H "Content-Type: application/json" \ -d '{ "permissions": {} }'{
"error": "string",
"success": true
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}