Users endpoints

The Users endpoints enable you to create, retrieve, update and delete users in your Gtmhub account.

DEPRECATED
🔗
get
/accounts/users
Gets all users in the specified Gtmhub account.
This endpoint is deprecated. Use Get Users V2 instead.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the id of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
filterstringFilter query in Lucene query syntax. Supports filtering by: email, name, roles. Filter syntax: filter=property:value. To filter by roles, use filter=roles:roleId1,roleId2.
expected in query, sample value:
roles:573dbb61ed915d0005cc2c4d,roles:573dbb61ed915d0005cc2c7f
skipintegerHow many entities to skip when executing a get query. By default skip value is 0. Used when implementing paging
expected in query, sample value:
50
takeintegerThe max number of entities that can be returned by the get query. By default take value is 100. Used when implementing paging
expected in query, sample value:
50
includeShadowedRolesbooleanSpecifies whether or not to include shadowed (e.g. team roles) user roles in the response. If this parameter is set to 'true' all user roles in current account will be fetched. If set to 'false' or not set at all, shadowed roles (like team roles) will be excluded from the result.
expected in query, sample value:
true
Expected response codes
200usersResponse
400bad request
401unauthorized
402payment required
403forbidden
500internal server error

curl -X GET 'https://app.gtmhub.com/api/v1/accounts/users?filter=roles:573dbb61ed915d0005cc2c4d,roles:573dbb61ed915d0005cc2c7f&skip=50&take=50&includeShadowedRoles=true' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \

