Users
The Users API allows you to find specific users and retrieve lists of users from your account.
Find User
Retrieves details for a specific user by ID, email, or phone number.
Arguments
| Parameter | Type | Description |
|---|---|---|
| criteria | UserLookupInput | Required Criteria for finding a user |
UserLookupInput
| Field | Type | Description |
|---|---|---|
| id | ID | Optional ID of the user to find |
| String | Optional Email of the user to find | |
| phone | String | Optional Phone number of the user to find |
Example Query
query {
viewer {
findUser(criteria: {
email: "john.doe@example.com"
}) {
id
profile {
firstName
lastName
email
phone
avatar
}
brand {
id
name
}
roles
}
}
}
Response
{
"data": {
"viewer": {
"findUser": {
"id": "VXNlcjoyNA==",
"profile": {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phone": "+1234567890",
"avatar": "https://cdn.sixtyseconds.video/avatars/john-doe.jpg"
},
"brand": {
"id": "QnJhbmQ6MTA=",
"name": "Acme Inc."
},
"roles": ["ROLE_USER", "ROLE_BRAND_ADMIN"]
}
}
}
}
List Users
Retrieves a paginated and filterable list of users. Requires admin access.
Arguments
| Parameter | Type | Description |
|---|---|---|
| filter | UserListFilterInput | Required Filter and pagination options |
UserListFilterInput
| Field | Type | Description |
|---|---|---|
| search | String | Optional Search term to filter users by ID, email, first name or last name |
| page | Int | Optional Page number for pagination (default: 1) |
| limit | Int | Optional Maximum number of users to return per page (default: 10) |
Example Query
query {
viewer {
users(filter: {
search: "john",
page: 1,
limit: 10
}) {
items {
id
profile {
firstName
lastName
email
}
brand {
name
}
roles
}
total
page
limit
pages
}
}
}
Response
{
"data": {
"viewer": {
"users": {
"items": [
{
"id": "VXNlcjoyNA==",
"profile": {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com"
},
"brand": {
"name": "Acme Inc."
},
"roles": ["ROLE_USER", "ROLE_BRAND_ADMIN"]
},
{
"id": "VXNlcjozMg==",
"profile": {
"firstName": "Johnny",
"lastName": "Smith",
"email": "johnny.smith@example.com"
},
"brand": {
"name": "XYZ Corp"
},
"roles": ["ROLE_USER"]
}
],
"total": 15,
"page": 1,
"limit": 10,
"pages": 2
}
}
}
}
User Fields
The User object contains the following fields:
| Field | Type | Description |
|---|---|---|
| id | ID | Unique identifier for the user |
| profile | Profile | User's profile information |
| brand | Brand | The brand associated with the user |
| roles | [String] | The roles assigned to the user |
| team | Team | The team the user belongs to |
| verified | Boolean | Whether the user has been verified |
| currentStep | Int | Current step in the account creation process |
| enabled | Boolean | Whether the user account is active |
| messagingCampaigns | [MessagingCampaign] | Messaging campaigns associated with the user |
User Roles
A user can have one or more of the following roles:
| Role | Description |
|---|---|
| ROLE_USER | Standard user with basic access |
| ROLE_BRAND_ADMIN | Administrator for a specific brand |
| ROLE_ORG_ADMIN | Administrator for an entire organization |
| ROLE_ADMIN | Global administrator with full system access |
Working with Users
Access Control
The findUser query requires admin privileges to access users other than the currently authenticated user. Regular users can only access their own information.
The users query requires admin privileges and will return a paginated list of all users in the system.
Search Functionality
The search parameter in the users query searches across multiple user fields including ID, email, firstName, and lastName, making it easy to find users without knowing their exact identifier.