Tasks endpoints

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

🔗
get
/tasks
Gets all tasks 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-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
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:
-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
200tasksResponse
401unauthorized
500internal server error

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

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



requests.get(url, headers = headers)
{
    "items": [
        {
            "access": {
                "inherits": false,
                "permissions": [
                    {
                        "deny": {
                            "Subtype": 2,
                            "Kind": 2
                        },
                        "grant": {
                            "Subtype": 2,
                            "Kind": 2
                        },
                        "principalId": "string",
                        "principalKind": "string value"
                    }
                ]
            },
            "accountId": "string value",
            "archived": false,
            "assignee": {
                "accountId": "string value",
                "avatar": "string value",
                "color": "string value",
                "dynamicValueType": "string value",
                "email": "string value",
                "id": "string value",
                "isActive": false,
                "name": "string value",
                "picture": "string value",
                "tags": [
                    {
                        "createdBy": "string",
                        "dateCreated": "string value",
                        "id": "string value",
                        "isActive": false,
                        "name": "string value",
                        "title": "string value"
                    }
                ],
                "type": "string value"
            },
            "createdById": "string value",
            "dateCreated": "string value",
            "dateModified": "string value",
            "description": "string value",
            "dueDate": "string value",
            "externalId": "string value",
            "externalSystem": "string value",
            "id": "string value",
            "lastComment": {
                "createdById": "string value",
                "text": "string value"
            },
            "modifiedById": "string value",
            "name": "string value",
            "ownerId": "string value",
            "parentId": "string value",
            "parentName": "string value",
            "parentType": "string value",
            "priority": 2,
            "richTextDescription": "string value",
            "sessionId": "string value",
            "snapshots": [
                {
                    "id": "string value",
                    "modifiedAt": "string value",
                    "modifiedBy": "string value",
                    "newStatus": "string value",
                    "oldStatus": "string value",
                    "previouslyModifiedAt": "string value"
                }
            ],
            "status": "string value",
            "taskType": "string value"
        }
    ],
    "totalCount": 2
}
🔗
get
/tasks/{taskId}
Gets a task by its unique identifier (id).
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
taskId
*
stringSpecifies the unique identifier (id) of the task.
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
200taskResponse
400bad request
401unauthorized
404not found
500internal server error

curl -X GET 'https://app.gtmhub.com/api/v2/integrations/tasks/{taskId}?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/v2/integrations/tasks/{taskId}?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/v2/integrations/tasks/{taskId}"



requests.get(url, headers = headers)
{
    "access": {
        "inherits": false,
        "permissions": [
            {
                "deny": {
                    "Subtype": 2,
                    "Kind": 2
                },
                "grant": {
                    "Subtype": 2,
                    "Kind": 2
                },
                "principalId": "string",
                "principalKind": "string value"
            }
        ]
    },
    "accountId": "string value",
    "archived": false,
    "assignee": {
        "accountId": "string value",
        "avatar": "string value",
        "color": "string value",
        "dynamicValueType": "string value",
        "email": "string value",
        "id": "string value",
        "isActive": false,
        "name": "string value",
        "picture": "string value",
        "tags": [
            {
                "createdBy": "string",
                "dateCreated": "string value",
                "id": "string value",
                "isActive": false,
                "name": "string value",
                "title": "string value"
            }
        ],
        "type": "string value"
    },
    "createdById": "string value",
    "dateCreated": "string value",
    "dateModified": "string value",
    "description": "string value",
    "dueDate": "string value",
    "externalId": "string value",
    "externalSystem": "string value",
    "id": "string value",
    "lastComment": {
        "createdById": "string value",
        "text": "string value"
    },
    "modifiedById": "string value",
    "name": "string value",
    "ownerId": "string value",
    "parentId": "string value",
    "parentName": "string value",
    "parentType": "string value",
    "priority": 2,
    "richTextDescription": "string value",
    "sessionId": "string value",
    "snapshots": [
        {
            "id": "string value",
            "modifiedAt": "string value",
            "modifiedBy": "string value",
            "newStatus": "string value",
            "oldStatus": "string value",
            "previouslyModifiedAt": "string value"
        }
    ],
    "status": "string value",
    "taskType": "string value"
}
🔗
post
/tasks
Creates a new task.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
task
*
objectThe object representing a task.
expected in body, sample value:
{
    "description": "string value",
    "dueDate": "2021-09-25",
    "name": "Review OKRs Page",
    "ownerId": "60bdd988fc07e60001198ae9",
    "parentId": "60bdd988fc07e60001198ae9",
    "parentType": "goal",
    "richTextDescription": "string value",
    "status": "todo"
}
Expected response codes
201taskResponse
400bad request
401unauthorized
500internal server error

