from acontext import AcontextClient
client = AcontextClient(api_key='sk_project_token')
# List all users
users = client.users.list()
for user in users.items:
print(f"{user.identifier}: {user.id}")
# List users with pagination
users = client.users.list(limit=20, time_desc=True)
if users.has_more:
next_users = client.users.list(limit=20, cursor=users.next_cursor){
"code": 123,
"error": "<string>",
"msg": "<string>",
"data": {
"has_more": true,
"items": [
{
"created_at": "<string>",
"id": "<string>",
"identifier": "<string>",
"project_id": "<string>",
"updated_at": "<string>"
}
],
"next_cursor": "<string>"
}
}Get all users under a project. If limit is not provided or 0, all users will be returned.
from acontext import AcontextClient
client = AcontextClient(api_key='sk_project_token')
# List all users
users = client.users.list()
for user in users.items:
print(f"{user.identifier}: {user.id}")
# List users with pagination
users = client.users.list(limit=20, time_desc=True)
if users.has_more:
next_users = client.users.list(limit=20, cursor=users.next_cursor){
"code": 123,
"error": "<string>",
"msg": "<string>",
"data": {
"has_more": true,
"items": [
{
"created_at": "<string>",
"id": "<string>",
"identifier": "<string>",
"project_id": "<string>",
"updated_at": "<string>"
}
],
"next_cursor": "<string>"
}
}Project Bearer token (e.g., "Bearer sk-ac-xxxx")
Limit of users to return. Max 200. If limit is 0 or not provided, all users will be returned.
Cursor for pagination. Use the cursor from the previous response to get the next page.
Order by created_at descending if true, ascending if false (default false)