Objectives endpoints

In the Gtmhub REST API Goals is the programmatic name of Objectives. All endpoints listed in this section enable you to perform CRUD operations with Objectives.

🔗
get
/goals
Gets all goals (Objectives) in the current Gtmhub account.
By default goal metrics (Key Results) and links.expanded are not included in the response.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
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
200goalsResponse
400bad request
401unauthorized
402payment required
403forbidden
500internal server error

curl -X GET 'https://app.gtmhub.com/api/v2/goals?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}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \

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



requests.get(url, headers = headers)
{}
🔗
get
/goals/groupBy/owners
Gets a list of users or teams that are goal owners and their corresponding owned goals.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
filterstringThe named filter for filtering goals by their deadline dates. One of current, past, future.
expected in query, sample value:
current
idsstringA comma separated list of goal ids to filter by.
expected in query, sample value:
61a74153d8b312000145b519,602e31560f20d500012dbe0e
ownerIdsstringA comma separated list of goal owner ids to filter by.
expected in query, sample value:
6197665868264500014d04e0,619765b69b8b5c0001b5e669
metricOwnerIdstringA comma separated list of metric owner ids to filter by.
expected in query, sample value:
615a9d1c84d86400013f8170,6197665815627f0001850837
attainmentstringSpecifies the value of the goal attainment to filter by. Supports operators like greater(>) or less(<) than.
expected in query, sample value:
>0.5
metricBeforestringSpecifies that the goal must have metrics checked in before that date. Date format: yyyy-mm-dd
expected in query, sample value:
2021-03-20
metricAfterstringSpecifies that the goal must have metrics checked in after that date. Date format: yyyy-mm-dd
expected in query, sample value:
2021-03-20
metricAttainmentstringSpecifies that the goal must have metrics with attainment that is greater or less than the specified. Supports operators like greater or less than.
expected in query, sample value:
>1
sortstringList of fields separated by comas (,). To invert a field's sort, you can prefix its name with a minus (-).
expected in query, sample value:
-attainment
includeMetricsbooleanSpecifies whether to include metrics objects as part of the returned goals entities or not. The default value if omitted is false.
expected in query, sample value:
true
skipintegerHow many entities to be skipped when executing a GET query.
expected in query, sample value:
5
takeintegerThe max number of entities that can be returned by executing a GET query.
expected in query, sample value:
50
Expected response codes
200goalsGroupedByResponse
400bad request
401unauthorized
403forbidden
500internal server error

curl -X GET 'https://app.gtmhub.com/api/v1/goals/groupBy/owners?filter=current&ids=61a74153d8b312000145b519,602e31560f20d500012dbe0e&ownerIds=6197665868264500014d04e0,619765b69b8b5c0001b5e669&metricOwnerId=615a9d1c84d86400013f8170,6197665815627f0001850837&attainment=>0.5&metricBefore=2021-03-20&metricAfter=2021-03-20&metricAttainment=>1&sort=-attainment&includeMetrics=true&skip=5&take=50' \ -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/goals/groupBy/owners?filter=current&ids=61a74153d8b312000145b519,602e31560f20d500012dbe0e&ownerIds=6197665868264500014d04e0,619765b69b8b5c0001b5e669&metricOwnerId=615a9d1c84d86400013f8170,6197665815627f0001850837&attainment=>0.5&metricBefore=2021-03-20&metricAfter=2021-03-20&metricAttainment=>1&sort=-attainment&includeMetrics=true&skip=5&take=50", "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/goals/groupBy/owners"



requests.get(url, headers = headers)
{}
🔗
get
/goals/groupBy/reviewers
Gets a list of users that are selected as reviewers and their corresponding goals to review.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
filterstringThe named filter for filtering goals by their deadline dates. One of current, past, future.
expected in query, sample value:
current
idsstringA comma separated list of goal ids to filter by.
expected in query, sample value:
61a74153d8b312000145b519,602e31560f20d500012dbe0e
ownerIdsstringA comma separated list of goal owner ids to filter by.
expected in query, sample value:
6197665868264500014d04e0,619765b69b8b5c0001b5e669
metricOwnerIdstringA comma separated list of metric owner ids to filter by.
expected in query, sample value:
615a9d1c84d86400013f8170,6197665815627f0001850837
attainmentstringSpecifies the value of the goal attainment to filter by. Supports operators like greater(>) or less(<) than.
expected in query, sample value:
>0.5
metricBeforestringSpecifies that the goal must have metrics checked in before that date. Date format: yyyy-mm-dd
expected in query, sample value:
2021-03-20
metricAfterstringSpecifies that the goal must have metrics checked in after that date. Date format: yyyy-mm-dd
expected in query, sample value:
2021-03-20
metricAttainmentstringSpecifies that the goal must have metrics with attainment that is greater or less than the specified. Supports operators like greater or less than.
expected in query, sample value:
>1
sortstringList of fields separated by comas (,). To invert a field's sort, you can prefix its name with a minus (-).
expected in query, sample value:
-attainment
includeMetricsbooleanSpecifies whether to include metrics objects as part of the returned goals entities or not. The default value if omitted is false.
expected in query, sample value:
true
skipintegerHow many entities to be skipped when executing a GET query.
expected in query, sample value:
5
takeintegerThe max number of entities that can be returned by executing a GET query.
expected in query, sample value:
50
Expected response codes
200goalsGroupedByResponse
400bad request
401unauthorized
403forbidden
500internal server error

