Skip to main content

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

FieldTypeDescription
namestringRequired. Display name.
slugstringRequired. 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

FieldTypeDescription
uidstringOrganization UID.
slugstringOrganization slug.
namestringDisplay name.
org_typestringPERSONAL or TEAM.
rolestringYour role: OWNER, ADMIN, or MEMBER.
billing_emailstringBilling email, if set.
creditsnumberCurrent credit balance.
overageintegerOverage allowance.
created_atstringISO 8601 creation timestamp.
updated_atstringISO 8601 last update timestamp.

List Organizations

Lists organizations the authenticated user belongs to.

GET /tha/v3/orgs

QueryTypeDescription
limitintegerMax items.
cursorstringPagination 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}

FieldTypeDescription
namestringNew display name.
slugstringNew slug.
billing_emailstringBilling 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

FieldTypeDescription
addressstringSS58-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

FieldTypeDescription
creditsnumberCurrent credit balance.
currencystringCurrency of the credit balance.

Example Response

{
"credits": 50000,
"currency": "USD"
}

Errors

Status CodeDescription
400Invalid request or query parameters.
401Invalid or missing token.
403Insufficient role.
404Organization not found.
500Server error.