# Orgs

Endpoints for organizations accessible to the authenticated user

## List accessible organizations

> Returns the list of organizations that the authenticated user has access to. This includes:\
> \
> \- Organizations where the user is a direct member (kind: 'direct')\
> \- Child organizations if the user belongs to a partner organization (kind: 'partnership')\
> \- All active organizations if the user is an Archera staff member (kind: 'staff')\
> \
> Each organization includes the user's role and membership kind.

```json
{"openapi":"3.1.0","info":{"title":"Archera.ai API","version":"v1.0.0"},"tags":[{"name":"Orgs","description":"Endpoints for organizations accessible to the authenticated user"}],"paths":{"/v1/orgs":{"get":{"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Org"}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"405":{"description":"Method not allowed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"default":{"$ref":"#/components/responses/DEFAULT_ERROR"}},"summary":"List accessible organizations","description":"Returns the list of organizations that the authenticated user has access to. This includes:\n\n- Organizations where the user is a direct member (kind: 'direct')\n- Child organizations if the user belongs to a partner organization (kind: 'partnership')\n- All active organizations if the user is an Archera staff member (kind: 'staff')\n\nEach organization includes the user's role and membership kind.","tags":["Orgs"]}}},"components":{"schemas":{"Org":{"type":"object","properties":{"org_id":{"type":"string","pattern":"[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\\Z","description":"Unique organization identifier"},"name":{"type":"string","description":"Organization name"},"role":{"type":"string","enum":["user","admin","support","cloud_rep","restricted_user"],"description":"User's role in the organization (e.g., admin, user, support, cloud_rep, restricted_user)"},"kind":{"description":"Type of membership: 'direct' (direct member), 'partnership' (via partner org), 'staff' (Archera staff)","enum":["direct","staff","partnership"]}},"required":["kind","name","org_id","role"],"additionalProperties":false},"ApiErrorResponse":{"type":"object","properties":{"message":{"type":"string"},"detail":{},"code":{"type":["string","null"]},"url":{"type":["string","null"]},"timestamp":{"type":"string"},"type":{"type":"string"}},"required":["message","timestamp","type"]},"Error":{"type":"object","properties":{"code":{"type":"integer","description":"Error code"},"status":{"type":"string","description":"Error name"},"message":{"type":"string","description":"Error message"},"errors":{"type":"object","description":"Errors","additionalProperties":{}}},"additionalProperties":false}},"responses":{"DEFAULT_ERROR":{"description":"Default error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}
```