curl -X GET 'https://app.gtmhub.com/api/v1/goals/groupBy/reviewers?filter=current&ids=61a74153d8b312000145b519,602e31560f20d500012dbe0e&ownerIds=6197665868264500014d04e0,619765b69b8b5c0001b5e669&metricOwnerId=615a9d1c84d86400013f8170,6197665815627f0001850837&attainment=>0.5&metricBefore=2021-03-20&metricAfter=2021-03-20&metricAttainment=>1&sort=-attainment&includeMetrics=true&skip=5&take=50' \ -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/goals/groupBy/reviewers?filter=current&ids=61a74153d8b312000145b519,602e31560f20d500012dbe0e&ownerIds=6197665868264500014d04e0,619765b69b8b5c0001b5e669&metricOwnerId=615a9d1c84d86400013f8170,6197665815627f0001850837&attainment=>0.5&metricBefore=2021-03-20&metricAfter=2021-03-20&metricAttainment=>1&sort=-attainment&includeMetrics=true&skip=5&take=50", "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/goals/groupBy/reviewers"



requests.get(url, headers = headers)
{}
🔗
get
/goals/metric/{ownerId}
Gets goals based on metric owner unique identifier (id).
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
ownerId
*
stringSpecifies the unique identifier (id) of the metric owner.
expected in path, sample value:
6138969ab6adf10001fc329c
Expected response codes
200goalsResponse
400bad request
401unauthorized
402payment required
403forbidden
500internal server error

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



requests.get(url, headers = headers)
{}
🔗
get
/goals/{goalId}
Gets a goal by its unique identifier (id) in the current gtmhub account.
By default the content of links.expanded is not included as part of the response due to its potential size. If you wish to include the full linked fields, use the fields projection option in the query string. Example: ?fields=name,links
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
goalId
*
stringSpecifies the unique identifier of the goal (objective).
expected in path, sample value:
6138969ab6adf10001fc329c
fieldsstringList of fields to be retrieved, separated by comas (,). The 'id' and 'accountId' fields are needed to identify an object so they are always included. If any of the fields is a complex object with sub-fields you can specify which set to include using the 'parent-field-name{sub-field-names}' syntax.
expected in query, sample value:
name,sessionId,metrics{name,attainment},links{expanded}
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:
mentionsMarkup
Expected response codes
200goalMetricsLinksResponse
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

curl -X GET 'https://app.gtmhub.com/api/v1/goals/{goalId}?fields=name,sessionId,metrics{name,attainment},links{expanded}&formatting=mentionsMarkup' \ -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/goals/{goalId}?fields=name,sessionId,metrics{name,attainment},links{expanded}&formatting=mentionsMarkup", "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/goals/{goalId}"



requests.get(url, headers = headers)
{}
🔗
get
/goals/{goalId}/workflow-actions
Returns workflow actions for a given goal.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
goalId
*
stringSpecifies the unique identifier of the goal (objective).
expected in path, sample value:
6138969ab6adf10001fc329c
Expected response codes
200goalWorkflowActionResponse
400bad request error message.
404not found
500internal server error message.

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



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

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

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

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

body = undefined;

