Skip to content

Patch a campaign

PATCH
/api/v1/campaigns/{campaign_id}
curl --request PATCH \
--url https://external-api.moja-ai.com/api/v1/campaigns/example \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "name": "example", "routing_plan_id": "example", "call_flow_id": "example", "execution_mode": "routing_plan", "is_active": true, "payout": 1, "timezone": "America/New_York", "conversion_scope": 1, "qai_category_id": 1, "tcpa_scrubbing": "default", "tcpa_scrubbing_config": { "id": "example", "api_key": "example", "api_version": "v1", "api_url": "https://api.blacklistalliance.net/lookup?key=abc123&ver=v1&resp=raw&phone=", "allow_calls_on_failure": true }, "number_group_items": [ { "id": "example", "number_id": "example", "publisher_id": "example", "type": "static", "payout": 1, "payout_condition": "example", "payout_condition_duration": 1, "payout_percentage": 1, "external_id": "example", "is_active": true } ], "ivr_payout_rules": [ { "id": "example", "legacy_rule_id": "example", "combinator": "and", "payout": 0, "filters": [ { "field": "keypress", "operator": "equals", "value": "1" } ] } ], "outgoing_webhooks": [ "example" ], "incoming_webhooks": [ "example" ], "preconverted_caller": true, "preconverted_destination": true, "preconverted_publisher": true, "preconverted_campaign": true, "external_id": "example", "disable_recordings": true, "access_to_call_recordings": true, "expose_ineligible_routes": true, "ineligible_routes_fields": "example", "advanced_caps": [ {} ] }'
campaign_id
required
Campaign Id
string
X-API-Key
Any of:
string
Media typeapplication/json
CampaignPatch
object
name
Any of:
string
>= 1 characters <= 255 characters
routing_plan_id
Any of:
string
call_flow_id
Any of:
string
execution_mode
Any of:
string
Allowed values: routing_plan call_flow
is_active
Any of:
boolean
payout
Any of:
number
timezone
Any of:
string
conversion_scope
Any of:
integer
qai_category_id
Any of:
integer
tcpa_scrubbing
Any of:
string
Allowed values: default blacklist-alliance
tcpa_scrubbing_config
Any of:
CampaignTCPAScrubbingConfig

id is the DB row uuid (campaign_tcpa_scrubbing_configs.uuid) for stable PATCH round-trips.

object
id
Any of:
string
>= 1 characters <= 36 characters
api_key
Any of:
string
<= 255 characters
api_version
Any of:
string
Allowed values: v1 v2 v3
api_url
Any of:
string
allow_calls_on_failure
Allow Calls On Failure
boolean
default: true
number_group_items
Any of:
Array<object>
CampaignNumberGroupItemWrite

Writable number-group fields. Pause is managed via /entity_pause/campaign_numbers.

object
id
Any of:
string
>= 1 characters <= 36 characters
number_id
required
Number Id
string
publisher_id
Any of:
string
type
Type
string
default: static
Allowed values: static dynamic
payout
Any of:
number
payout_condition
Any of:
string
payout_condition_duration
Any of:
integer
payout_percentage
Any of:
number
external_id
Any of:
string
>= 1 characters <= 64 characters
is_active
Is Active
boolean
default: true
ivr_payout_rules
Any of:
Array<object>
CampaignIVRPayoutRule

id is campaign_ivr_payout_rules.uuid; legacy_rule_id is the legacy JSON rule key when distinct.

object
id
Any of:
string
>= 1 characters <= 36 characters
legacy_rule_id
Any of:
string
combinator
Combinator
string
default: and
Allowed values: and or
payout
Payout
number
0
filters
Filters
Array<object>
object
key
additional properties
any
outgoing_webhooks
Any of:
Array<string>
incoming_webhooks
Any of:
Array<string>
preconverted_caller
Any of:
boolean
preconverted_destination
Any of:
boolean
preconverted_publisher
Any of:
boolean
preconverted_campaign
Any of:
boolean
external_id
Any of:
string
>= 1 characters <= 64 characters
disable_recordings
Any of:
boolean
access_to_call_recordings
Any of:
boolean
expose_ineligible_routes
Any of:
boolean
ineligible_routes_fields
Any of:
string
advanced_caps
Any of:
Array<object>
object
key
additional properties
any

Successful Response

