Skip to content
FacebookYouTubeX (Twitter)

Team

A teammate is a special user who represents a Pingstreams user invited to a project with a specific role. When you work with teammates very often you will not use the user_id of the Pingstreams user but rather the specific id of your teammate in the project. In the Pingstreams API the temamate is named project_user. For example, if you want to know your project_user in a specific project, all you have to do is call this API: Get a teammate by id.

FieldTypeDescription
idStringThe unique identifier for the teammate which is given by Pingstreams.
roleStringThe teammate role. Values: owner, agent, admin, user, guest
user_availableBooleanDermine if the teammate is available or unavailable to accept requests
id_userObjectThe user object referenced by the teammate
max_served_chatNumberNumber of chats that agent is allowed to take at one time (Only Enterprise)
number_assigned_requestsNumberNumber of active request for the teammate (Only Enterprise)
statusStringThe status of a teammate. Can be “active” or “disabled”
isBusyBooleanDetermine if the teammate is busy (Only Enterprise)
profileStatusStringIt is an alias associated to the teammate availability. For example: inactive, to the toilet, on the phone
attributesObjectThe custom attributes which are set for the teammate.
tagsArrayA list of tags objects associated with the teammate.
settingsObjectThe setting configurations of the teammate.
presenceObjectThe presence info of the teammate.
isAuthenticatedBooleanReturns true if is strongly authenticated (custom-auth or email/password), false otherwise (anonymous).
isBusyBooleanReturns true if is teammate is busy, false otherwise. See Pingstreams Smart Assignment for more info.
createdAtStringThe time (ISO-8601 date string) when the teammate was created.
updatedAtStringThe time (ISO-8601 date string) when the teammate was updated.
createdByStringThe unique identifier of the row creator
id_projectStringThe unique identifier of the project
trashedBooleanTrue if the teammate has been removed from the project

Presence lets you track the online and offline status of the teammates in real-time (if you use Pingstreams Websocket or Webhook) and store the information state. Possible values: online, offline. Attention: an agent passes from online to offline only when he closed all Pingstreams messaging apps (eg Agent web chat in all tabs and mobile apps).

The field user_available determines if the teammate is available or unavailable to accept requests. Attention: Agent availability changes only when the agent explicitly changes from the UI from available to unavailable. If an agent is available and logs out, the agent remains available as he may have decided to serve chats from another channel (eg. Pingstreams mobile app).

GET https://api.pingstreams.com/v3/:project_id/project_users

Return the team members and availability

ParameterTypeDescription
project_idstringthe Project Id is a unique code assigned to your project when you create it in Pingstreams.
HeaderTypeDescription
AuthorizationstringAuthorization token. Basic Auth or JWT. Minumun role: agent
[
{
"_id":"5df2240cecd41b00173a06bc",
"id_project":"5df2240cecd41b00173a06bb",
"id_user":{
"_id":"5aaa99024c3b110014b478f0",
"email":"user@example.com",
"firstname":"Andrea",
"lastname":"Leo",
"emailverified":true,
"__v":0,
"resetpswrequestid":""
},
"role":"owner",
"user_available":true,
"createdBy":"5aaa99024c3b110014b478f0",
"createdAt":"2019-12-12T11:27:08.581Z",
"updatedAt":"2019-12-12T11:27:08.581Z",
"__v":0
},
{
"_id":"5df34ab80bc923001792e274",
"id_project":"5df2240cecd41b00173a06bb",
"id_user":{
"_id":"5de9200d6722370017731969",
"email":"admin@example.com",
"firstname":"Nuovopre",
"lastname":"Pre",
"emailverified":false,
"createdAt":"2019-12-05T15:19:41.296Z",
"updatedAt":"2019-12-05T15:19:41.296Z",
"__v":0
},
"role":"admin",
"user_available":true,
"createdBy":"5aaa99024c3b110014b478f0",
"createdAt":"2019-12-13T08:24:24.586Z",
"updatedAt":"2020-01-04T09:45:26.331Z",
"__v":0
},
{
"_id":"5e09e36d3030640017718ee2",
"id_project":"5df2240cecd41b00173a06bb",
"id_user":{
"_id":"5e09e36d3030640017718edf",
"email":"agent@example.com",
"firstname":"magnegerki",
"lastname":"magnegerki",
"emailverified":false,
"createdAt":"2019-12-30T11:45:49.123Z",
"updatedAt":"2019-12-30T11:45:49.123Z",
"__v":0
},
"role":"agent",
"user_available":false,
"createdBy":"5aaa99024c3b110014b478f0",
"createdAt":"2019-12-30T11:45:49.419Z",
"updatedAt":"2020-01-04T09:45:27.207Z",
"__v":0
}
]