requests.post(url, data=json.dumps(body), headers = headers)
{}
🔗
post
/goals/bulk
Creates multiple goals in the current Gtmhub account.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
goals
*
The object representing the list of the goals to be created.
expected in body, sample value:
[
Expected response codes
201createdGoalsResponse
400bad request
401unauthorized
402payment required
403forbidden
500internal server error

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

var body ='{"goals":[}'

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

body = [;

requests.post(url, data=json.dumps(body), headers = headers)
{}
🔗
post
/goals/{goalId}/approve
Changes the status of the goal to "approved". This endpoint is relevant for goals that have approval workflow enabled.
More info: https://help.gtmhub.com/en/articles/3125479-approval-workflow The goal can be approved only if the current user is selected as reviewer, otherwise an error occurs.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
goalId
*
stringSpecifies the unique identifier of the goal (objective).
expected in path, sample value:
6138969ab6adf10001fc329c
comment
*
The object used to describe the reason for approving/declining a goal.
expected in body
Expected response codes
204no content
400bad request error message.
404not found
500internal server error message.

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

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

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

body = undefined;

requests.post(url, data=json.dumps(body), headers = headers)
🔗
post
/goals/{goalId}/decline
Changes the status of the goal to "declined".
Declining a goal automatically changes its status to draft. The goal can be declined only if the current user is selected as a reviewer, otherwise an error occurs.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
goalId
*
stringSpecifies the unique identifier of the goal (objective).
expected in path, sample value:
6138969ab6adf10001fc329c
comment
*
The object used to describe the reason for approving/declining a goal.
expected in body
Expected response codes
204no content
400bad request error message.
404not found
500internal server error message.

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

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

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

body = undefined;

requests.post(url, data=json.dumps(body), headers = headers)
🔗
post
/goals/{goalId}/review
Sets selected users as reviewers for this goal.
In order a user to be selected as a reviewer he has to have "read" and "update" permissions for the goal.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
goalId
*
stringSpecifies the unique identifier of the goal (objective).
expected in path, sample value:
6138969ab6adf10001fc329c
reviewers
*
The object used to specify the ids of users that have to be selected as reviewers of the goal.
expected in body
Expected response codes
204no content
400nonExistingReviewResponse
404not found
409conflict
500internal server error message.

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

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

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

body = undefined;

requests.post(url, data=json.dumps(body), headers = headers)
🔗
post
/goals/{goalId}/withdraw
Puts the goal back in draft state where the goal is not locked and can be edited.
Goals can be withdrawn by users that own the goal only. No request object required.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
goalId
*
stringSpecifies the unique identifier of the goal (objective).
expected in path, sample value:
6138969ab6adf10001fc329c
Expected response codes
204no content
400bad request error message.
404not found
500internal server error message.

curl -X POST 'https://app.gtmhub.com/api/v1/goals/{goalId}/withdraw' \ -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/goals/{goalId}/withdraw", "method": "POST", "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/goals/{goalId}/withdraw"



requests.post(url, headers = headers)
DEPRECATED
🔗
put
/goals/{goalId}
Updates an Objective.
This endpoint is deprecated. Use PATCH Objective instead.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
goalId
*
stringSpecifies the unique identifier of the goal (objective).
expected in path, sample value:
6138969ab6adf10001fc329c
goal
*
The object representing the goal to be updated.
expected in body
Expected response codes
200goalMetricsLinksResponse
400bad request
401unauthorized
402payment required
403forbidden
404not found
423item is locked
500internal server error

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

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

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

body = undefined;

requests.put(url, data=json.dumps(body), headers = headers)
{}
DEPRECATED
🔗
put
/goals/{goalId}/confidence
Updates an existing goal.
This endpoint is deprecated. Confidence is available on a Key Result level. Use PATCH Key Result instead.
Parameters
NameTypeDescription
goalId
*
stringSpecifies the unique identifier of the goal (objective).
expected in path, sample value:
6138969ab6adf10001fc329c
goalConfidence
*
expected in body
Expected response codes
200goal
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

curl -X PUT 'https://app.gtmhub.com/api/v1/goals/{goalId}/confidence' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-d '{"goalConfidence":undefined}'

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

var settings = { "url": "https://app.gtmhub.com/api/v1/goals/{goalId}/confidence", "method": "PUT", "timeout": 0, "headers": { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer {token}",
},
"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/goals/{goalId}/confidence"

body = undefined;

requests.put(url, data=json.dumps(body), headers = headers)
{}
🔗
patch
/goals/{goalId}
Partial update of the goal.
Updates all the fields that are specified in the request body.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
goalId
*
stringSpecifies the unique identifier of the goal (objective).
expected in path, sample value:
6138969ab6adf10001fc329c
goal
*
The object representing the goal to be updated.
expected in body
Expected response codes
200goalMetricsLinksResponse
400bad request
401unauthorized
402payment required
403forbidden
404not found
423item is locked
500internal server error

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

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

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

body = undefined;

requests.patch(url, data=json.dumps(body), headers = headers)
{}
🔗
delete
/goals/bulk
Deletes goals by given 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
goalsIds
*
An array of goals ids that will be deleted.
expected in body
Expected response codes
200ok
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

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

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

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

body = undefined;

requests.delete(url, data=json.dumps(body), headers = headers)
🔗
delete
/goals/{goalId}
Deletes a goal in the current gtmhub account.
No request object required.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
goalId
*
stringSpecifies the unique identifier of the goal (objective).
expected in path, sample value:
6138969ab6adf10001fc329c
Expected response codes
200ok
400bad request
401unauthorized
402payment required
403forbidden
404not found
500internal server error

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



requests.delete(url, headers = headers)