curl -X POST 'https://app.gtmhub.com/api/v2/integrations/tasks' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-d '{"description":"string value","dueDate":"2021-09-25","name":"Review OKRs Page","ownerId":"60bdd988fc07e60001198ae9","parentId":"60bdd988fc07e60001198ae9","parentType":"goal","richTextDescription":"string value","status":"todo"}'

var body ={ "description": "string value", "dueDate": "2021-09-25", "name": "Review OKRs Page", "ownerId": "60bdd988fc07e60001198ae9", "parentId": "60bdd988fc07e60001198ae9", "parentType": "goal", "richTextDescription": "string value", "status": "todo" };

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

body = { "description": "string value", "dueDate": "2021-09-25", "name": "Review OKRs Page", "ownerId": "60bdd988fc07e60001198ae9", "parentId": "60bdd988fc07e60001198ae9", "parentType": "goal", "richTextDescription": "string value", "status": "todo" };

requests.post(url, data=json.dumps(body), headers = headers)
{
    "access": {
        "inherits": false,
        "permissions": [
            {
                "deny": {
                    "Subtype": 2,
                    "Kind": 2
                },
                "grant": {
                    "Subtype": 2,
                    "Kind": 2
                },
                "principalId": "string",
                "principalKind": "string value"
            }
        ]
    },
    "accountId": "string value",
    "archived": false,
    "assignee": {
        "accountId": "string value",
        "avatar": "string value",
        "color": "string value",
        "dynamicValueType": "string value",
        "email": "string value",
        "id": "string value",
        "isActive": false,
        "name": "string value",
        "picture": "string value",
        "tags": [
            {
                "createdBy": "string",
                "dateCreated": "string value",
                "id": "string value",
                "isActive": false,
                "name": "string value",
                "title": "string value"
            }
        ],
        "type": "string value"
    },
    "createdById": "string value",
    "dateCreated": "string value",
    "dateModified": "string value",
    "description": "string value",
    "dueDate": "string value",
    "externalId": "string value",
    "externalSystem": "string value",
    "id": "string value",
    "lastComment": {
        "createdById": "string value",
        "text": "string value"
    },
    "modifiedById": "string value",
    "name": "string value",
    "ownerId": "string value",
    "parentId": "string value",
    "parentName": "string value",
    "parentType": "string value",
    "priority": 2,
    "richTextDescription": "string value",
    "sessionId": "string value",
    "snapshots": [
        {
            "id": "string value",
            "modifiedAt": "string value",
            "modifiedBy": "string value",
            "newStatus": "string value",
            "oldStatus": "string value",
            "previouslyModifiedAt": "string value"
        }
    ],
    "status": "string value",
    "taskType": "string value"
}
🔗
patch
/tasks/{taskId}
Partially updates an already existing task.
Updates the task's attributes that are specified in the task request body only.
Parameters
NameTypeDescription
gtmhub-accountId
*
stringSpecifies the unique identifier (id) of the Gtmhub account.
expected in header, sample value:
5be26318e5274a0007f17f61
taskId
*
stringSpecifies the unique identifier (id) of the task.
expected in path
task
*
objectThe object representing a task.
expected in body, sample value:
{
    "archived": false,
    "description": "string value",
    "dueDate": "2021-09-26",
    "name": "Review OKRs Page",
    "ownerId": "60bdd988fc07e60001198ae9",
    "parentId": "60bdd988fc07e60001198ae9",
    "parentType": "goal",
    "richTextDescription": "string value",
    "status": "todo"
}
Expected response codes
200tasksResponse
400bad request
401unauthorized
404not found
500internal server error

