> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.oryxa.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Organization API: Manage Team Members

> List current team members and invite new ones to your organization. Only Admins can send invitations; member role assignment happens at invite time.

The Organization API lets you view who has access to your Synq tenant and invite new teammates. When you invite a user, Synq provisions a new account, assigns the role you specify, and scopes that user's access to your organization and tenant. Every invitation is recorded in the audit log so you always have a record of who was granted access and when.

<Note>
  All requests require three headers: `Authorization: Bearer YOUR_TOKEN`, `X-Tenant-ID: YOUR_TENANT_ID`, and `X-Org-ID: YOUR_ORG_ID`. Inviting a member requires the `Admin` role.
</Note>

***

## List members

Retrieve all members currently in your tenant.

**`GET /api/v1/organization/members`**

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token from your authentication provider.
</ParamField>

<ParamField header="X-Tenant-ID" type="string" required>
  UUID of your tenant.
</ParamField>

<ParamField header="X-Org-ID" type="string" required>
  UUID of your organization.
</ParamField>

### Response

<ResponseField name="[]member" type="array">
  Array of member objects scoped to your tenant.

  <Expandable title="Member fields">
    <ResponseField name="id" type="string">UUID of the user.</ResponseField>
    <ResponseField name="email" type="string">Email address of the user.</ResponseField>
    <ResponseField name="role" type="string">The user's role — `ADMIN`, `EDITOR`, or `VIEWER`.</ResponseField>
    <ResponseField name="created_at" type="string">ISO 8601 timestamp of when this member was added.</ResponseField>
  </Expandable>
</ResponseField>

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.synq.app/api/v1/organization/members \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "X-Tenant-ID: YOUR_TENANT_ID" \
    -H "X-Org-ID: YOUR_ORG_ID"
  ```

  ```json Response theme={null}
  [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "email": "alice@example.com",
      "role": "ADMIN",
      "created_at": "2024-01-10T08:00:00Z"
    },
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "email": "bob@example.com",
      "role": "EDITOR",
      "created_at": "2024-03-22T14:15:00Z"
    },
    {
      "id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
      "email": "carol@example.com",
      "role": "VIEWER",
      "created_at": "2024-05-05T10:30:00Z"
    }
  ]
  ```
</CodeGroup>

***

## Invite a member

Send an invitation to a new user. Synq provisions an account for the email address, assigns the given role, and scopes access to your tenant. The `uid` of the newly created account is returned so you can reference it in your own systems.

**`POST /api/v1/organization/members`**

<Warning>
  Only users with the `Admin` role can call this endpoint. All other roles receive `403 Forbidden`.
</Warning>

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token from your authentication provider. The calling user must have the `Admin` role.
</ParamField>

<ParamField header="X-Tenant-ID" type="string" required>
  UUID of your tenant.
</ParamField>

<ParamField header="X-Org-ID" type="string" required>
  UUID of your organization.
</ParamField>

### Body

<ParamField body="email" type="string" required>
  Email address of the person to invite. They will receive an account provisioning email at this address.
</ParamField>

<ParamField body="role" type="string" required>
  Role to assign to the invited user. Must be a non-empty string. Common values:

  * `ADMIN` — full management access, including inviting other members and updating settings.
  * `EDITOR` — read/write access to products, orders, and inventory.
  * `VIEWER` — read-only access.
</ParamField>

### Response

Returns `201 Created` with the new user's UID.

<ResponseField name="message" type="string">
  Confirmation message: `User successfully invited`.
</ResponseField>

<ResponseField name="uid" type="string">
  The UID of the newly provisioned user account.
</ResponseField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.synq.app/api/v1/organization/members \
    -H "Authorization: Bearer YOUR_TOKEN" \
    -H "X-Tenant-ID: YOUR_TENANT_ID" \
    -H "X-Org-ID: YOUR_ORG_ID" \
    -H "Content-Type: application/json" \
    -d '{
      "email": "dana@example.com",
      "role": "EDITOR"
    }'
  ```

  ```json Response theme={null}
  {
    "message": "User successfully invited",
    "uid": "d4e5f6a7-b8c9-0123-defa-456789012345"
  }
  ```
</CodeGroup>
