Organization

Create and manage organizations and members (Architect JWT).

dev · https://api.dev.relay.oprag.ai

All 5 endpoints on this page require a Cognito JWT from Architect. An organization secret returns 401 on every one.

POST /v1/organizations

Create an organization for the signed-in user who has no tenant yet.

Auth Cognito JWT

Path parameters

None.

Query parameters

None.This endpoint does not read query parameters.

Body parameters

Name Type Required Description
name string Required Display name.

Request

JSON
{
  "name": "Acme Engineering"
}

Response

201 Success

JSON
{
  "organizationId": "org_abc123",
  "name": "Acme Engineering",
  "slug": "acme-engineering",
  "status": "active",
  "ownerUserId": "usr_xyz789",
  "createdAt": "2026-08-28T12:00:00.000Z",
  "updatedAt": "2026-08-28T12:00:00.000Z"
}

Status codes

Status Meaning
201 Created.
400 Request body failed validation.
401 Missing or expired JWT.
403 Insufficient organization role.
409 User already belongs to an organization.
429 Rate limited. See rate limits.
502 Organization created but Cognito tenant assignment failed.
503 Service unavailable.

curl

Shell
curl -X POST 'https://api.dev.relay.oprag.ai/v1/organizations' \
  -H 'Authorization: Bearer <Cognito JWT>' \
  -H 'Content-Type: application/json' \
  -d '{"name": "Acme Engineering"}'
GET /v1/organizations/me

Return the caller's organization.

Auth Cognito JWT member+

Path parameters

None.

Query parameters

None.This endpoint does not read query parameters.

Body parameters

None.This endpoint does not read a request body.

Response

200 Success

JSON
{
  "organizationId": "org_abc123",
  "name": "Acme Engineering",
  "status": "active",
  "ownerUserId": "usr_xyz789",
  "createdAt": "2026-08-28T12:00:00.000Z",
  "updatedAt": "2026-08-28T12:00:00.000Z"
}

Status codes

Status Meaning
200 Success.
401 Missing or expired JWT.
403 Insufficient organization role.
429 Rate limited. See rate limits.
503 Service unavailable.

curl

Shell
curl -X GET 'https://api.dev.relay.oprag.ai/v1/organizations/me' \
  -H 'Authorization: Bearer <Cognito JWT>'
PATCH /v1/organizations/me

Replace the organization display name.

Auth Cognito JWT admin+

Before you call it

  • Requires name in the body (full replace, not partial patch).

Path parameters

None.

Query parameters

None.This endpoint does not read query parameters.

Body parameters

Name Type Required Description
name string Required Display name.

Request

JSON
{
  "name": "Acme Corp"
}

Response

200 Success

JSON
{
  "organizationId": "org_abc123",
  "name": "Acme Corp",
  "status": "active",
  "ownerUserId": "usr_xyz789",
  "createdAt": "2026-08-28T12:00:00.000Z",
  "updatedAt": "2026-08-28T13:00:00.000Z"
}

Status codes

Status Meaning
200 Success.
400 Request body failed validation.
401 Missing or expired JWT.
403 Insufficient organization role.
429 Rate limited. See rate limits.
503 Service unavailable.

curl

Shell
curl -X PATCH 'https://api.dev.relay.oprag.ai/v1/organizations/me' \
  -H 'Authorization: Bearer <Cognito JWT>' \
  -H 'Content-Type: application/json' \
  -d '{"name": "Acme Corp"}'
GET /v1/organizations/me/members

List active and invited organization members.

Auth Cognito JWT member+

Path parameters

None.

Query parameters

None.This endpoint does not read query parameters.

Body parameters

None.This endpoint does not read a request body.

Response

200 Success

JSON
{
  "users": [
    {
      "organizationId": "org_abc123",
      "userId": "usr_xyz789",
      "email": "owner@example.com",
      "role": "owner",
      "status": "active",
      "joinedAt": "2026-08-28T12:00:00.000Z",
      "createdAt": "2026-08-28T12:00:00.000Z",
      "updatedAt": "2026-08-28T12:00:00.000Z"
    }
  ]
}

Status codes

Status Meaning
200 Success.
401 Missing or expired JWT.
403 Insufficient organization role.
429 Rate limited. See rate limits.
503 Service unavailable.

curl

Shell
curl -X GET 'https://api.dev.relay.oprag.ai/v1/organizations/me/members' \
  -H 'Authorization: Bearer <Cognito JWT>'
POST /v1/organizations/me/members

Invite a user to the organization by email.

Auth Cognito JWT admin+

Path parameters

None.

Query parameters

None.This endpoint does not read query parameters.

Body parameters

Name Type Required Description
email string Required Email address for the invite.
role string Optional Member role: owner, admin, or member.

Request

JSON
{
  "email": "dev@example.com",
  "role": "member"
}

Response

201 Success

JSON
{
  "userId": "usr_inv001",
  "email": "dev@example.com",
  "role": "member",
  "status": "invited"
}

Status codes

Status Meaning
201 Created.
400 Request body failed validation.
401 Missing or expired JWT.
403 Insufficient organization role.
409 Email is already a member or belongs to another organization.
429 Rate limited. See rate limits.
502 Cognito invite failed.
503 Service unavailable.

curl

Shell
curl -X POST 'https://api.dev.relay.oprag.ai/v1/organizations/me/members' \
  -H 'Authorization: Bearer <Cognito JWT>' \
  -H 'Content-Type: application/json' \
  -d '{"email": "dev@example.com","role": "member"}'

Ready to ship?

Get started free