Sessions endpoints

The Sessions endpoints enable you to work programatically with the sessions in your Gtmhub account. All CRUD operations are supported by the sessions API endpoints.

🔗
get
/sessions
Gets all the sessions 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
200planningSessionsResponse
400bad request
401unauthorized
402payment required
403forbidden
500internal server error

curl -X GET 'https://app.gtmhub.com/api/v2/sessions?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/sessions?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/sessions"



requests.get(url, headers = headers)
{}
🔗
get
/sessions/{id}/stats/goalsMet
Gets the goals that are over 99% in this session.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
sessionId
*
stringSpecifies the unique identifier (id) of the session.
expected in path
tagsstringA comma separated list of tag names/titles to filter by. The filter is inclusive (union). For example specifying tag names as "tag1,tag2" will return all items that have a tag1 or tag2 assigned.
expected in query, sample value:
string
Expected response codes
200goalsResponse
400bad request
500internal server error message.

curl -X GET 'https://app.gtmhub.com/api/v1/sessions/{id}/stats/goalsMet?tags=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/sessions/{id}/stats/goalsMet?tags=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/sessions/{id}/stats/goalsMet"



requests.get(url, headers = headers)
{}
🔗
get
/sessions/{sessionId}
Gets a session by its unique identifier (id) in the current Gtmhub account.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
sessionId
*
stringSpecifies the unique identifier (id) of the session.
expected in path
Expected response codes
200planningSessionResponse
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

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



requests.get(url, headers = headers)
{}
🔗
get
/sessions/{sessionId}/stats
Gets the stats for a planning session.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
sessionId
*
stringSpecifies the unique identifier (id) of the session.
expected in path
assigneeId
*
stringSpecifies the unique identifier (id) of the of the assignee. It could be a single user unique identifier or a team unique identifier.
expected in query, sample value:
string
tagsstringA comma separated list of tag names/titles to filter by. The filter is inclusive (union). For example specifying tag names as "tag1,tag2" will return all items that have a tag1 or tag2 assigned.
expected in query, sample value:
string
Expected response codes
200planningSessionStatsResponse
400bad request
500internal server error message.

curl -X GET 'https://app.gtmhub.com/api/v1/sessions/{sessionId}/stats?assigneeId=string&tags=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/sessions/{sessionId}/stats?assigneeId=string&tags=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/sessions/{sessionId}/stats"



requests.get(url, headers = headers)
{}
🔗
get
/sessions/{sessionId}/stats/assignees
Gets the stats for a planning session.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
sessionId
*
stringSpecifies the unique identifier (id) of the session.
expected in path
assigneeIds
*
stringThe IDs of the assignees. Can be either team or user id.
expected in query, sample value:
string
tagsstringA comma separated list of tag names/titles to filter by. The filter is inclusive (union). For example specifying tag names as "tag1,tag2" will return all items that have a tag1 or tag2 assigned.
expected in query, sample value:
string
Expected response codes
200assigneesPlanningSessionStatsResponse
400bad request error message.
403forbidden
404not found
500internal server error message.

curl -X GET 'https://app.gtmhub.com/api/v1/sessions/{sessionId}/stats/assignees?assigneeIds=string&tags=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/sessions/{sessionId}/stats/assignees?assigneeIds=string&tags=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/sessions/{sessionId}/stats/assignees"



requests.get(url, headers = headers)
{}
🔗
get
/sessions/{sessionId}/stats/badMetrics
Gets the metrics with bad progress (less than 60% of the projected for the current date).
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
sessionId
*
stringSpecifies the unique identifier (id) of the session.
expected in path
tagsstringA comma separated list of tag names/titles to filter by. The filter is inclusive (union). For example specifying tag names as "tag1,tag2" will return all items that have a tag1 or tag2 assigned.
expected in query, sample value:
string
Expected response codes
200metricsResponse
400bad request
500internal server error message.

curl -X GET 'https://app.gtmhub.com/api/v1/sessions/{sessionId}/stats/badMetrics?tags=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/sessions/{sessionId}/stats/badMetrics?tags=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/sessions/{sessionId}/stats/badMetrics"



