> ## Documentation Index
> Fetch the complete documentation index at: https://reach-owl.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage Team Members and Permissions

> Invite agents to your ReachOwl team, update their roles, and remove members using the Team API endpoints.

Use the ReachOwl Team API to control workspace membership. This guide shows you how to list your teams, view current members, add new agents, update roles, and remove members.

<Steps>
  <Step title="List your teams">
    First, retrieve the teams you belong to so you can save the `team_id` you want to manage.

    <CodeGroup>
      ```bash Request theme={null}
      curl -X GET "{{baseUrl}}/api/v1/teams" \
        -H "Authorization: Bearer {token}"
      ```

      ```json Response theme={null}
      {
        "data": [
          {
            "id": 3,
            "name": "Acme Marketing",
            "role": "admin"
          }
        ]
      }
      ```
    </CodeGroup>

    Save the `id` value from the team you want to work with.
  </Step>

  <Step title="List current members">
    Get the list of existing members for your team.

    <CodeGroup>
      ```bash Request theme={null}
      curl -X GET "{{baseUrl}}/api/v1/team/members" \
        -H "Authorization: Bearer {token}"
      ```

      ```json Response theme={null}
      {
        "data": [
          {
            "id": 10,
            "user_id": 7,
            "name": "Jane Doe",
            "email": "jane@example.com",
            "role": "agent",
            "status": "active"
          }
        ]
      }
      ```
    </CodeGroup>
  </Step>

  <Step title="Add a member">
    Invite a new member by sending a POST request with the email address and role. The example below invites an agent.

    <CodeGroup>
      ```bash Request theme={null}
      curl -X POST "{{baseUrl}}/api/v1/team/add" \
        -H "Authorization: Bearer {token}" \
        -H "Content-Type: application/json" \
        -d '{
          "email": "newuser@example.com",
          "role": "agent"
        }'
      ```

      ```json Response theme={null}
      {
        "id": 11,
        "email": "newuser@example.com",
        "role": "agent",
        "status": "active"
      }
      ```
    </CodeGroup>
  </Step>

  <Step title="Update a member">
    Change a member's role or status by sending a POST request to `/api/v1/team/members/store`.

    <CodeGroup>
      ```bash Request theme={null}
      curl -X POST "{{baseUrl}}/api/v1/team/members/store" \
        -H "Authorization: Bearer {token}" \
        -H "Content-Type: application/json" \
        -d '{
          "id": 11,
          "user_id": 8,
          "status": "active",
          "role": "agent"
        }'
      ```

      ```json Response theme={null}
      {
        "id": 11,
        "user_id": 8,
        "role": "agent",
        "status": "active"
      }
      ```
    </CodeGroup>
  </Step>

  <Step title="Remove a member">
    Remove a member from the team by sending a DELETE request with the member record ID.

    <CodeGroup>
      ```bash Request theme={null}
      curl -X DELETE "{{baseUrl}}/api/v1/team/members/11" \
        -H "Authorization: Bearer {token}"
      ```

      ```json Response theme={null}
      {
        "message": "Member removed successfully."
      }
      ```
    </CodeGroup>
  </Step>
</Steps>

<Warning>
  Only team admins can add, update, or remove members. If you receive a 403 response, check that your bearer token belongs to a user with admin permissions on the selected team.
</Warning>
