Teams endpoints

The Teams group contains endpoints that enable you to create, retrieve, update and delete Teams in your Gtmhub account.

🔗
get
/teams
Gets all the teams in the account
Parameters
NameTypeDescription
fieldsstringList of fields to be retrieved, separated by comas (,).
expected in query, sample value:
name,description
sortstringList of fields separated by comas (,). To invert a field's sort, you can prefix its name with a minus (-). For example, the following expression: sort=-name,dateCreated would return entities in reverse lexicographical order and then ordered by dateCreated.
expected in query, sample value:
-name,dateCreated
filterstringThe format of the parameter is inspired by the MongoDB query format. For example, the following expression {name: {$in: ["sales", "marketing"]}} would return all the entities that have name either "sales" or "marketing". This expression {"name":{$regex:".*Sales.*"}} would return entities that contain "Sales" in their names.
expected in query, sample value:
{name: {$in: ["sales", "marketing"]}}
skipintegerHow many entities to be skipped when executing a GET query. By default skip value is 0.
expected in query, sample value:
5
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
Expected response codes

curl -X GET 'https://app.gtmhub.com/api/v2/teams?fields=name,description&sort=-name,dateCreated&filter={name: {$in: ["sales", "marketing"]}}&skip=5&limit=10&formatting=plainText' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \

var settings = { "url": "https://app.gtmhub.com/api/v2/teams?fields=name,description&sort=-name,dateCreated&filter={name: {$in: ["sales", "marketing"]}}&skip=5&limit=10&formatting=plainText", "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/v2/teams"



requests.get(url, headers = headers)
🔗
get
/teams/{teamId}
Gets a team by its unique identifier (id).
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
teamId
*
stringThe unique identifier (id) of the team.
expected in path
formattingstringThe formatting used for the description and custom fields of type text area. By default returned as 'mentionsMarkup' (Ex: "@[Mariya Velikova:[email protected]:602a65efc05575000123291b]"). Use 'plainText' if you need the response to be returned without markdown and special markup (Ex: "@Mariya Velikova").
expected in query, sample value:
string
Expected response codes
200teamResponse
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

curl -X GET 'https://app.gtmhub.com/api/v1/teams/{teamId}?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/teams/{teamId}?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/teams/{teamId}"



requests.get(url, headers = headers)
{}
🔗
post
/teams
Creates a new team in the account.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
team
*
The object representing a team.
expected in body
Expected response codes
201teamResponse
400bad request
401unauthorized
402payment required
403forbidden
500internal server error

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

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

var settings = { "url": "https://app.gtmhub.com/api/v1/teams", "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/teams"

body = undefined;

requests.post(url, data=json.dumps(body), headers = headers)
{}
🔗
post
/teams/activate
Activates teams status by ids.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
teamsIds
*
The object representing an array of teams ids to be activated/deactivated.
expected in body
Expected response codes
200BulkUpdateTeamsActivationStatusResponse
304not modified
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

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

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

var settings = { "url": "https://app.gtmhub.com/api/v1/teams/activate", "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/teams/activate"

body = undefined;

requests.post(url, data=json.dumps(body), headers = headers)
{}
🔗
post
/teams/deactivate
Deactivates teams status by ids.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
teamsIds
*
The object representing an array of teams ids to be activated/deactivated.
expected in body
Expected response codes
200BulkUpdateTeamsActivationStatusResponse
304not modified
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

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

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

var settings = { "url": "https://app.gtmhub.com/api/v1/teams/deactivate", "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/teams/deactivate"

body = undefined;

requests.post(url, data=json.dumps(body), headers = headers)
{}
🔗
put
/teams/{teamId}
Updates an already existing team in the account.
Note: The avatar and its color should be specified in the request body, otherwise both of them will be reset to the default ones.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
teamId
*
stringThe unique identifier (id) of the team.
expected in path
team
*
The object representing a team.
expected in body
Expected response codes
200teamResponse
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

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

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

var settings = { "url": "https://app.gtmhub.com/api/v1/teams/{teamId}", "method": "PUT", "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/teams/{teamId}"

body = undefined;

requests.put(url, data=json.dumps(body), headers = headers)
{}
🔗
put
/teams/{teamId}/manager
Assigns a new team manager. The new manager should be an already existing user.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
teamId
*
stringThe unique identifier (id) of the team.
expected in path
manager
*
Specifies the unique identifier (id) of the user that will be assigned as a new manager.
expected in body
Expected response codes
204no content
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

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

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

var settings = { "url": "https://app.gtmhub.com/api/v1/teams/{teamId}/manager", "method": "PUT", "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/teams/{teamId}/manager"

body = undefined;

requests.put(url, data=json.dumps(body), headers = headers)
🔗
put
/teams/{teamId}/members
Assigns team members to an already existing team.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
teamId
*
stringThe unique identifier (id) of the team.
expected in path
members
*
Specifies the unique identifiers (ids) of the users. If you need to assign more than one user to a team, the ids should be coma separated.
expected in body
Expected response codes
204no content
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

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

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

var settings = { "url": "https://app.gtmhub.com/api/v1/teams/{teamId}/members", "method": "PUT", "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/teams/{teamId}/members"

body = undefined;

requests.put(url, data=json.dumps(body), headers = headers)
🔗
patch
/teams/{teamId}
Partially updates a team. Only the fields that are specified in the request body will be updated.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
teamId
*
stringThe unique identifier (id) of the team.
expected in path
team
*
Specifies which team properties should be updated and can include individual fields, a subset of the available fields or all the fields at ones.
expected in body
Expected response codes
200
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

curl -X PATCH 'https://app.gtmhub.com/api/v1/teams/{teamId}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-d '{"team":undefined}'

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

var settings = { "url": "https://app.gtmhub.com/api/v1/teams/{teamId}", "method": "PATCH", "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/teams/{teamId}"

body = undefined;

requests.patch(url, data=json.dumps(body), headers = headers)
🔗
delete
/teams/{teamId}
Deletes a team by a specific team unique number identifier (id).
No request object required.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
teamId
*
stringThe unique identifier (id) of the team.
expected in path
Expected response codes
204no content
400bad request
401unauthorized
402payment required
403forbidden
500internal server error

curl -X DELETE 'https://app.gtmhub.com/api/v1/teams/{teamId}' \ -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/teams/{teamId}", "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/teams/{teamId}"



requests.delete(url, headers = headers)
🔗
delete
/teams/{teamId}/manager
Removes the team manager.
No request object required.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
teamId
*
stringThe unique identifier (id) of the team.
expected in path
Expected response codes
204no content
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

curl -X DELETE 'https://app.gtmhub.com/api/v1/teams/{teamId}/manager' \ -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/teams/{teamId}/manager", "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/teams/{teamId}/manager"



requests.delete(url, headers = headers)
🔗
delete
/teams/{teamId}/members/{memberId}
Deletes a team member.
No request object required.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
teamId
*
stringThe unique identifier (id) of the team.
expected in path
memberId
*
stringSpecifies the unique identifier (id) of the team member.
expected in path
Expected response codes
204no content
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

curl -X DELETE 'https://app.gtmhub.com/api/v1/teams/{teamId}/members/{memberId}' \ -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/teams/{teamId}/members/{memberId}", "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/teams/{teamId}/members/{memberId}"



requests.delete(url, headers = headers)