curl --request POST \
--url http://localhost:8000/api/v1/chat/threads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"extra_data": {}
}
'import requests
url = "http://localhost:8000/api/v1/chat/threads"
payload = {
"name": "<string>",
"description": "<string>",
"extra_data": {}
}
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({name: '<string>', description: '<string>', extra_data: {}})
};
fetch('http://localhost:8000/api/v1/chat/threads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/v1/chat/threads",
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([
'name' => '<string>',
'description' => '<string>',
'extra_data' => [
]
]),
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 := "http://localhost:8000/api/v1/chat/threads"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"extra_data\": {}\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("http://localhost:8000/api/v1/chat/threads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"extra_data\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/v1/chat/threads")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"extra_data\": {}\n}"
response = http.request(request)
puts response.read_body{
"thread_id": "<string>",
"is_completed": true,
"date_added": "2023-11-07T05:31:56Z",
"date_updated": "2023-11-07T05:31:56Z",
"name": "<string>",
"description": "<string>",
"extra_data": {},
"google_ads_customer": {
"id": 123,
"date_added": "2023-11-07T05:31:56Z",
"date_updated": "2023-11-07T05:31:56Z",
"descriptive_name": "<string>",
"currency_code": "<string>",
"time_zone": "<string>",
"status": "<string>",
"manager": true,
"is_active": true,
"is_deleted": false
},
"google_ads_login_customer_id": 123,
"google_business_location": {
"id": "<string>",
"title": "<string>",
"store_code": "<string>",
"maps_uri": "<string>",
"storefront_address": {
"region_code": "<string>",
"language_code": "<string>",
"postal_code": "<string>",
"administrative_area": "<string>",
"locality": "<string>",
"sublocality": "<string>",
"address_lines": [
"<string>"
]
}
},
"assistant": {
"id": "<string>",
"assistant_type": "onboarding",
"date_added": "2023-11-07T05:31:56Z",
"date_updated": "2023-11-07T05:31:56Z"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create Chat Thread
Create a chat thread.
A thread can be scoped to different contexts:
- General Company Onboarding: Only
company_idprovided - Google Ads Customer Onboarding:
company_id+customer_idprovided - Google Business Location Onboarding:
company_id+location_idprovided
Args: company_id (int): Cattix Company ID (required) thread (AssistantChatThreadCreateSchema): The chat thread to create customer_id (int | None): The ID of the Google Ads customer (optional) location_id (str | None): The ID of the Google Business Location (optional) login_customer_id (int | None): The Google Ads customer ID to log in as user (User): The current user
Returns: AssistantChatThreadSchema: The created chat thread
curl --request POST \
--url http://localhost:8000/api/v1/chat/threads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"extra_data": {}
}
'import requests
url = "http://localhost:8000/api/v1/chat/threads"
payload = {
"name": "<string>",
"description": "<string>",
"extra_data": {}
}
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({name: '<string>', description: '<string>', extra_data: {}})
};
fetch('http://localhost:8000/api/v1/chat/threads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8000",
CURLOPT_URL => "http://localhost:8000/api/v1/chat/threads",
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([
'name' => '<string>',
'description' => '<string>',
'extra_data' => [
]
]),
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 := "http://localhost:8000/api/v1/chat/threads"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"extra_data\": {}\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("http://localhost:8000/api/v1/chat/threads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"extra_data\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8000/api/v1/chat/threads")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"extra_data\": {}\n}"
response = http.request(request)
puts response.read_body{
"thread_id": "<string>",
"is_completed": true,
"date_added": "2023-11-07T05:31:56Z",
"date_updated": "2023-11-07T05:31:56Z",
"name": "<string>",
"description": "<string>",
"extra_data": {},
"google_ads_customer": {
"id": 123,
"date_added": "2023-11-07T05:31:56Z",
"date_updated": "2023-11-07T05:31:56Z",
"descriptive_name": "<string>",
"currency_code": "<string>",
"time_zone": "<string>",
"status": "<string>",
"manager": true,
"is_active": true,
"is_deleted": false
},
"google_ads_login_customer_id": 123,
"google_business_location": {
"id": "<string>",
"title": "<string>",
"store_code": "<string>",
"maps_uri": "<string>",
"storefront_address": {
"region_code": "<string>",
"language_code": "<string>",
"postal_code": "<string>",
"administrative_area": "<string>",
"locality": "<string>",
"sublocality": "<string>",
"address_lines": [
"<string>"
]
}
},
"assistant": {
"id": "<string>",
"assistant_type": "onboarding",
"date_added": "2023-11-07T05:31:56Z",
"date_updated": "2023-11-07T05:31:56Z"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Query Parameters
Body
The schema for creating an assistant's chat thread.
Response
Successful Response
The schema for an assistant's chat thread.
Schema for GoogleAdsCustomer model.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The schema for an assistant.
Show child attributes
Show child attributes