GET https://api.pingstreams.com/v3/:project_id/project_users/:project_user_id

ParameterTypeDescription
project_idstringthe Project Id is a unique code assigned to your project when you create it in Pingstreams.
project_user_idstringThe teammate identifier.
HeaderTypeDescription
AuthorizationstringAuthorization token. Basic Auth or JWT. Minumun role: agent
{
"_id":"5df2240cecd41b00173a06bc",
"id_project":"5df2240cecd41b00173a06bb",
"id_user":{
"_id":"5aaa99024c3b110014b478f0",
"email":"user@example.com",
"firstname":"Andrea",
"lastname":"Leo",
"emailverified":true,
"__v":0,
"resetpswrequestid":""
},
"role":"owner",
"user_available":true,
"createdBy":"5aaa99024c3b110014b478f0",
"createdAt":"2019-12-12T11:27:08.581Z",
"updatedAt":"2019-12-12T11:27:08.581Z",
"__v":0
}

GET https://api.pingstreams.com/v3/:project_id/project_users/users/:user_id

ParameterTypeDescription
project_idstringthe Project Id is a unique code assigned to your project when you create it in Pingstreams.
user_idstringThe user identifier.
HeaderTypeDescription
AuthorizationstringAuthorization token. Basic Auth or JWT. Minumun role: agent
{
"_id":"5df2240cecd41b00173a06bc",
"id_project":"5df2240cecd41b00173a06bb",
"id_user":{
"_id":"5aaa99024c3b110014b478f0",
"email":"user@example.com",
"firstname":"Andrea",
"lastname":"Leo",
"emailverified":true,
"__v":0,
"resetpswrequestid":""
},
"role":"owner",
"user_available":true,
"createdBy":"5aaa99024c3b110014b478f0",
"createdAt":"2019-12-12T11:27:08.581Z",
"updatedAt":"2019-12-12T11:27:08.581Z",
"__v":0
}

POST https://api.pingstreams.com/v3/:project_id/project_users/invite

Invite an agent to a project.

ParameterTypeDescription
project_idstringThe project_id is a unique code assigned to your project when you create it in Pingstreams
HeaderTypeDescription
AuthorizationstringAuthorization token. Basic Auth or JWT. Minumun role: admin
Content-Typestringuse “application/json” value
FieldTypeDescription
emailstringthe agent email address
rolestringthe agent role. Accepted values: agent, admin
firstnamestringthe firstname of the agent
lastnamestringthe lastname of the agent
user_availablebooleanthe initial agent status. Available (true) or unavailable (false).

PUT https://api.pingstreams.com/v3/:project_id/project_users/

ParameterTypeDescription
project_idstringThe project_id is a unique code assigned to your project when you create it in Pingstreams
HeaderTypeDescription
AuthorizationstringAuthorization token. Basic Auth or JWT. Minumun role: agent
Content-Typestringuse “application/json” value
FieldTypeDescription
rolestringThe teammate role. Permitted values: admin, agent.
user_availablebooleanThe teammate availability. True for available, false for unavailable. Default is true
max_served_chatnumberThe number of concurrent chats the teammate can take at once.
attributesobjectThe teammate custom attributes
settingsobjectThe teammate settings object

PUT https://api.pingstreams.com/v3/:project_id/project_users/:project_user_id

It requires admin role

ParameterTypeDescription
project_idstringThe project_id is a unique code assigned to your project when you create it in Pingstreams
project_user_idstringThe teammate identifier.
HeaderTypeDescription
AuthorizationstringAuthorization token. Basic Auth or JWT. Minumun role: admin
Content-Typestringuse “application/json” value
FieldTypeDescription
rolestringThe teammate role. Permitted values: admin, agent.
user_availablebooleanThe teammate availability. True for available, false for unavailable. Default is true
max_served_chatnumberThe number of concurrent chats the teammate can take at once.
attributesobjectThe teammate custom attributes
settingsobjectThe teammate settings object

DELETE https://api.pingstreams.com/v3/:project_id/project_users/:project_user_id

Leave an agent from a project.

ParameterTypeDescription
project_idstringThe project_id is a unique code assigned to your project when you create it in Pingstreams
project_user_idstringThe teammate identifier.
HeaderTypeDescription
AuthorizationstringAuthorization token. Basic Auth or JWT. Minumun role: admin