cURL
curl --request POST \
--url https://api.unifygtm.com/tasks/v1/tasks \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"person_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "EMAIL",
"mailbox_email": "jsmith@example.com",
"subject": "<string>",
"content": "<string>",
"due_at": "2023-11-07T05:31:56Z",
"cc_recipients": [
"jsmith@example.com"
],
"bcc_recipients": [
"jsmith@example.com"
]
}
'import requests
url = "https://api.unifygtm.com/tasks/v1/tasks"
payload = {
"person_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "EMAIL",
"mailbox_email": "jsmith@example.com",
"subject": "<string>",
"content": "<string>",
"due_at": "2023-11-07T05:31:56Z",
"cc_recipients": ["jsmith@example.com"],
"bcc_recipients": ["jsmith@example.com"]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
person_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
type: 'EMAIL',
mailbox_email: 'jsmith@example.com',
subject: '<string>',
content: '<string>',
due_at: '2023-11-07T05:31:56Z',
cc_recipients: ['jsmith@example.com'],
bcc_recipients: ['jsmith@example.com']
})
};
fetch('https://api.unifygtm.com/tasks/v1/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.unifygtm.com/tasks/v1/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'person_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'type' => 'EMAIL',
'mailbox_email' => 'jsmith@example.com',
'subject' => '<string>',
'content' => '<string>',
'due_at' => '2023-11-07T05:31:56Z',
'cc_recipients' => [
'jsmith@example.com'
],
'bcc_recipients' => [
'jsmith@example.com'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.unifygtm.com/tasks/v1/tasks"
payload := strings.NewReader("{\n \"person_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"EMAIL\",\n \"mailbox_email\": \"jsmith@example.com\",\n \"subject\": \"<string>\",\n \"content\": \"<string>\",\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"cc_recipients\": [\n \"jsmith@example.com\"\n ],\n \"bcc_recipients\": [\n \"jsmith@example.com\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.unifygtm.com/tasks/v1/tasks")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"person_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"EMAIL\",\n \"mailbox_email\": \"jsmith@example.com\",\n \"subject\": \"<string>\",\n \"content\": \"<string>\",\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"cc_recipients\": [\n \"jsmith@example.com\"\n ],\n \"bcc_recipients\": [\n \"jsmith@example.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unifygtm.com/tasks/v1/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"person_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"EMAIL\",\n \"mailbox_email\": \"jsmith@example.com\",\n \"subject\": \"<string>\",\n \"content\": \"<string>\",\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"cc_recipients\": [\n \"jsmith@example.com\"\n ],\n \"bcc_recipients\": [\n \"jsmith@example.com\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"person_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assigned_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"due_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"note_content": "<string>"
}
}{
"status": "bad_request",
"errors": [
{
"code": "<string>",
"path": [
"<string>"
],
"object_api_name": "<string>",
"attribute_api_name": "<string>"
}
],
"message": "<string>"
}{
"status": "unauthorized",
"message": "<string>"
}{
"status": "forbidden",
"message": "<string>"
}{
"status": "not_found",
"message": "<string>"
}{
"status": "conflict",
"message": "<string>"
}{
"status": "rate_limited",
"message": "<string>"
}{
"status": "error",
"message": "<string>"
}Tasks API
Create task
Create a task for a person.
POST
/
tasks
cURL
curl --request POST \
--url https://api.unifygtm.com/tasks/v1/tasks \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"person_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "EMAIL",
"mailbox_email": "jsmith@example.com",
"subject": "<string>",
"content": "<string>",
"due_at": "2023-11-07T05:31:56Z",
"cc_recipients": [
"jsmith@example.com"
],
"bcc_recipients": [
"jsmith@example.com"
]
}
'import requests
url = "https://api.unifygtm.com/tasks/v1/tasks"
payload = {
"person_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "EMAIL",
"mailbox_email": "jsmith@example.com",
"subject": "<string>",
"content": "<string>",
"due_at": "2023-11-07T05:31:56Z",
"cc_recipients": ["jsmith@example.com"],
"bcc_recipients": ["jsmith@example.com"]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
person_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
type: 'EMAIL',
mailbox_email: 'jsmith@example.com',
subject: '<string>',
content: '<string>',
due_at: '2023-11-07T05:31:56Z',
cc_recipients: ['jsmith@example.com'],
bcc_recipients: ['jsmith@example.com']
})
};
fetch('https://api.unifygtm.com/tasks/v1/tasks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.unifygtm.com/tasks/v1/tasks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'person_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'type' => 'EMAIL',
'mailbox_email' => 'jsmith@example.com',
'subject' => '<string>',
'content' => '<string>',
'due_at' => '2023-11-07T05:31:56Z',
'cc_recipients' => [
'jsmith@example.com'
],
'bcc_recipients' => [
'jsmith@example.com'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.unifygtm.com/tasks/v1/tasks"
payload := strings.NewReader("{\n \"person_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"EMAIL\",\n \"mailbox_email\": \"jsmith@example.com\",\n \"subject\": \"<string>\",\n \"content\": \"<string>\",\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"cc_recipients\": [\n \"jsmith@example.com\"\n ],\n \"bcc_recipients\": [\n \"jsmith@example.com\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.unifygtm.com/tasks/v1/tasks")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"person_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"EMAIL\",\n \"mailbox_email\": \"jsmith@example.com\",\n \"subject\": \"<string>\",\n \"content\": \"<string>\",\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"cc_recipients\": [\n \"jsmith@example.com\"\n ],\n \"bcc_recipients\": [\n \"jsmith@example.com\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.unifygtm.com/tasks/v1/tasks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"person_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"type\": \"EMAIL\",\n \"mailbox_email\": \"jsmith@example.com\",\n \"subject\": \"<string>\",\n \"content\": \"<string>\",\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"cc_recipients\": [\n \"jsmith@example.com\"\n ],\n \"bcc_recipients\": [\n \"jsmith@example.com\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"person_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"assigned_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"due_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"note_content": "<string>"
}
}{
"status": "bad_request",
"errors": [
{
"code": "<string>",
"path": [
"<string>"
],
"object_api_name": "<string>",
"attribute_api_name": "<string>"
}
],
"message": "<string>"
}{
"status": "unauthorized",
"message": "<string>"
}{
"status": "forbidden",
"message": "<string>"
}{
"status": "not_found",
"message": "<string>"
}{
"status": "conflict",
"message": "<string>"
}{
"status": "rate_limited",
"message": "<string>"
}{
"status": "error",
"message": "<string>"
}Authorizations
Body
application/json
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
Available options:
EMAIL Email address of the mailbox used to send the email when the task is completed.
Email subject. May be empty while the task is a draft.
Email body. May be empty while the task is a draft.
Available options:
LOW, MEDIUM, HIGH, URGENT Additional email recipients. The task's person is the primary recipient.
Blind-copy email recipients.
⌘I