curl -X PATCH 'https://app.gtmhub.com/api/v2/integrations/tasks/{taskId}' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer {token}' \
-H 'gtmhub-accountId: 5be26318e5274a0007f17f61' \
-d '{"archived":false,"description":"string value","dueDate":"2021-09-26","name":"Review OKRs Page","ownerId":"60bdd988fc07e60001198ae9","parentId":"60bdd988fc07e60001198ae9","parentType":"goal","richTextDescription":"string value","status":"todo"}'

var body ={ "archived": false, "description": "string value", "dueDate": "2021-09-26", "name": "Review OKRs Page", "ownerId": "60bdd988fc07e60001198ae9", "parentId": "60bdd988fc07e60001198ae9", "parentType": "goal", "richTextDescription": "string value", "status": "todo" };

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

body = { "archived": false, "description": "string value", "dueDate": "2021-09-26", "name": "Review OKRs Page", "ownerId": "60bdd988fc07e60001198ae9", "parentId": "60bdd988fc07e60001198ae9", "parentType": "goal", "richTextDescription": "string value", "status": "todo" };

requests.patch(url, data=json.dumps(body), headers = headers)
{
    "items": [
        {
            "access": {
                "inherits": false,
                "permissions": [
                    {
                        "deny": {
                            "Subtype": 2,
                            "Kind": 2
                        },
                        "grant": {
                            "Subtype": 2,
                            "Kind": 2
                        },
                        "principalId": "string",
                        "principalKind": "string value"
                    }
                ]
            },
            "accountId": "string value",
            "archived": false,
            "assignee": {
                "accountId": "string value",
                "avatar": "string value",
                "color": "string value",
                "dynamicValueType": "string value",
                "email": "string value",
                "id": "string value",
                "isActive": false,
                "name": "string value",
                "picture": "string value",
                "tags": [
                    {
                        "createdBy": "string",
                        "dateCreated": "string value",
                        "id": "string value",
                        "isActive": false,
                        "name": "string value",
                        "title": "string value"
                    }
                ],
                "type": "string value"
            },
            "createdById": "string value",
            "dateCreated": "string value",
            "dateModified": "string value",
            "description": "string value",
            "dueDate": "string value",
            "externalId": "string value",
            "externalSystem": "string value",
            "id": "string value",
            "lastComment": {
                "createdById": "string value",
                "text": "string value"
            },
            "modifiedById": "string value",
            "name": "string value",
            "ownerId": "string value",
            "parentId": "string value",
            "parentName": "string value",
            "parentType": "string value",
            "priority": 2,
            "richTextDescription": "string value",
            "sessionId": "string value",
            "snapshots": [
                {
                    "id": "string value",
                    "modifiedAt": "string value",
                    "modifiedBy": "string value",
                    "newStatus": "string value",
                    "oldStatus": "string value",
                    "previouslyModifiedAt": "string value"
                }
            ],
            "status": "string value",
            "taskType": "string value"
        }
    ],
    "totalCount": 2
}
🔗
delete
/tasks/{taskId}
Deletes a task 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
taskId
*
stringSpecifies the unique identifier (id) of the task.
expected in path
Expected response codes
204no content
400bad request
401unauthorized
500internal server error

curl -X DELETE 'https://app.gtmhub.com/api/v2/integrations/tasks/{taskId}' \ -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/integrations/tasks/{taskId}", "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/v2/integrations/tasks/{taskId}"



requests.delete(url, headers = headers)