curl -X POST https://api.fireflies.ai/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your_api_key" \
-d '{
"query": "mutation($user_id: String!, $role: Role!) { setUserRole(user_id: $user_id, role:$role) { name is_admin } }",
"variables": {
"user_id": "your_user_id",
"role": "admin"
}
}'
{
"data": {
"setUserRole": {
"name": "Justin Fly",
"is_admin": "true",
}
}
}
Overview
The setUserRole
mutation allows for the updating of a user’s role within a team.
Arguments
The unique identifier of the user.
The Role to be assigned to the user. Valid types for user are admin
and
user
Usage Example
To set a user’s role, provide the user’s ID and the desired role as arguments to the mutation. Here’s an example of how this mutation could be used:
curl -X POST https://api.fireflies.ai/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your_api_key" \
-d '{
"query": "mutation($user_id: String!, $role: Role!) { setUserRole(user_id: $user_id, role:$role) { name is_admin } }",
"variables": {
"user_id": "your_user_id",
"role": "admin"
}
}'
{
"data": {
"setUserRole": {
"name": "Justin Fly",
"is_admin": "true",
}
}
}
Error Codes
List of possible error codes that may be returned by the setUserRole
mutation. Full list of error codes can be found here.
This may indicate that you are not a part of any team. Please contact support if you encounter this error
The user ID you are trying to query is not in your team.
The user does not have admin privileges to set the user role.
The team must have at least one admin. Please add an admin to the team or contact support if you encounter this error.
An invalid argument was provided to the mutation for the role
field. Please check the arguments you are providing and try again.
Additional Resources