Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

Frontline User Resource


The User resource represents a Twilio Frontline user who can log in to the Frontline application. Any user assigned to the Twilio Frontline application within your Identity Provider will be able to access Frontline.


API Base URL

api-base-url page anchor

All URLs in the reference documentation use the following base URL:

https://frontline-api.twilio.com/v1

Property nameTypeRequiredPIIDescriptionChild properties
sidSID<US>

Optional

Not PII

The unique string that we created to identify the User resource.

Pattern: ^US[0-9a-fA-F]{32}$Min length: 34Max length: 34

identitystring

Optional

PII MTL: 30 days

The application-defined string that uniquely identifies the resource's User. This value is often a username or an email address, and is case-sensitive.


friendlyNamestring

Optional

The string that you assigned to describe the User.


avatarstring

Optional

The avatar URL which will be shown in Frontline application.


stateenum<string>

Optional

Current state of this user. Can be either active or deactivated and defaults to active

Possible values:
activedeactivated

isAvailableboolean

Optional

Whether the User is available for new conversations. Defaults to false for new users.


urlstring<uri>

Optional

An absolute API resource URL for this user.


GET https://frontline-api.twilio.com/v1/Users/{Sid}

Path parameters

path-parameters page anchor
Property nameTypeRequiredPIIDescription
sidstring
required

The SID of the User resource to fetch. This value can be either the sid or the identity of the User resource to fetch.

Fetch a UserLink to code sample: Fetch a User
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchUser() {
11
const user = await client.frontlineApi.v1
12
.users("USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
13
.fetch();
14
15
console.log(user.sid);
16
}
17
18
fetchUser();

Response

Note about this response
1
{
2
"sid": "USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"identity": "john@example.com",
4
"friendly_name": "John Doe",
5
"avatar": "https://example.com/profile.png",
6
"state": "active",
7
"is_available": true,
8
"url": "https://frontline-api.twilio.com/v1/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
9
}

POST https://frontline-api.twilio.com/v1/Users/{Sid}

Property nameTypeRequiredPIIDescription
sidstring
required

The SID of the User resource to update. This value can be either the sid or the identity of the User resource to update.

Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredPIIDescriptionChild properties
friendlyNamestring

Optional

The string that you assigned to describe the User.


avatarstring

Optional

The avatar URL which will be shown in Frontline application.


stateenum<string>

Optional

Current state of this user. Can be either active or deactivated and defaults to active

Possible values:
activedeactivated

isAvailableboolean

Optional

Whether the User is available for new conversations. Set to false to prevent User from receiving new inbound conversations if you are using Pool Routing.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function updateUser() {
11
const user = await client.frontlineApi.v1
12
.users("USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
13
.update({
14
avatar: "https://example.com/new-profile.png",
15
friendlyName: "John Doe",
16
isAvailable: true,
17
});
18
19
console.log(user.sid);
20
}
21
22
updateUser();

Response

Note about this response
1
{
2
"sid": "USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"identity": "john@example.com",
4
"friendly_name": "John Doe",
5
"avatar": "https://example.com/new-profile.png",
6
"state": "active",
7
"is_available": true,
8
"url": "https://frontline-api.twilio.com/v1/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
9
}

A user can be deactivated by updating their state to deactivated. When a user is deactivated:

  • All active sessions for that user will be invalidated, and the user will be logged out
  • The user will be removed from any pools they are a member of
(warning)

Warning

Deactivating a user by itself does not block a user from logging in to Frontline in the future. Before deactivating a Frontline user, their access to Frontline should be removed from your SSO provider. Once a user no longer has access to Frontline through your SSO provider, deactivating that user will invalidate any existing Frontline sessions from that user.

If a user's state has been deactivated but that user still has access to Frontline through your SSO provider, on their next login, that user's state will be updated to active

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function updateUser() {
11
const user = await client.frontlineApi.v1
12
.users("USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
13
.update({ state: "deactivated" });
14
15
console.log(user.state);
16
}
17
18
updateUser();

Response

Note about this response
1
{
2
"sid": "USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"identity": "john@example.com",
4
"friendly_name": "John Doe",
5
"avatar": "https://example.com/profile.png",
6
"state": "deactivated",
7
"is_available": true,
8
"url": "https://frontline-api.twilio.com/v1/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
9
}