> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.askelephant.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.askelephant.ai/_mcp/server.

# List users

GET https://app.askelephant.ai/api/v2/users

Returns workspace users using cursor pagination ordered by `updated_at` descending by default.

Reference: https://docs.askelephant.ai/api-reference/users/list-users

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://app.askelephant.ai/api` (Production, default)
- `https://app-staging.askelephant.ai/api` (Staging)

## Request

### Query parameters

- `limit` (integer, optional, default: 25) — Maximum number of results to return. Defaults to 25 and is capped at 100.
- `cursor` (string, optional) — Keyset cursor from a previous list response. Cursors encode the sort key and record `id` tie-breaker from the last row on the prior page — they are not offset tokens and do not isolate a point-in-time snapshot. For `order_by` on `updated_at`, cursors use the `pa_uac_1_` prefix and encode `{ "id", "updatedAt" }`. For `GET /v2/engagements` with `order_by` on `start_at`, cursors use the `pa_sac_1_` prefix and encode `{ "id", "startAt" }`. A cursor is bound to the sort field, not the direction. An `updated_at` cursor cannot be used with `order_by=start_at:*` (or the reverse). Reusing a cursor with the opposite direction for the same field is accepted, but can skip or repeat records. Live keyset pagination can re-deliver a row whose sort key moved forward during the walk (design sync jobs to upsert by `id`) and can skip a row whose sort key moved backward.
- `search` (string, optional) — Free-text search string matched against user full names and email addresses. This does not search job titles, roles, or other profile fields.
- `order_by` (enum, optional) — Sort order for the list. Defaults to `updated_at:desc`.
  - Allowed values: `updated_at:asc`, `updated_at:desc`
- `filter[updated_at][gt]` (datetime, optional) — Return resources updated strictly after the provided ISO-8601 UTC timestamp.
- `filter[updated_at][gte]` (datetime, optional) — Return resources updated at or after the provided ISO-8601 UTC timestamp.
- `filter[updated_at][lt]` (datetime, optional) — Return resources updated strictly before the provided ISO-8601 UTC timestamp.
- `filter[updated_at][lte]` (datetime, optional) — Return resources updated at or before the provided ISO-8601 UTC timestamp.

## Response

### 200

Paginated users list.

- `object` (enum, required)
  - Allowed values: `list`
- `data` (list of user, required)
- `has_more` (boolean, required)
- `next_cursor` (string, required, nullable)

## Errors

### 400 Bad Request Error

Request validation failed.

- `type` (string, required) — Stable URI identifying the error category.
- `title` (string, required) — Short human-readable summary of the error.
- `status` (integer, required) — HTTP status code for this error response.
- `detail` (string, required) — Human-readable explanation specific to this request.
- `request_id` (string, required) — Correlation identifier for support and debugging.
- `errors` (list of error_item, optional) — Optional field-level validation errors.

### 401 Unauthorized Error

Authentication is missing or invalid.

- `type` (string, required) — Stable URI identifying the error category.
- `title` (string, required) — Short human-readable summary of the error.
- `status` (integer, required) — HTTP status code for this error response.
- `detail` (string, required) — Human-readable explanation specific to this request.
- `request_id` (string, required) — Correlation identifier for support and debugging.
- `errors` (list of error_item, optional) — Optional field-level validation errors.

### 403 Forbidden Error

Authenticated but missing required scope.

- `type` (string, required) — Stable URI identifying the error category.
- `title` (string, required) — Short human-readable summary of the error.
- `status` (integer, required) — HTTP status code for this error response.
- `detail` (string, required) — Human-readable explanation specific to this request.
- `request_id` (string, required) — Correlation identifier for support and debugging.
- `errors` (list of error_item, optional) — Optional field-level validation errors.

### 429 Too Many Requests Error

Workspace rate limit exceeded (1000 authenticated requests per 60-second window on `/api/v2` resource routes). Retry after the interval in `Retry-After`. Successful responses also include `X-RateLimit-*` headers for proactive monitoring.

- `type` (string, required) — Stable URI identifying the error category.
- `title` (string, required) — Short human-readable summary of the error.
- `status` (integer, required) — HTTP status code for this error response.
- `detail` (string, required) — Human-readable explanation specific to this request.
- `request_id` (string, required) — Correlation identifier for support and debugging.
- `errors` (list of error_item, optional) — Optional field-level validation errors.

### 500 Internal Server Error

Unexpected server error.

- `type` (string, required) — Stable URI identifying the error category.
- `title` (string, required) — Short human-readable summary of the error.
- `status` (integer, required) — HTTP status code for this error response.
- `detail` (string, required) — Human-readable explanation specific to this request.
- `request_id` (string, required) — Correlation identifier for support and debugging.
- `errors` (list of error_item, optional) — Optional field-level validation errors.

### 503 Service Unavailable Error

Rate limit enforcement is temporarily unavailable.

- `type` (string, required) — Stable URI identifying the error category.
- `title` (string, required) — Short human-readable summary of the error.
- `status` (integer, required) — HTTP status code for this error response.
- `detail` (string, required) — Human-readable explanation specific to this request.
- `request_id` (string, required) — Correlation identifier for support and debugging.
- `errors` (list of error_item, optional) — Optional field-level validation errors.

## Types

### user

- `object` (enum, required)
  - Allowed values: `user`
- `id` (string, required)
- `role` (enum, required)
  - Allowed values: `OWNER`, `MANAGER`, `USER`, `INACTIVE`, `NOT_INVITED`
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `first_name` (string, optional, nullable)
- `last_name` (string, optional, nullable)
- `job_title` (string, optional)
- `emails` (list of UserEmailsItems, optional)
- `time_zone` (string, optional)
- `last_activity_at` (datetime, optional)

### error_item

Structured validation or field-level error detail.

- `code` (string, required) — Stable machine-readable error code.
- `message` (string, required) — Human-readable explanation of the error.
- `field` (string, optional) — Request field or parameter associated with the error.

### UserEmailsItems

- `email` (string, required)
- `is_primary` (boolean, required)

## Examples

**Response**

```json
{
  "object": "list",
  "data": [
    {
      "object": "user",
      "id": "string",
      "role": "OWNER",
      "created_at": "2024-01-15T09:30:00Z",
      "updated_at": "2024-01-15T09:30:00Z",
      "first_name": "string",
      "last_name": "string",
      "job_title": "string",
      "emails": [
        {
          "email": "string",
          "is_primary": true
        }
      ],
      "time_zone": "string",
      "last_activity_at": "2024-01-15T09:30:00Z"
    }
  ],
  "has_more": true,
  "next_cursor": "string"
}
```

**SDK Code**

```python
import requests

url = "https://app.askelephant.ai/api/v2/users"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://app.askelephant.ai/api/v2/users';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://app.askelephant.ai/api/v2/users"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://app.askelephant.ai/api/v2/users")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://app.askelephant.ai/api/v2/users")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://app.askelephant.ai/api/v2/users', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://app.askelephant.ai/api/v2/users");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://app.askelephant.ai/api/v2/users")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```