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"
}
]
Field Type Description
id string (UUID) Organization identifier — used in /organizations/{id}/projects
name string Organization name
role string Always OWNER (the key operates at the organization level)
is_personal boolean true for a personal organization
created_at string (ISO 8601) Creation date

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

Returns the organization’s projects the key can see. If the key is limited to certain projects, the others are left out. org_id must match the key’s organization; otherwise the response is 404 Organisation introuvable.

Parameter Type Description
org_id UUID Organization 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"
}
]
Field Type Description
id string (UUID) Project identifier — used in every /organizations/{org_id}/projects/{id}/... endpoint
name string Project name
description string | null Description (null if not set)
org_id string (UUID) | null Organization the project belongs to
is_default boolean true for the project created automatically at signup
created_at string (ISO 8601) Creation date
Code Detail Cause
404 Organisation introuvable org_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])