# List agents

Get the agents in your account, for example to find an agent ID.

API 4.1

Use this endpoint to get the agents in your account, for example to find the agent ID to use when you [invite an agent](/developers/api-reference/conversations/invite-agent) or [assign an agent](/developers/api-reference/conversations/assign-agent).

The account comes from your access token. There are no request parameters and no request body.

## Response

A successful request returns HTTP `200` with a JSON **array** of agents, not an object:

```json
[
  {
    "id": "agent_example",
    "account_id": "account_example",
    "type": "agent",
    "state": "active",
    "fullname": "Sam Example",
    "email": "sam@example.com",
    "scopes": [
      "supervisor"
    ]
  },
  {
    "id": "agent_second_example",
    "account_id": "account_example",
    "type": "agent",
    "state": "pending",
    "fullname": "Jamie Example",
    "email": "jamie@example.com"
  }
]
```

This example shows selected fields. See [Agent format](/developers/agents/format) for every field and `state` value. The list is not paginated.

Filter the array in your code. For example, keep agents whose `state` is `active` before you show them as choices for assignment.

## Other paths

`GET https://api.subiz.com.vn/4.0/agents` and `GET https://api.subiz.com.vn/4.0/accounts/YOUR_ACCID/agents` return the same list.

## HTTP request

Replace `YOUR_ACCESS_TOKEN` with your token.

```http
GET https://api.subiz.com.vn/4.1/agents
Authorization: Bearer YOUR_ACCESS_TOKEN
```