Organizations
1 operation under /v1/organizations/{id} (GET): parameters, status codes, refusal bodies, and the same request in curl, HTTP, Python and TypeScript.
Base URL: https://api.codespar.dev
Every operation below requires a Bearer token. See Authentication.
GET /v1/organizations/{id}
https://api.codespar.dev/v1/organizations/{id}Read the organization this credential belongs to
Completeness, not a management surface: every credential can learn who it belongs to. There is no list, no create and no update on this resource, and their absence is the contract — an organization is provisioned through sign-up and billing, not through this API.
EXACTLY ONE ORGANIZATION IS READABLE, the caller's own. Any other value in {id} answers 404 rather than 403, for the reason the rest of this surface answers 404 across tenants: a 403 would confirm the organization exists, which is the one fact a caller probing ids is trying to buy. The id is in the path anyway, rather than the route being /v1/organization, so a caller that already knows its id gets a URL it can construct.
plan and the billing customer handle are NOT on the wire. The first is a commercial fact shown under human identity and the second is a handle into another vendor's namespace; neither is something a credential needs in order to know who it belongs to.
The 500 is ours, not yours: it means the credential resolved to an organization that has no row, which is our state being torn. Retrying will not help.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The calling credential's own organization id — take it from GET /v1/whoami rather than constructing it. DO NOT ASSUME AN org_ PREFIX: a developer working outside a shared organization is provisioned into a personal namespace whose id is user_ followed by their user id, and that is a real organization row and a legal value here. |
Responses
| Status | Body | Description |
|---|---|---|
200 | object | OK |
404 | object | The id is not the calling credential's organization. Also what a caller gets for an organization that exists but is not theirs. |
500 | object | The authenticated organization has no row. A defect on our side, not a caller error. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
account_type | "PF" | "PJ" | yes | PF for a person (CPF), PJ for a company (CNPJ). The type belongs to the account and is a declaration made at sign-up, not a verification: no document has been checked. MEANINGFUL ONLY WHEN account_type_declared IS true: an organization that has not declared yet reads PJ, the stored default, and that value says nothing about it. Once declared, the only change it admits is PF to PJ, made from the dashboard by a verified organization admin; a declared PJ never becomes PF. Every organization that existed before the declaration was introduced is declared with the type it had. |
account_type_declared | boolean | yes | Whether the account has declared its type. false for an organization created since the declaration was introduced that has not chosen PF or PJ yet; the dashboard keeps such an organization provisional, with nothing reserved to companies open, until it declares. The declaration is made through the dashboard, once, by an organization admin or owner; no API key can make it. |
account_type_declared_at | string,null (date-time) | yes | When the type was declared; null while account_type_declared is false. For an organization that existed before the declaration was introduced it is when that change was deployed, not when its type was first decided. |
created_at | string (date-time) | yes | — |
id | string | yes | Echoes the path parameter, which is always the caller's own organization. |
live_approved | boolean | yes | Whether CodeSpar has approved this organization for live projects. While it is false, POST /v1/projects with environment: "live" answers 403 org_not_approved_for_live and test projects are unaffected. Approval is a manual review by CodeSpar, requested through your CodeSpar contact; no call on this API grants or revokes it, and who approved and when are not exposed. |
name | string | yes | — |
spend_pause | object,null | yes | Set while the organization's kill switch is pressed and every agent money door refuses org_paused (ent#1648); null otherwise. The full state, and pressing or releasing it, is /v1/orgs/{orgId}/pause. |
curl -X GET https://api.codespar.dev/v1/organizations/{id} \
-H "Authorization: Bearer $CODESPAR_API_KEY"GET /v1/organizations/{id} HTTP/1.1
Host: api.codespar.dev
Authorization: Bearer $CODESPAR_API_KEYimport os
import requests
res = requests.get(
"https://api.codespar.dev/v1/organizations/{id}",
headers={"Authorization": f"Bearer {os.environ['CODESPAR_API_KEY']}"},
)
res.raise_for_status()
data = res.json()const res = await fetch("https://api.codespar.dev/v1/organizations/{id}", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.CODESPAR_API_KEY}`,
},
});
const data = await res.json();const result = await cs.api.get("/v1/organizations/{id}", {
path: {
id: "org_0000000000000000"
}
});{
"id": "obj_0000000000000000",
"name": "Example",
"created_at": "2026-01-15T12:00:00.000Z",
"account_type": "PF",
"account_type_declared": true,
"account_type_declared_at": "2026-01-15T12:00:00.000Z",
"live_approved": true,
"spend_pause": {
"paused_at": "2026-01-15T12:00:00.000Z",
"reason": "string"
}
}Orgs
20 operations under /v1/orgs/{orgId} (POST GET PATCH): parameters, status codes, refusal bodies, and the same request in curl, HTTP, Python and TypeScript.
Projects
8 operations under /v1/projects (GET POST PATCH DELETE): parameters, status codes, refusal bodies, and the same request in curl, HTTP, Python and TypeScript.