Mutations
addLabelsToUser
Add one or more team labels to a Plain user (agent). Only label types with type TEAM may be applied to users. Label types already present on the user are silently skipped. Requires the label:create permission.
MUTATION
addLabelsToUser(input: AddLabelsToUserInput!): AddLabelsToUserOutput!Arguments
input
required
Returns
labels
[Label!]!
user
error
Mutation
mutation AddLabelsToUser($input: AddLabelsToUserInput!) {
addLabelsToUser(input: $input) {
labels {
id
labelType {
id
name
icon
color
type
description
}
createdAt {
unixTimestamp
iso8601
}
createdBy {
__typename
... on UserActor {
__typename
}
}
updatedAt {
unixTimestamp
iso8601
}
updatedBy {
__typename
... on UserActor {
__typename
}
}
}
user {
id
fullName
publicName
avatarUrl
avatar {
id
fileName
fileSize {
__typename
}
fileExtension
fileMimeType
visibility
}
email
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"labelTypeIds": [
"id"
],
"entityId": "id"
}
}Response
{
"data": {
"addLabelsToUser": {
"labels": [
{
"id": "id",
"labelType": {
"id": "id",
"name": "string",
"icon": "string",
"color": "string",
"type": "DEFAULT",
"description": "string"
},
"createdAt": {
"unixTimestamp": "string",
"iso8601": "string"
},
"createdBy": {
"__typename": "UserActor"
},
"updatedAt": {
"unixTimestamp": "string",
"iso8601": "string"
},
"updatedBy": {
"__typename": "UserActor"
}
}
],
"user": {
"id": "id",
"fullName": "string",
"publicName": "string",
"avatarUrl": "string",
"avatar": {
"id": "id",
"fileName": "string",
"fileSize": {
"__typename": "FileSize"
},
"fileExtension": "string",
"fileMimeType": "string",
"visibility": "PRIVATE"
},
"email": "string"
},
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}Was this page helpful?
⌘I
Mutation
mutation AddLabelsToUser($input: AddLabelsToUserInput!) {
addLabelsToUser(input: $input) {
labels {
id
labelType {
id
name
icon
color
type
description
}
createdAt {
unixTimestamp
iso8601
}
createdBy {
__typename
... on UserActor {
__typename
}
}
updatedAt {
unixTimestamp
iso8601
}
updatedBy {
__typename
... on UserActor {
__typename
}
}
}
user {
id
fullName
publicName
avatarUrl
avatar {
id
fileName
fileSize {
__typename
}
fileExtension
fileMimeType
visibility
}
email
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"labelTypeIds": [
"id"
],
"entityId": "id"
}
}Response
{
"data": {
"addLabelsToUser": {
"labels": [
{
"id": "id",
"labelType": {
"id": "id",
"name": "string",
"icon": "string",
"color": "string",
"type": "DEFAULT",
"description": "string"
},
"createdAt": {
"unixTimestamp": "string",
"iso8601": "string"
},
"createdBy": {
"__typename": "UserActor"
},
"updatedAt": {
"unixTimestamp": "string",
"iso8601": "string"
},
"updatedBy": {
"__typename": "UserActor"
}
}
],
"user": {
"id": "id",
"fullName": "string",
"publicName": "string",
"avatarUrl": "string",
"avatar": {
"id": "id",
"fileName": "string",
"fileSize": {
"__typename": "FileSize"
},
"fileExtension": "string",
"fileMimeType": "string",
"visibility": "PRIVATE"
},
"email": "string"
},
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}
