curl --request POST \
--url https://api.chatsailer.com/v1/activities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"due_at": "2023-11-07T05:31:56Z",
"record_id": "con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"title": "<string>",
"assignee_id": "usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"description": "",
"status": "open",
"type": "task"
}
'import requests
url = "https://api.chatsailer.com/v1/activities"
payload = {
"due_at": "2023-11-07T05:31:56Z",
"record_id": "con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"title": "<string>",
"assignee_id": "usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"description": "",
"status": "open",
"type": "task"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
due_at: '2023-11-07T05:31:56Z',
record_id: 'con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4',
title: '<string>',
assignee_id: 'usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4',
description: '',
status: 'open',
type: 'task'
})
};
fetch('https://api.chatsailer.com/v1/activities', 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.chatsailer.com/v1/activities",
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([
'due_at' => '2023-11-07T05:31:56Z',
'record_id' => 'con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4',
'title' => '<string>',
'assignee_id' => 'usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4',
'description' => '',
'status' => 'open',
'type' => 'task'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.chatsailer.com/v1/activities"
payload := strings.NewReader("{\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"record_id\": \"con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4\",\n \"title\": \"<string>\",\n \"assignee_id\": \"usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4\",\n \"description\": \"\",\n \"status\": \"open\",\n \"type\": \"task\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.chatsailer.com/v1/activities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"record_id\": \"con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4\",\n \"title\": \"<string>\",\n \"assignee_id\": \"usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4\",\n \"description\": \"\",\n \"status\": \"open\",\n \"type\": \"task\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chatsailer.com/v1/activities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"record_id\": \"con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4\",\n \"title\": \"<string>\",\n \"assignee_id\": \"usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4\",\n \"description\": \"\",\n \"status\": \"open\",\n \"type\": \"task\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"due_at": "2023-11-07T05:31:56Z",
"id": "act_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"status": "open",
"title": "<string>",
"type": "task",
"updated_at": "2023-11-07T05:31:56Z",
"assignee": {
"id": "<string>",
"kind": "user",
"name": "<string>",
"object": "owner"
},
"created_by": {
"id": "<string>",
"kind": "user",
"name": "<string>",
"object": "owner"
},
"object": "activity",
"record_id": "con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"status_reason": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}Create an activity
Plans an activity on a contact, organization or deal, or logs one that already happened (status: completed with a past due_at).
curl --request POST \
--url https://api.chatsailer.com/v1/activities \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"due_at": "2023-11-07T05:31:56Z",
"record_id": "con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"title": "<string>",
"assignee_id": "usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"description": "",
"status": "open",
"type": "task"
}
'import requests
url = "https://api.chatsailer.com/v1/activities"
payload = {
"due_at": "2023-11-07T05:31:56Z",
"record_id": "con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"title": "<string>",
"assignee_id": "usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"description": "",
"status": "open",
"type": "task"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
due_at: '2023-11-07T05:31:56Z',
record_id: 'con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4',
title: '<string>',
assignee_id: 'usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4',
description: '',
status: 'open',
type: 'task'
})
};
fetch('https://api.chatsailer.com/v1/activities', 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.chatsailer.com/v1/activities",
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([
'due_at' => '2023-11-07T05:31:56Z',
'record_id' => 'con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4',
'title' => '<string>',
'assignee_id' => 'usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4',
'description' => '',
'status' => 'open',
'type' => 'task'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.chatsailer.com/v1/activities"
payload := strings.NewReader("{\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"record_id\": \"con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4\",\n \"title\": \"<string>\",\n \"assignee_id\": \"usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4\",\n \"description\": \"\",\n \"status\": \"open\",\n \"type\": \"task\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.chatsailer.com/v1/activities")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"record_id\": \"con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4\",\n \"title\": \"<string>\",\n \"assignee_id\": \"usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4\",\n \"description\": \"\",\n \"status\": \"open\",\n \"type\": \"task\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chatsailer.com/v1/activities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"due_at\": \"2023-11-07T05:31:56Z\",\n \"record_id\": \"con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4\",\n \"title\": \"<string>\",\n \"assignee_id\": \"usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4\",\n \"description\": \"\",\n \"status\": \"open\",\n \"type\": \"task\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"due_at": "2023-11-07T05:31:56Z",
"id": "act_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"status": "open",
"title": "<string>",
"type": "task",
"updated_at": "2023-11-07T05:31:56Z",
"assignee": {
"id": "<string>",
"kind": "user",
"name": "<string>",
"object": "owner"
},
"created_by": {
"id": "<string>",
"kind": "user",
"name": "<string>",
"object": "owner"
},
"object": "activity",
"record_id": "con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4",
"status_reason": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "invalid_request_error",
"detail": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
],
"documentation_url": "<string>",
"param": "<string>",
"request_id": "<string>"
}
}Authorizations
A workspace API token (sk_live_...) or an OAuth access token (oat_live_...). Create workspace tokens in Settings > API. Send either as Authorization: Bearer <token>.
Headers
A unique value (a UUID works) that makes retrying this request safe. A repeat with the same key and body within 24 hours returns the original response instead of acting twice; the same key with a different body is a 409 idempotency_key_reused.
255Body
Body for POST /v1/activities.
Send status: completed with a past due_at to log something that already
happened rather than plan it.
When it is planned for, or when it happened. May be past.
Id of a contact, organization or deal. The prefix names the kind of record.
^(con|org|deal)_[0-9a-f]{32}$"con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"
1 - 500Unique identifier for an user.
^usr_[0-9a-f]{32}$"usr_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"
open, completed task, call, email, meeting, follow_up Response
Successful Response
A call, meeting, task or other action planned or logged against a record.
When it is planned for, or when it happened. May be past.
Unique identifier for an activity.
^act_[0-9a-f]{32}$"act_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"
suggested is proposed but not yet accepted; conflict means it could not be carried out automatically — status_reason says why.
open, completed, canceled, conflict, suggested resume_conversation is the AI agent's plan to message the contact again at due_at; it can be read and canceled here, not created.
task, call, email, meeting, follow_up, resume_conversation Who is responsible for doing it.
Show child attributes
Show child attributes
Who planned it. Null when an integration created it.
Show child attributes
Show child attributes
"activity"Id of a contact, organization or deal. The prefix names the kind of record.
^(con|org|deal)_[0-9a-f]{32}$"con_9f2ac41d8b7e4a51b0d3e6f7a1c2d3e4"
Why the activity was canceled or could not be carried out.