Update campaign model
curl --request PUT \
--url https://services-api.talqui.chat/v1/tenants/{tenantID}/campaigns-models/{campaignModelID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"campaignModelMeta": {},
"campaignModelTags": [
"<string>"
]
}
'import requests
url = "https://services-api.talqui.chat/v1/tenants/{tenantID}/campaigns-models/{campaignModelID}"
payload = {
"campaignModelMeta": {},
"campaignModelTags": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({campaignModelMeta: {}, campaignModelTags: ['<string>']})
};
fetch('https://services-api.talqui.chat/v1/tenants/{tenantID}/campaigns-models/{campaignModelID}', 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://services-api.talqui.chat/v1/tenants/{tenantID}/campaigns-models/{campaignModelID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'campaignModelMeta' => [
],
'campaignModelTags' => [
'<string>'
]
]),
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://services-api.talqui.chat/v1/tenants/{tenantID}/campaigns-models/{campaignModelID}"
payload := strings.NewReader("{\n \"campaignModelMeta\": {},\n \"campaignModelTags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://services-api.talqui.chat/v1/tenants/{tenantID}/campaigns-models/{campaignModelID}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"campaignModelMeta\": {},\n \"campaignModelTags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://services-api.talqui.chat/v1/tenants/{tenantID}/campaigns-models/{campaignModelID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"campaignModelMeta\": {},\n \"campaignModelTags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"campaignModel": {
"approvedAt": "2023-11-07T05:31:56Z",
"campaignModelChannel": "<string>",
"campaignModelChannelID": "<string>",
"campaignModelExternalID": "<string>",
"campaignModelGatewayMeta": {},
"campaignModelGatewayRaw": {},
"campaignModelID": "<string>",
"campaignModelMeta": {},
"campaignModelName": "<string>",
"campaignModelSlots": {
"body": {
"content": "<string>",
"text": "<string>",
"variables": [
{
"id": "<string>",
"key": "<string>",
"type": "<string>",
"fallback": "<string>"
}
]
},
"buttons": [
{
"text": "<string>",
"type": "ORDER_DETAILS",
"example": "<string>",
"otpType": "COPY_CODE",
"phoneNumber": "<string>",
"ttlMinutes": 123,
"url": "<string>"
}
],
"footer": {
"text": "<string>"
},
"header": {
"content": {},
"preview": "<string>",
"text": "<string>",
"variables": [
{
"id": "<string>",
"key": "<string>",
"type": "<string>",
"fallback": "<string>"
}
],
"type": "text"
}
},
"campaignModelStatus": "<string>",
"campaignModelTags": [
"<string>"
],
"campaignModelType": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"evaluatingAt": "2023-11-07T05:31:56Z",
"processingAt": "2023-11-07T05:31:56Z",
"refusedAt": "2023-11-07T05:31:56Z",
"tenantID": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"__campaignModelErrorCode": 123,
"__campaignModelErrorMessage": "<string>",
"campaignModelDescription": "<string>",
"deletedAt": "2023-11-07T05:31:56Z",
"modelVariables": [
{
"key": "<string>",
"fallback": "<string>",
"required": true,
"type": "<string>"
}
]
}
}{
"errors": [
{
"error": "MissingTenantIDError",
"error_code": 1001,
"message": "tenantID is required.",
"statusCode": 400
}
]
}{
"errors": [
{
"error": "UnauthorizedError",
"error_code": 1003,
"message": "You are not authorized to perform this request.",
"statusCode": 401
}
]
}{
"errors": [
{
"error": "ForbiddenError",
"error_code": 1004,
"message": "You do not have access to this resource.",
"statusCode": 403
}
]
}{
"errors": [
{
"error": "CampaignModelNotFoundError",
"error_code": 1058,
"message": "Campaign model not found.",
"statusCode": 404
}
]
}{
"errors": [
{
"error": "UnknownError",
"error_code": 5999,
"message": "For some unknown reason your request has not succeeded.",
"statusCode": 500
}
]
}Campaigns models
Update campaign model
Updates the tags and/or metadata of an existing campaign template. This does not resubmit the template to the provider — it only patches the record’s own fields.
PUT
/
v1
/
tenants
/
{tenantID}
/
campaigns-models
/
{campaignModelID}
Update campaign model
curl --request PUT \
--url https://services-api.talqui.chat/v1/tenants/{tenantID}/campaigns-models/{campaignModelID} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"campaignModelMeta": {},
"campaignModelTags": [
"<string>"
]
}
'import requests
url = "https://services-api.talqui.chat/v1/tenants/{tenantID}/campaigns-models/{campaignModelID}"
payload = {
"campaignModelMeta": {},
"campaignModelTags": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({campaignModelMeta: {}, campaignModelTags: ['<string>']})
};
fetch('https://services-api.talqui.chat/v1/tenants/{tenantID}/campaigns-models/{campaignModelID}', 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://services-api.talqui.chat/v1/tenants/{tenantID}/campaigns-models/{campaignModelID}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'campaignModelMeta' => [
],
'campaignModelTags' => [
'<string>'
]
]),
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://services-api.talqui.chat/v1/tenants/{tenantID}/campaigns-models/{campaignModelID}"
payload := strings.NewReader("{\n \"campaignModelMeta\": {},\n \"campaignModelTags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://services-api.talqui.chat/v1/tenants/{tenantID}/campaigns-models/{campaignModelID}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"campaignModelMeta\": {},\n \"campaignModelTags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://services-api.talqui.chat/v1/tenants/{tenantID}/campaigns-models/{campaignModelID}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"campaignModelMeta\": {},\n \"campaignModelTags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"campaignModel": {
"approvedAt": "2023-11-07T05:31:56Z",
"campaignModelChannel": "<string>",
"campaignModelChannelID": "<string>",
"campaignModelExternalID": "<string>",
"campaignModelGatewayMeta": {},
"campaignModelGatewayRaw": {},
"campaignModelID": "<string>",
"campaignModelMeta": {},
"campaignModelName": "<string>",
"campaignModelSlots": {
"body": {
"content": "<string>",
"text": "<string>",
"variables": [
{
"id": "<string>",
"key": "<string>",
"type": "<string>",
"fallback": "<string>"
}
]
},
"buttons": [
{
"text": "<string>",
"type": "ORDER_DETAILS",
"example": "<string>",
"otpType": "COPY_CODE",
"phoneNumber": "<string>",
"ttlMinutes": 123,
"url": "<string>"
}
],
"footer": {
"text": "<string>"
},
"header": {
"content": {},
"preview": "<string>",
"text": "<string>",
"variables": [
{
"id": "<string>",
"key": "<string>",
"type": "<string>",
"fallback": "<string>"
}
],
"type": "text"
}
},
"campaignModelStatus": "<string>",
"campaignModelTags": [
"<string>"
],
"campaignModelType": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"evaluatingAt": "2023-11-07T05:31:56Z",
"processingAt": "2023-11-07T05:31:56Z",
"refusedAt": "2023-11-07T05:31:56Z",
"tenantID": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"updatedBy": "<string>",
"__campaignModelErrorCode": 123,
"__campaignModelErrorMessage": "<string>",
"campaignModelDescription": "<string>",
"deletedAt": "2023-11-07T05:31:56Z",
"modelVariables": [
{
"key": "<string>",
"fallback": "<string>",
"required": true,
"type": "<string>"
}
]
}
}{
"errors": [
{
"error": "MissingTenantIDError",
"error_code": 1001,
"message": "tenantID is required.",
"statusCode": 400
}
]
}{
"errors": [
{
"error": "UnauthorizedError",
"error_code": 1003,
"message": "You are not authorized to perform this request.",
"statusCode": 401
}
]
}{
"errors": [
{
"error": "ForbiddenError",
"error_code": 1004,
"message": "You do not have access to this resource.",
"statusCode": 403
}
]
}{
"errors": [
{
"error": "CampaignModelNotFoundError",
"error_code": 1058,
"message": "Campaign model not found.",
"statusCode": 404
}
]
}{
"errors": [
{
"error": "UnknownError",
"error_code": 5999,
"message": "For some unknown reason your request has not succeeded.",
"statusCode": 500
}
]
}Authorizations
Behalf of an Operator (default). A JWT issued by Talqui Core when an operator signs in, scoped to every tenant that operator belongs to. Send as Authorization: Bearer <jwt-token>.
Body
application/json
Response
Response for status 200.
The updated campaign model.
Show child attributes
Show child attributes
⌘I