requests.get(url, headers = headers)
{}
🔗
get
/sessions/{sessionId}/stats/dynamicMetrics
Gets the dynamic metrics for the specified planning session.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
sessionId
*
stringSpecifies the unique identifier (id) of the session.
expected in path
tagsstringA comma separated list of tag names/titles to filter by. The filter is inclusive (union). For example specifying tag names as "tag1,tag2" will return all items that have a tag1 or tag2 assigned.
expected in query, sample value:
string
Expected response codes
200metricsResponse
400bad request
500internal server error message.

curl -X GET 'https://app.gtmhub.com/api/v1/sessions/{sessionId}/stats/dynamicMetrics?tags=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/sessions/{sessionId}/stats/dynamicMetrics?tags=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/sessions/{sessionId}/stats/dynamicMetrics"



requests.get(url, headers = headers)
{}
🔗
get
/sessions/{sessionId}/stats/goodMetrics
Gets the metrics with good progress (more than 60% of the projected for the current date).
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
sessionId
*
stringSpecifies the unique identifier (id) of the session.
expected in path
tagsstringA comma separated list of tag names/titles to filter by. The filter is inclusive (union). For example specifying tag names as "tag1,tag2" will return all items that have a tag1 or tag2 assigned.
expected in query, sample value:
string
Expected response codes
200metricsResponse
400bad request
500internal server error message.

curl -X GET 'https://app.gtmhub.com/api/v1/sessions/{sessionId}/stats/goodMetrics?tags=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/sessions/{sessionId}/stats/goodMetrics?tags=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/sessions/{sessionId}/stats/goodMetrics"



requests.get(url, headers = headers)
{}
🔗
get
/sessions/{sessionId}/stats/manualMetrics
Gets the manual metrics for the specified planning session.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
sessionId
*
stringSpecifies the unique identifier (id) of the session.
expected in path
tagsstringA comma separated list of tag names/titles to filter by. The filter is inclusive (union). For example specifying tag names as "tag1,tag2" will return all items that have a tag1 or tag2 assigned.
expected in query, sample value:
string
Expected response codes
200metricsResponse
400bad request
500internal server error message.

curl -X GET 'https://app.gtmhub.com/api/v1/sessions/{sessionId}/stats/manualMetrics?tags=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/sessions/{sessionId}/stats/manualMetrics?tags=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/sessions/{sessionId}/stats/manualMetrics"



requests.get(url, headers = headers)
{}
🔗
get
/sessions/{sessionId}/stats/metricsMet
Gets the metrics which target values have been reached in the specified planning session.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
sessionId
*
stringSpecifies the unique identifier (id) of the session.
expected in path
tagsstringA comma separated list of tag names/titles to filter by. The filter is inclusive (union). For example specifying tag names as "tag1,tag2" will return all items that have a tag1 or tag2 assigned.
expected in query, sample value:
string
Expected response codes
200metricsResponse
400bad request
500internal server error message.

curl -X GET 'https://app.gtmhub.com/api/v1/sessions/{sessionId}/stats/metricsMet?tags=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/sessions/{sessionId}/stats/metricsMet?tags=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/sessions/{sessionId}/stats/metricsMet"



requests.get(url, headers = headers)
{}
🔗
post
/sessions
Creates a session in the current Gtmhub account.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
gtmhub-additional-paramsstringSpecifies additional parameters in the request header.
expected in header
planningSession
*
expected in body
Expected response codes
201planningSessionResponse
400bad request
401unauthorized
402payment required
403forbidden
500internal server error

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

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

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

body = undefined;

requests.post(url, data=json.dumps(body), headers = headers)
{}
🔗
put
/sessions/{sessionId}
Updates an existing session.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
gtmhub-additional-paramsstringSpecifies additional parameters in the request header.
expected in header
sessionId
*
stringSpecifies the unique identifier (id) of the session.
expected in path
planningSession
*
expected in body
Expected response codes
200planningSessionResponse
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

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

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

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

body = undefined;

requests.put(url, data=json.dumps(body), headers = headers)
{}
🔗
delete
/sessions/{sessionId}
Deletes a session by its unique 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
sessionId
*
stringSpecifies the unique identifier (id) of the session.
expected in path
Expected response codes
200ok
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

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



requests.delete(url, headers = headers)