var settings = { "url": "https://app.gtmhub.com/api/v1/accounts/users?filter=roles:573dbb61ed915d0005cc2c4d,roles:573dbb61ed915d0005cc2c7f&skip=50&take=50&includeShadowedRoles=true", "method": "GET", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/accounts/users"



requests.get(url, headers = headers)
{}
🔗
get
/users
Loads all users for a specific account using filter, sort and field projection.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
fields
*
stringSpecifies the list of fields to be returned in the response. For example, to get only the user's email, first and last name use fields=email,firstName,lastName
expected in path, sample value:
email,firstName,lastName
limitintegerThe max number of entities that can be returned by the GET query. By default take value is 100.
expected in query, sample value:
10
formattingstringThe formatting used for the description and custom fields of type text area. By default returned as 'mentionsMarkup'. Ex: "@[John Smith:[email protected]:602a65efc05575000123291b]". Use 'plainText' if you need the response to be returned without markdown and special markup. Ex: "@John Smith"
expected in query, sample value:
plainText
filterstringSpecifies the filter in Mongo syntax. For example, to get a single user by their Id, use filter={"_id":"611fce386400780001b19e1e"}.
expected in query, sample value:
{"_id":"611fce386400780001b19e1e"}
sortstringSpecifies the sort expression. For example, to sort users by their creation date user sort=dateCreated or sort=-dateCreated (to sort in descending order).
expected in query, sample value:
dateCreated
skipstringSpecifies how many items to skip from the beginning of the collection. Use this to implement paging. For example, if you want to get users 5-10 use skip=5&take=5. Always sort your response to ensure that you're paging through the collection in the same order, for example sort=dateCreated&skip=5&take=5.
expected in query, sample value:
5
takestringSpecifies how many items to take from the collection. Use this to implement paging. For example, if you want to get the first 10 users use take=10. Always sort your response to ensure that you're paging through the collection in the same order, for example sort=dateCreated&take=10.
expected in query, sample value:
10
Expected response codes
200usersResponse
400bad request error message.
401unauthorized
402payment required
403forbidden
500internal server error message.

curl -X GET 'https://app.gtmhub.com/api/v2/users?limit=10&formatting=plainText&filter={"_id":"611fce386400780001b19e1e"}&sort=dateCreated&skip=5&take=10' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \

var settings = { "url": "https://app.gtmhub.com/api/v2/users?limit=10&formatting=plainText&filter={"_id":"611fce386400780001b19e1e"}&sort=dateCreated&skip=5&take=10", "method": "GET", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v2/users"



requests.get(url, headers = headers)
{}
DEPRECATED
🔗
get
/users/password/{clientId}/policy
Gets the password policy for the current authenticated user
Parameters
NameTypeDescription
Expected response codes
200string message returned by the service
403forbidden
500internal server error message.

curl -X GET 'https://app.gtmhub.com/api/v1/users/password/{clientId}/policy' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \

var settings = { "url": "https://app.gtmhub.com/api/v1/users/password/{clientId}/policy", "method": "GET", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/users/password/{clientId}/policy"



requests.get(url, headers = headers)
🔗
get
/users/{userId}
Gets a single user by provided user ID.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
userId
*
stringSpecifies the user unique identifier (id).
expected in path
formattingstringThe formatting used for the custom fields of type text area. By default they are returned as 'mentionsMarkup' and they can contain markdown and special markup for mentioned people. Use 'plainText' if you want the response without markdown and special markup.
expected in query, sample value:
string
Expected response codes
200userResponse
400bad request error message.
403forbidden
404not found
500internal server error message.

curl -X GET 'https://app.gtmhub.com/api/v1/users/{userId}?formatting=string' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \

var settings = { "url": "https://app.gtmhub.com/api/v1/users/{userId}?formatting=string", "method": "GET", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/users/{userId}"



requests.get(url, headers = headers)
{}
🔗
get
/users/{userId}/managers
Gets all manager id's for teams that user belongs to where the user is not the manager of the team.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
userId
*
stringSpecifies the user unique identifier (id).
expected in path
Expected response codes
200userManagersResponse
400bad request error message.
404not found
500internal server error message.

curl -X GET 'https://app.gtmhub.com/api/v1/users/{userId}/managers' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \

var settings = { "url": "https://app.gtmhub.com/api/v1/users/{userId}/managers", "method": "GET", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/users/{userId}/managers"



requests.get(url, headers = headers)
{}
DEPRECATED
🔗
post
/users
Creates a new user. You must have the correct permissions to create a new user.
This endpoint is deprecated as of 30/05/2022. Use POST Users instead.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
gtmhub-additional-paramsstringInternal use only. Specifies additional parameters in the request header.
expected in header
skipEmailbooleanSkip sending email invitation.
expected in query
user
*
The object representing a user.
expected in body
Expected response codes
201userResponse
400bad request error message.
401unauthorized
403forbidden
409conflict
429too many requests
500internal server error message.

curl -X POST 'https://app.gtmhub.com/api/v1/users?skipEmail=undefined' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-H 'gtmhub-additional-params: ' \
-d '{"user":undefined}'

var body ='{"user":undefined}'

var settings = { "url": "https://app.gtmhub.com/api/v1/users?skipEmail=undefined", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
"gtmhub-additional-params": "",
},
"data": body
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/users"

body = undefined;

requests.post(url, data=json.dumps(body), headers = headers)
{}
🔗
post
/users/activate
Bulk activate of the provided users.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
gtmhub-additional-paramsstringInternal use only. Specifies additional parameters in the request header.
expected in header
usersIds
*
An array of selected users to invited in batch.
expected in body, sample value:
["6154ad124654jdk901e43c15", "6166f85e4a38b89301380b13"]
Expected response codes
200BulkUpdateUsersActivationStatusResponse
400bad request error message.
403forbidden
500internal server error message.

curl -X POST 'https://app.gtmhub.com/api/v1/users/activate' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-H 'gtmhub-additional-params: ' \
-d '["6154ad124654jdk901e43c15", "6166f85e4a38b89301380b13"]'

var body ='["6154ad124654jdk901e43c15", "6166f85e4a38b89301380b13"]'

var settings = { "url": "https://app.gtmhub.com/api/v1/users/activate", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
"gtmhub-additional-params": "",
},
"data": body
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/users/activate"

body = ["6154ad124654jdk901e43c15", "6166f85e4a38b89301380b13"];

requests.post(url, data=json.dumps(body), headers = headers)
{}
🔗
post
/users/deactivate
Bulk deactivate of the provided users.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
gtmhub-additional-paramsstringInternal use only. Specifies additional parameters in the request header.
expected in header
usersIds
*
An array of selected users to invited in batch.
expected in body, sample value:
["6154ad124654jdk901e43c15", "6166f85e4a38b89301380b13"]
Expected response codes
200BulkUpdateUsersActivationStatusResponse
400bad request error message.
403forbidden
500internal server error message.

curl -X POST 'https://app.gtmhub.com/api/v1/users/deactivate' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-H 'gtmhub-additional-params: ' \
-d '["6154ad124654jdk901e43c15", "6166f85e4a38b89301380b13"]'

var body ='["6154ad124654jdk901e43c15", "6166f85e4a38b89301380b13"]'

var settings = { "url": "https://app.gtmhub.com/api/v1/users/deactivate", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
"gtmhub-additional-params": "",
},
"data": body
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/users/deactivate"

body = ["6154ad124654jdk901e43c15", "6166f85e4a38b89301380b13"];

requests.post(url, data=json.dumps(body), headers = headers)
{}
🔗
post
/users/delete
Bulk delete of the provided users.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
gtmhub-additional-paramsstringInternal use only. Specifies additional parameters in the request header.
expected in header
userIDs
*
An array of selected users to be deleted in batch.
expected in body, sample value:
["6169fc51cfe8soer8548f4b0f", "6169fc53cfe80388888f4b1d"]
Expected response codes
200usersBulkDeleteResponse
400bad request error message.
403forbidden
404not found
500internal server error message.

curl -X POST 'https://app.gtmhub.com/api/v1/users/delete' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-H 'gtmhub-additional-params: ' \
-d '["6169fc51cfe8soer8548f4b0f", "6169fc53cfe80388888f4b1d"]'

var body ='["6169fc51cfe8soer8548f4b0f", "6169fc53cfe80388888f4b1d"]'

var settings = { "url": "https://app.gtmhub.com/api/v1/users/delete", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
"gtmhub-additional-params": "",
},
"data": body
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/users/delete"

body = ["6169fc51cfe8soer8548f4b0f", "6169fc53cfe80388888f4b1d"];

requests.post(url, data=json.dumps(body), headers = headers)
{}
🔗
post
/users/invitations
Sends invitation emails to selected users.
Helpful if you invited users to your account and chose to not send invitation emails.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
usersIds
*
An array of selected users to invited in batch.
expected in body, sample value:
["6154ad124654jdk901e43c15", "6166f85e4a38b89301380b13"]
Expected response codes
204no content
400bad request error message.
401unauthorized
402payment required
403forbidden
500internal server error message.

curl -X POST 'https://app.gtmhub.com/api/v1/users/invitations' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-d '["6154ad124654jdk901e43c15", "6166f85e4a38b89301380b13"]'

var body ='["6154ad124654jdk901e43c15", "6166f85e4a38b89301380b13"]'

var settings = { "url": "https://app.gtmhub.com/api/v1/users/invitations", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
},
"data": body
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/users/invitations"

body = ["6154ad124654jdk901e43c15", "6166f85e4a38b89301380b13"];

requests.post(url, data=json.dumps(body), headers = headers)
🔗
post
/users/roles
Bulk update to change roles for current users.
Supports multiple roles and multiples users to be updated simultaneously.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
bulkUpdateUserRoles
*
The object representing a bulk request to update user roles.
expected in body
Expected response codes
200bulkUpdateUsersRolesResponse
400bad request error message.
403forbidden
500internal server error message.

curl -X POST 'https://app.gtmhub.com/api/v1/users/roles' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-d '{"bulkUpdateUserRoles":undefined}'

var body ='{"bulkUpdateUserRoles":undefined}'

var settings = { "url": "https://app.gtmhub.com/api/v1/users/roles", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
},
"data": body
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/users/roles"

body = undefined;

requests.post(url, data=json.dumps(body), headers = headers)
{}
🔗
post
/users/{userId}/roles
Assigns a single role to a user.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
gtmhub-additional-paramsstringInternal use only. Specifies additional parameters in the request header.
expected in header
userId
*
stringSpecifies the user unique identifier (id).
expected in path
userRoleRequest
*
Relation between a user and a role.
expected in body
Expected response codes
200ok
400bad request error message.
404not found

curl -X POST 'https://app.gtmhub.com/api/v1/users/{userId}/roles' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-H 'gtmhub-additional-params: ' \
-d '{"userRoleRequest":undefined}'

var body ='{"userRoleRequest":undefined}'

var settings = { "url": "https://app.gtmhub.com/api/v1/users/{userId}/roles", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
"gtmhub-additional-params": "",
},
"data": body
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/users/{userId}/roles"

body = undefined;

requests.post(url, data=json.dumps(body), headers = headers)
🔗
post
/users/{userId}/send-change-password-email
This handler is used to prepare to send the reset password link.
Parameters
NameTypeDescription
Expected response codes
200ok
400bad request error message.
401unauthorized
403forbidden
500internal server error message.

curl -X POST 'https://app.gtmhub.com/api/v1/users/{userId}/send-change-password-email' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \

var settings = { "url": "https://app.gtmhub.com/api/v1/users/{userId}/send-change-password-email", "method": "POST", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/users/{userId}/send-change-password-email"



requests.post(url, headers = headers)
DEPRECATED
🔗
put
/users/settings
Updates the user's personal settings.
This endpoint is deprecated. Use PUT Users instead.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
gtmhub-additional-paramsstringInternal use only. Specifies additional parameters in the request header.
expected in header
Expected response codes
200ok
400bad request error message.
404not found
500internal server error message.

curl -X PUT 'https://app.gtmhub.com/api/v1/users/settings' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-H 'gtmhub-additional-params: ' \

var settings = { "url": "https://app.gtmhub.com/api/v1/users/settings", "method": "PUT", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
"gtmhub-additional-params": "",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/users/settings"



requests.put(url, headers = headers)
🔗
put
/users/{userId}
Updates the user's personal language settings.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
gtmhub-additional-paramsstringInternal use only. Specifies additional parameters in the request header.
expected in header
userId
*
stringSpecifies the user unique identifier (id).
expected in path
userSettingsRequest
*
expected in body
Expected response codes
200ok
400bad request error message.
500internal server error message.

curl -X PUT 'https://app.gtmhub.com/api/v1/users/{userId}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-H 'gtmhub-additional-params: ' \
-d '{"userSettingsRequest":undefined}'

var body ='{"userSettingsRequest":undefined}'

var settings = { "url": "https://app.gtmhub.com/api/v1/users/{userId}", "method": "PUT", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
"gtmhub-additional-params": "",
},
"data": body
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/users/{userId}"

body = undefined;

requests.put(url, data=json.dumps(body), headers = headers)
🔗
patch
/users/{userId}
Updates the users first and last name.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
userId
*
stringSpecifies the user unique identifier (id).
expected in path
Expected response codes
200ok
400bad request error message.
500internal server error message.

curl -X PATCH 'https://app.gtmhub.com/api/v1/users/{userId}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \

var settings = { "url": "https://app.gtmhub.com/api/v1/users/{userId}", "method": "PATCH", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/users/{userId}"



requests.patch(url, headers = headers)
🔗
delete
/accounts/user/{id}
Deletes a user with the specified id.
This operation deletes the user from the database irreversibly.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the id of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
id
*
stringThe ID of the user.
expected in path, sample value:
5be26318e5274a0007f17f61
Expected response codes
200ok
400bad request
401unauthorized
402payment required
403forbidden
409conflict
500internal server error

curl -X DELETE 'https://app.gtmhub.com/api/v1/accounts/user/{id}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \

var settings = { "url": "https://app.gtmhub.com/api/v1/accounts/user/{id}", "method": "DELETE", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/accounts/user/{id}"



requests.delete(url, headers = headers)
🔗
delete
/users/{userId}/roles/{roleId}
Deletes selected role from selected user.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
userId
*
stringSpecifies the user unique identifier (id).
expected in path
roleId
*
stringSpecifies the unique role identifier (roleId).
expected in path
Expected response codes
200ok
400bad request error message.
404not found
409conflict
500internal server error message.

curl -X DELETE 'https://app.gtmhub.com/api/v1/users/{userId}/roles/{roleId}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \

var settings = { "url": "https://app.gtmhub.com/api/v1/users/{userId}/roles/{roleId}", "method": "DELETE", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
"gtmhub-accountId": "5be26318e5274a0007f17f61",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/users/{userId}/roles/{roleId}"



requests.delete(url, headers = headers)
🔗
delete
/users/{userId}/roles?ids={roleIds}
Deletes selected roles from selected user.
Parameters
NameTypeDescription
Expected response codes
200ok
400bad request error message.
409conflict
500internal server error message.

curl -X DELETE 'https://app.gtmhub.com/api/v1/users/{userId}/roles?ids={roleIds}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \

var settings = { "url": "https://app.gtmhub.com/api/v1/users/{userId}/roles?ids={roleIds}", "method": "DELETE", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
}
}; $.ajax(settings).done(function (response) { console.log(response); });
 NOTE: You must install the module requests.
In a terminal window do: pip install requests



import requests, json

headers = { "Authorization" : "Bearer {token}", "gtmhub-accountId" : "{accountId}", "Content-Type" : "application/json" };

url = "https://app.gtmhub.com/api/v1/users/{userId}/roles?ids={roleIds}"



requests.delete(url, headers = headers)