curl --request PUT \
--url https://{subdomain}.mihu.ai/api/v1/campaigns/{uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated Summer Promotion 2025",
"description": "Updated campaign description",
"status": "Active",
"campaign_type": "email",
"start_date": "2025-06-01T00:00:00Z",
"end_date": "2025-08-31T23:59:59Z",
"rules": {
"target_audience": "new_customers",
"minimum_age": 18
},
"agent_uuid": "550e8400-e29b-41d4-a716-446655440000"
}
'import requests
url = "https://{subdomain}.mihu.ai/api/v1/campaigns/{uuid}"
payload = {
"name": "Updated Summer Promotion 2025",
"description": "Updated campaign description",
"status": "Active",
"campaign_type": "email",
"start_date": "2025-06-01T00:00:00Z",
"end_date": "2025-08-31T23:59:59Z",
"rules": {
"target_audience": "new_customers",
"minimum_age": 18
},
"agent_uuid": "550e8400-e29b-41d4-a716-446655440000"
}
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({
name: 'Updated Summer Promotion 2025',
description: 'Updated campaign description',
status: 'Active',
campaign_type: 'email',
start_date: '2025-06-01T00:00:00Z',
end_date: '2025-08-31T23:59:59Z',
rules: {target_audience: 'new_customers', minimum_age: 18},
agent_uuid: '550e8400-e29b-41d4-a716-446655440000'
})
};
fetch('https://{subdomain}.mihu.ai/api/v1/campaigns/{uuid}', 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://{subdomain}.mihu.ai/api/v1/campaigns/{uuid}",
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([
'name' => 'Updated Summer Promotion 2025',
'description' => 'Updated campaign description',
'status' => 'Active',
'campaign_type' => 'email',
'start_date' => '2025-06-01T00:00:00Z',
'end_date' => '2025-08-31T23:59:59Z',
'rules' => [
'target_audience' => 'new_customers',
'minimum_age' => 18
],
'agent_uuid' => '550e8400-e29b-41d4-a716-446655440000'
]),
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://{subdomain}.mihu.ai/api/v1/campaigns/{uuid}"
payload := strings.NewReader("{\n \"name\": \"Updated Summer Promotion 2025\",\n \"description\": \"Updated campaign description\",\n \"status\": \"Active\",\n \"campaign_type\": \"email\",\n \"start_date\": \"2025-06-01T00:00:00Z\",\n \"end_date\": \"2025-08-31T23:59:59Z\",\n \"rules\": {\n \"target_audience\": \"new_customers\",\n \"minimum_age\": 18\n },\n \"agent_uuid\": \"550e8400-e29b-41d4-a716-446655440000\"\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://{subdomain}.mihu.ai/api/v1/campaigns/{uuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated Summer Promotion 2025\",\n \"description\": \"Updated campaign description\",\n \"status\": \"Active\",\n \"campaign_type\": \"email\",\n \"start_date\": \"2025-06-01T00:00:00Z\",\n \"end_date\": \"2025-08-31T23:59:59Z\",\n \"rules\": {\n \"target_audience\": \"new_customers\",\n \"minimum_age\": 18\n },\n \"agent_uuid\": \"550e8400-e29b-41d4-a716-446655440000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.mihu.ai/api/v1/campaigns/{uuid}")
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 \"name\": \"Updated Summer Promotion 2025\",\n \"description\": \"Updated campaign description\",\n \"status\": \"Active\",\n \"campaign_type\": \"email\",\n \"start_date\": \"2025-06-01T00:00:00Z\",\n \"end_date\": \"2025-08-31T23:59:59Z\",\n \"rules\": {\n \"target_audience\": \"new_customers\",\n \"minimum_age\": 18\n },\n \"agent_uuid\": \"550e8400-e29b-41d4-a716-446655440000\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Campaign updated successfully",
"data": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"status": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"message": "Campaign not found",
"data": [
"<unknown>"
]
}{
"success": false,
"message": "Validation errors",
"data": [
"<unknown>"
]
}{
"success": false,
"message": "An unexpected error occurred",
"data": [
"<unknown>"
]
}Update a campaign
Updates campaign metadata and configuration before or during its lifecycle. Use this to rename a campaign, change dates, adjust status, update the assigned agent, or modify channel-specific fields. Existing scheduled tasks are not automatically rebuilt unless a separate publish or pool operation creates work.
curl --request PUT \
--url https://{subdomain}.mihu.ai/api/v1/campaigns/{uuid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Updated Summer Promotion 2025",
"description": "Updated campaign description",
"status": "Active",
"campaign_type": "email",
"start_date": "2025-06-01T00:00:00Z",
"end_date": "2025-08-31T23:59:59Z",
"rules": {
"target_audience": "new_customers",
"minimum_age": 18
},
"agent_uuid": "550e8400-e29b-41d4-a716-446655440000"
}
'import requests
url = "https://{subdomain}.mihu.ai/api/v1/campaigns/{uuid}"
payload = {
"name": "Updated Summer Promotion 2025",
"description": "Updated campaign description",
"status": "Active",
"campaign_type": "email",
"start_date": "2025-06-01T00:00:00Z",
"end_date": "2025-08-31T23:59:59Z",
"rules": {
"target_audience": "new_customers",
"minimum_age": 18
},
"agent_uuid": "550e8400-e29b-41d4-a716-446655440000"
}
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({
name: 'Updated Summer Promotion 2025',
description: 'Updated campaign description',
status: 'Active',
campaign_type: 'email',
start_date: '2025-06-01T00:00:00Z',
end_date: '2025-08-31T23:59:59Z',
rules: {target_audience: 'new_customers', minimum_age: 18},
agent_uuid: '550e8400-e29b-41d4-a716-446655440000'
})
};
fetch('https://{subdomain}.mihu.ai/api/v1/campaigns/{uuid}', 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://{subdomain}.mihu.ai/api/v1/campaigns/{uuid}",
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([
'name' => 'Updated Summer Promotion 2025',
'description' => 'Updated campaign description',
'status' => 'Active',
'campaign_type' => 'email',
'start_date' => '2025-06-01T00:00:00Z',
'end_date' => '2025-08-31T23:59:59Z',
'rules' => [
'target_audience' => 'new_customers',
'minimum_age' => 18
],
'agent_uuid' => '550e8400-e29b-41d4-a716-446655440000'
]),
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://{subdomain}.mihu.ai/api/v1/campaigns/{uuid}"
payload := strings.NewReader("{\n \"name\": \"Updated Summer Promotion 2025\",\n \"description\": \"Updated campaign description\",\n \"status\": \"Active\",\n \"campaign_type\": \"email\",\n \"start_date\": \"2025-06-01T00:00:00Z\",\n \"end_date\": \"2025-08-31T23:59:59Z\",\n \"rules\": {\n \"target_audience\": \"new_customers\",\n \"minimum_age\": 18\n },\n \"agent_uuid\": \"550e8400-e29b-41d4-a716-446655440000\"\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://{subdomain}.mihu.ai/api/v1/campaigns/{uuid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Updated Summer Promotion 2025\",\n \"description\": \"Updated campaign description\",\n \"status\": \"Active\",\n \"campaign_type\": \"email\",\n \"start_date\": \"2025-06-01T00:00:00Z\",\n \"end_date\": \"2025-08-31T23:59:59Z\",\n \"rules\": {\n \"target_audience\": \"new_customers\",\n \"minimum_age\": 18\n },\n \"agent_uuid\": \"550e8400-e29b-41d4-a716-446655440000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.mihu.ai/api/v1/campaigns/{uuid}")
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 \"name\": \"Updated Summer Promotion 2025\",\n \"description\": \"Updated campaign description\",\n \"status\": \"Active\",\n \"campaign_type\": \"email\",\n \"start_date\": \"2025-06-01T00:00:00Z\",\n \"end_date\": \"2025-08-31T23:59:59Z\",\n \"rules\": {\n \"target_audience\": \"new_customers\",\n \"minimum_age\": 18\n },\n \"agent_uuid\": \"550e8400-e29b-41d4-a716-446655440000\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Campaign updated successfully",
"data": {
"uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"status": "<string>",
"start_date": "2023-11-07T05:31:56Z",
"end_date": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"message": "Campaign not found",
"data": [
"<unknown>"
]
}{
"success": false,
"message": "Validation errors",
"data": [
"<unknown>"
]
}{
"success": false,
"message": "An unexpected error occurred",
"data": [
"<unknown>"
]
}Authorizations
Use a Bearer token to access these API endpoints. Example: "Bearer {your-token}"
Path Parameters
UUID of the campaign to update
Body
"Updated Summer Promotion 2025"
"Updated campaign description"
Active, Draft, Completed, Archived "Active"
"email"
"2025-06-01T00:00:00Z"
"2025-08-31T23:59:59Z"
{
"target_audience": "new_customers",
"minimum_age": 18
}Agent UUID. The channel binding (agent_app) is resolved automatically from the agent's first configured channel.
"550e8400-e29b-41d4-a716-446655440000"
Response
Success
Indicates whether the request completed successfully. True for successful responses; false for documented error responses.
true
Human-readable response message. Safe to display in logs or simple client notifications; use structured fields for program logic.
"Campaign updated successfully"
Show child attributes
Show child attributes
