Organizations
Organizations scope workloads, volumes, SSH keys, templates, projects, and service tokens. Every user belongs to at least one organization.
Authentication
Org endpoints require a personal access token or org service token:
Authorization: Bearer <YOUR_API_TOKEN>
Pagination: list endpoints accept limit and cursor. Responses include next_cursor.
Create Organization
Creates an organization for the authenticated user. Slug must be lowercase alphanumeric, may contain hyphens, no spaces or leading/trailing special characters.
POST /tha/v3/orgs
Request Body
| Field | Type | Description |
|---|---|---|
name | string | Required. Display name. |
slug | string | Required. URL-safe organization slug. |
Example Request
curl -X POST https://api.targon.com/tha/v3/orgs \
-H "Authorization: Bearer <YOUR_API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"name": "My Team",
"slug": "my-team"
}'
Response
| Field | Type | Description |
|---|---|---|
uid | string | Organization UID. |
slug | string | Organization slug. |
name | string | Display name. |
org_type | string | PERSONAL or TEAM. |
role | string | Your role: OWNER, ADMIN, or MEMBER. |
billing_email | string | Billing email, if set. |
credits | number | Current credit balance. |
overage | integer | Overage allowance. |
created_at | string | ISO 8601 creation timestamp. |
updated_at | string | ISO 8601 last update timestamp. |
List Organizations
Lists organizations the authenticated user belongs to.
GET /tha/v3/orgs
| Query | Type | Description |
|---|---|---|
limit | integer | Max items. |
cursor | string | Pagination cursor. |
Get Organization
Retrieves the selected organization.
GET /tha/v3/orgs/{org_slug}
Returns an Org object.
Update Organization
Updates organization fields. Requires OWNER role.
PATCH /tha/v3/orgs/{org_slug}
| Field | Type | Description |
|---|---|---|
name | string | New display name. |
slug | string | New slug. |
billing_email | string | Billing contact email. |
Delete Organization
Deletes the selected organization. Requires OWNER role.
DELETE /tha/v3/orgs/{org_slug}
Returns 204 No Content.
Get Wallet
Returns the wallet address for the selected organization.
GET /tha/v3/orgs/{org_slug}/wallet
Response
| Field | Type | Description |
|---|---|---|
address | string | SS58-encoded wallet address. |
Example Response
{
"address": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"
}
Get Credits
Returns the credit balance for the selected organization.
GET /tha/v3/orgs/{org_slug}/credits
Response
| Field | Type | Description |
|---|---|---|
credits | number | Current credit balance. |
currency | string | Currency of the credit balance. |
Example Response
{
"credits": 50000,
"currency": "USD"
}
Errors
| Status Code | Description |
|---|---|
| 400 | Invalid request or query parameters. |
| 401 | Invalid or missing token. |
| 403 | Insufficient role. |
| 404 | Organization not found. |
| 500 | Server error. |