Media typeapplication/json
CampaignResponse
object
id
required
Id
string
created_at
Any of:
string format: date-time
updated_at
Any of:
string format: date-time
name
required
Name
string
org_id
required
Org Id
string
routing_plan_id
Any of:
string
call_flow_id
Any of:
string
execution_mode
required
Execution Mode
string
is_active
required
Is Active
boolean
payout
Any of:
number
timezone
Any of:
string
conversion_scope
required
Conversion Scope
integer
qai_category_id
Any of:
integer
tcpa_scrubbing
Any of:
string
tcpa_scrubbing_config
Any of:
CampaignTCPAScrubbingConfig

id is the DB row uuid (campaign_tcpa_scrubbing_configs.uuid) for stable PATCH round-trips.

object
id
Any of:
string
>= 1 characters <= 36 characters
api_key
Any of:
string
<= 255 characters
api_version
Any of:
string
Allowed values: v1 v2 v3
api_url
Any of:
string
allow_calls_on_failure
Allow Calls On Failure
boolean
default: true
number_group_items
Number Group Items
Array<object>
CampaignNumberGroupItem

id is campaign_number_group_items.uuid (stable row id). Includes pause state on reads.

object
id
Any of:
string
>= 1 characters <= 36 characters
number_id
required
Number Id
string
publisher_id
Any of:
string
type
Type
string
default: static
Allowed values: static dynamic
payout
Any of:
number
payout_condition
Any of:
string
payout_condition_duration
Any of:
integer
payout_percentage
Any of:
number
external_id
Any of:
string
>= 1 characters <= 64 characters
is_active
Is Active
boolean
default: true
number
Any of:
string
publisher_name
Any of:
string
paused_until
Any of:
string format: date-time
paused_at
Any of:
string format: date-time
paused_by
Any of:
string
is_paused
Is Paused
boolean
ivr_payout_rules
Ivr Payout Rules
Array<object>
CampaignIVRPayoutRule

id is campaign_ivr_payout_rules.uuid; legacy_rule_id is the legacy JSON rule key when distinct.

object
id
Any of:
string
>= 1 characters <= 36 characters
legacy_rule_id
Any of:
string
combinator
Combinator
string
default: and
Allowed values: and or
payout
Payout
number
0
filters
Filters
Array<object>
object
key
additional properties
any
outgoing_webhooks
Outgoing Webhooks
Array<string>
incoming_webhooks
Incoming Webhooks
Array<string>
preconverted_caller
Preconverted Caller
boolean
preconverted_destination
Preconverted Destination
boolean
preconverted_publisher
Preconverted Publisher
boolean
preconverted_campaign
Preconverted Campaign
boolean
external_id
Any of:
string
disable_recordings
Disable Recordings
boolean
access_to_call_recordings
required
Access To Call Recordings
boolean
expose_ineligible_routes
Expose Ineligible Routes
boolean
ineligible_routes_fields
Any of:
string
routing_plan
Any of:
ResourceRef
object
id
required
Id
string
name
Any of:
string
advanced_caps
Advanced Caps
Array<object>
object
key
additional properties
any
Example
{
"tcpa_scrubbing_config": {
"api_version": "v1",
"api_url": "https://api.blacklistalliance.net/lookup?key=abc123&ver=v1&resp=raw&phone=",
"allow_calls_on_failure": true
},
"number_group_items": [
{
"type": "static",
"is_active": true,
"is_paused": false
}
],
"ivr_payout_rules": [
{
"combinator": "and",
"payout": 0,
"filters": [
{
"field": "keypress",
"operator": "equals",
"value": "1"
}
]
}
],
"preconverted_caller": false,
"preconverted_destination": false,
"preconverted_publisher": false,
"preconverted_campaign": false,
"disable_recordings": false,
"expose_ineligible_routes": false
}

Bad Request

Media typeapplication/json
ErrorResponse
object
detail
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
Examplegenerated
{
"detail": {
"code": "example",
"message": "example"
}
}

Unauthorized

Media typeapplication/json
ErrorResponse
object
detail
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
Examplegenerated
{
"detail": {
"code": "example",
"message": "example"
}
}

Not Found

Media typeapplication/json
ErrorResponse
object
detail
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
Examplegenerated
{
"detail": {
"code": "example",
"message": "example"
}
}

Conflict

Media typeapplication/json
ErrorResponse
object
detail
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
Examplegenerated
{
"detail": {
"code": "example",
"message": "example"
}
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}

Too Many Requests

Media typeapplication/json
ErrorResponse
object
detail
required
ErrorBody
object
code
required
Code
string
message
required
Message
string
Examplegenerated
{
"detail": {
"code": "example",
"message": "example"
}
}