Skip to content

GET /v1/organizations

The organization sits at the top of the hierarchy: every project belongs to an organization. Since an API key belongs to one organization, the typical flow follows this hierarchy: organization → projects → stack / alerts / EOL.

GET /api/v1/organizations
Authorization: Bearer twa_your_key_here

Returns the organization the key belongs to (always a single-element array).

[
{
"id": "018e5678-abcd-7000-8000-000000000001",
"name": "ACME Corp",
"role": "OWNER",
"is_personal": false,
"created_at": "2024-05-02T09:00:00Z"
}
]
FieldTypeDescription
idstring (UUID)Organization identifier — used in /organizations/{id}/projects
namestringOrganization name
rolestringAlways OWNER (the key operates at the organization level)
is_personalbooleantrue for a personal organization
created_atstring (ISO 8601)Creation date

GET /api/v1/organizations/{org_id}/projects
Authorization: Bearer twa_your_key_here

Returns all projects of the organization (the key grants org-wide access). org_id must match the key’s organization.

ParameterTypeDescription
org_idUUIDOrganization identifier
[
{
"id": "018e1234-abcd-7000-8000-000000000010",
"name": "Prod infrastructure",
"description": "Production servers and dependencies",
"org_id": "018e5678-abcd-7000-8000-000000000001",
"is_default": true,
"created_at": "2024-03-15T10:22:00Z"
}
]
FieldTypeDescription
idstring (UUID)Project identifier — used in every /organizations/{org_id}/projects/{id}/... endpoint
namestringProject name
descriptionstring | nullDescription (null if not set)
org_idstring (UUID) | nullOrganization the project belongs to
is_defaultbooleantrue for the project created automatically at signup
created_atstring (ISO 8601)Creation date
CodeDetailCause
404Organisation introuvableorg_id does not match the key’s organization

Walk the whole organizations → projects hierarchy

Fenêtre de terminal
curl -s \
-H "Authorization: Bearer twa_your_key_here" \
https://app.techwatchalert.com/api/v1/organizations \
| jq -r '.[].id' \
| while read ORG; do
curl -s \
-H "Authorization: Bearer twa_your_key_here" \
"https://app.techwatchalert.com/api/v1/organizations/${ORG}/projects" \
| jq -r '.[] | "\(.name)\t\(.id)"'
done

Python — all projects, grouped by organization

import httpx
BASE_URL = "https://app.techwatchalert.com/api/v1"
headers = {"Authorization": "Bearer twa_your_key_here"}
orgs = httpx.get(f"{BASE_URL}/organizations", headers=headers).json()
projects_by_org = {
org["name"]: httpx.get(
f"{BASE_URL}/organizations/{org['id']}/projects", headers=headers
).json()
for org in orgs
}
for org_name, projects in projects_by_org.items():
print(org_name, "", [p["name"] for p in projects])