Patch an RTB formula
PATCH
/api/v1/rtbs/{rtb_id}
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Patch, RequestUri = new Uri("https://external-api.moja-ai.com/api/v1/rtbs/example"), Headers = { { "X-API-Key", "<X-API-Key>" }, }, Content = new StringContent("{ \"rtb_name\": \"example\", \"buyer_id\": \"example\", \"rtb_type\": \"example\", \"static_phone_number\": \"example\", \"use_static_phone_number\": true, \"steps\": [ { \"url\": \"example\", \"method\": \"example\", \"headers\": [ { \"key\": \"Authorization\", \"value\": \"Bearer token-123\" } ], \"query_params\": [ { \"key\": \"caller_id\", \"value\": \"{{caller_id}}\" } ], \"body_params\": [ { \"key\": \"zip_code\", \"value\": \"{{zip_code}}\" } ], \"body_type\": \"none\", \"raw_body\": \"\", \"api_response\": { \"bid\": 12.5, \"duration\": 90, \"phoneNumber\": \"+15551234567\" }, \"run_on_rtb_group_win\": false, \"selected_keys\": [ { \"key\": \"bid\", \"path\": \"data.bid\" } ], \"response_field_mappings\": [ { \"fieldPath\": \"data.bid\", \"stepIndex\": 0, \"tagName\": \"bid\" } ], \"continue_on_failure\": false, \"processed_response\": \"\", \"process_response_code\": \"\", \"target_selection_criteria\": {} } ], \"mapped_response\": { \"bid\": \"data.bid\", \"duration\": \"data.duration\", \"phone_number\": \"data.phoneNumber\" }, \"zip_code_type\": \"example\", \"static_zip_code\": \"example\", \"caller_id_param\": \"example\", \"zip_code_param\": \"example\", \"caller_id_test\": \"example\", \"misc_settings\": { \"retryCount\": 2, \"timeoutMs\": 5000 }, \"parsing_formula\": { \"parseInstructions\": { \"duration\": \"data.duration\", \"payout\": \"data.bid\", \"phoneNumber\": \"data.phoneNumber\" } }, \"hours_of_operation\": { \"always_open\": true, \"days\": [] }, \"timezone\": \"example\", \"is_active\": true, \"max_concurrency\": 1, \"consider_duplicate\": true, \"consider_duplicate_on\": \"example\", \"consider_duplicate_length\": 1, \"consider_duplicate_interval\": 1, \"conversion_scope\": 1, \"duplicate_conversion_action\": \"decline\", \"filters\": { \"enabled\": true, \"groups\": [ { \"conditions\": [ { \"field\": \"state\", \"operator\": \"in\", \"values\": [ \"CA\", \"TX\" ] } ] } ] }, \"rtb_timeout\": 1, \"outbound_ping_rate_limit\": 1, \"outbound_ping_rate_period\": \"min\", \"outbound_ping_max_inflight\": 1, \"outbound_ping_backoff_enabled\": true, \"outbound_ping_backoff_threshold\": 1, \"outbound_ping_backoff_seconds\": 1, \"external_id\": \"example\", \"disable_recordings\": true, \"access_to_call_recordings\": true, \"advanced_caps\": [ {} ] }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://external-api.moja-ai.com/api/v1/rtbs/example"
payload := strings.NewReader("{ \"rtb_name\": \"example\", \"buyer_id\": \"example\", \"rtb_type\": \"example\", \"static_phone_number\": \"example\", \"use_static_phone_number\": true, \"steps\": [ { \"url\": \"example\", \"method\": \"example\", \"headers\": [ { \"key\": \"Authorization\", \"value\": \"Bearer token-123\" } ], \"query_params\": [ { \"key\": \"caller_id\", \"value\": \"{{caller_id}}\" } ], \"body_params\": [ { \"key\": \"zip_code\", \"value\": \"{{zip_code}}\" } ], \"body_type\": \"none\", \"raw_body\": \"\", \"api_response\": { \"bid\": 12.5, \"duration\": 90, \"phoneNumber\": \"+15551234567\" }, \"run_on_rtb_group_win\": false, \"selected_keys\": [ { \"key\": \"bid\", \"path\": \"data.bid\" } ], \"response_field_mappings\": [ { \"fieldPath\": \"data.bid\", \"stepIndex\": 0, \"tagName\": \"bid\" } ], \"continue_on_failure\": false, \"processed_response\": \"\", \"process_response_code\": \"\", \"target_selection_criteria\": {} } ], \"mapped_response\": { \"bid\": \"data.bid\", \"duration\": \"data.duration\", \"phone_number\": \"data.phoneNumber\" }, \"zip_code_type\": \"example\", \"static_zip_code\": \"example\", \"caller_id_param\": \"example\", \"zip_code_param\": \"example\", \"caller_id_test\": \"example\", \"misc_settings\": { \"retryCount\": 2, \"timeoutMs\": 5000 }, \"parsing_formula\": { \"parseInstructions\": { \"duration\": \"data.duration\", \"payout\": \"data.bid\", \"phoneNumber\": \"data.phoneNumber\" } }, \"hours_of_operation\": { \"always_open\": true, \"days\": [] }, \"timezone\": \"example\", \"is_active\": true, \"max_concurrency\": 1, \"consider_duplicate\": true, \"consider_duplicate_on\": \"example\", \"consider_duplicate_length\": 1, \"consider_duplicate_interval\": 1, \"conversion_scope\": 1, \"duplicate_conversion_action\": \"decline\", \"filters\": { \"enabled\": true, \"groups\": [ { \"conditions\": [ { \"field\": \"state\", \"operator\": \"in\", \"values\": [ \"CA\", \"TX\" ] } ] } ] }, \"rtb_timeout\": 1, \"outbound_ping_rate_limit\": 1, \"outbound_ping_rate_period\": \"min\", \"outbound_ping_max_inflight\": 1, \"outbound_ping_backoff_enabled\": true, \"outbound_ping_backoff_threshold\": 1, \"outbound_ping_backoff_seconds\": 1, \"external_id\": \"example\", \"disable_recordings\": true, \"access_to_call_recordings\": true, \"advanced_caps\": [ {} ] }")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<X-API-Key>") req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}const url = 'https://external-api.moja-ai.com/api/v1/rtbs/example';const options = { method: 'PATCH', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"rtb_name":"example","buyer_id":"example","rtb_type":"example","static_phone_number":"example","use_static_phone_number":true,"steps":[{"url":"example","method":"example","headers":[{"key":"Authorization","value":"Bearer token-123"}],"query_params":[{"key":"caller_id","value":"{{caller_id}}"}],"body_params":[{"key":"zip_code","value":"{{zip_code}}"}],"body_type":"none","raw_body":"","api_response":{"bid":12.5,"duration":90,"phoneNumber":"+15551234567"},"run_on_rtb_group_win":false,"selected_keys":[{"key":"bid","path":"data.bid"}],"response_field_mappings":[{"fieldPath":"data.bid","stepIndex":0,"tagName":"bid"}],"continue_on_failure":false,"processed_response":"","process_response_code":"","target_selection_criteria":{}}],"mapped_response":{"bid":"data.bid","duration":"data.duration","phone_number":"data.phoneNumber"},"zip_code_type":"example","static_zip_code":"example","caller_id_param":"example","zip_code_param":"example","caller_id_test":"example","misc_settings":{"retryCount":2,"timeoutMs":5000},"parsing_formula":{"parseInstructions":{"duration":"data.duration","payout":"data.bid","phoneNumber":"data.phoneNumber"}},"hours_of_operation":{"always_open":true,"days":[]},"timezone":"example","is_active":true,"max_concurrency":1,"consider_duplicate":true,"consider_duplicate_on":"example","consider_duplicate_length":1,"consider_duplicate_interval":1,"conversion_scope":1,"duplicate_conversion_action":"decline","filters":{"enabled":true,"groups":[{"conditions":[{"field":"state","operator":"in","values":["CA","TX"]}]}]},"rtb_timeout":1,"outbound_ping_rate_limit":1,"outbound_ping_rate_period":"min","outbound_ping_max_inflight":1,"outbound_ping_backoff_enabled":true,"outbound_ping_backoff_threshold":1,"outbound_ping_backoff_seconds":1,"external_id":"example","disable_recordings":true,"access_to_call_recordings":true,"advanced_caps":[{}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://external-api.moja-ai.com/api/v1/rtbs/example \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "rtb_name": "example", "buyer_id": "example", "rtb_type": "example", "static_phone_number": "example", "use_static_phone_number": true, "steps": [ { "url": "example", "method": "example", "headers": [ { "key": "Authorization", "value": "Bearer token-123" } ], "query_params": [ { "key": "caller_id", "value": "{{caller_id}}" } ], "body_params": [ { "key": "zip_code", "value": "{{zip_code}}" } ], "body_type": "none", "raw_body": "", "api_response": { "bid": 12.5, "duration": 90, "phoneNumber": "+15551234567" }, "run_on_rtb_group_win": false, "selected_keys": [ { "key": "bid", "path": "data.bid" } ], "response_field_mappings": [ { "fieldPath": "data.bid", "stepIndex": 0, "tagName": "bid" } ], "continue_on_failure": false, "processed_response": "", "process_response_code": "", "target_selection_criteria": {} } ], "mapped_response": { "bid": "data.bid", "duration": "data.duration", "phone_number": "data.phoneNumber" }, "zip_code_type": "example", "static_zip_code": "example", "caller_id_param": "example", "zip_code_param": "example", "caller_id_test": "example", "misc_settings": { "retryCount": 2, "timeoutMs": 5000 }, "parsing_formula": { "parseInstructions": { "duration": "data.duration", "payout": "data.bid", "phoneNumber": "data.phoneNumber" } }, "hours_of_operation": { "always_open": true, "days": [] }, "timezone": "example", "is_active": true, "max_concurrency": 1, "consider_duplicate": true, "consider_duplicate_on": "example", "consider_duplicate_length": 1, "consider_duplicate_interval": 1, "conversion_scope": 1, "duplicate_conversion_action": "decline", "filters": { "enabled": true, "groups": [ { "conditions": [ { "field": "state", "operator": "in", "values": [ "CA", "TX" ] } ] } ] }, "rtb_timeout": 1, "outbound_ping_rate_limit": 1, "outbound_ping_rate_period": "min", "outbound_ping_max_inflight": 1, "outbound_ping_backoff_enabled": true, "outbound_ping_backoff_threshold": 1, "outbound_ping_backoff_seconds": 1, "external_id": "example", "disable_recordings": true, "access_to_call_recordings": true, "advanced_caps": [ {} ] }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”rtb_id
required
Rtb Id
string
Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
RTBPatch
object
steps
Any of:
Array<object>
RTBStepobject
url
required
Url
string
method
required
Method
string
headers
Headers
Array<object>
object
key
additional properties
any
query_params
Query Params
Array<object>
object
key
additional properties
any
body_params
Body Params
Array<object>
object
key
additional properties
any
body_type
Body Type
string
raw_body
Raw Body
string
api_response
required
Api Response
run_on_rtb_group_win
Run On Rtb Group Win
boolean
selected_keys
Selected Keys
Array<object>
object
key
additional properties
any
response_field_mappings
Response Field Mappings
Array<object>
object
key
additional properties
any
continue_on_failure
Continue On Failure
boolean
processed_response
Processed Response
process_response_code
Process Response Code
string
null
advanced_caps
Any of:
Array<object>
object
key
additional properties
any
null
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
RTBResponse
object
id
required
Id
string
org_id
required
Org Id
string
rtb_name
required
Rtb Name
string
rtb_type
required
Rtb Type
string
static_phone_number
Static Phone Number
string
use_static_phone_number
Use Static Phone Number
boolean
steps
Steps
Array<object>
RTBStepobject
url
required
Url
string
method
required
Method
string
headers
Headers
Array<object>
object
key
additional properties
any
query_params
Query Params
Array<object>
object
key
additional properties
any
body_params
Body Params
Array<object>
object
key
additional properties
any
body_type
Body Type
string
raw_body
Raw Body
string
api_response
required
Api Response
run_on_rtb_group_win
Run On Rtb Group Win
boolean
selected_keys
Selected Keys
Array<object>
object
key
additional properties
any
response_field_mappings
Response Field Mappings
Array<object>
object
key
additional properties
any
continue_on_failure
Continue On Failure
boolean
processed_response
Processed Response
process_response_code
Process Response Code
string
mapped_response
Mapped Response
object
key
additional properties
any
zip_code_type
Zip Code Type
string
static_zip_code
Static Zip Code
string
caller_id_param
Caller Id Param
string
zip_code_param
Zip Code Param
string
caller_id_test
Caller Id Test
string
misc_settings
Misc Settings
object
key
additional properties
any
parsing_formula
Parsing Formula
object
key
additional properties
any
hours_of_operation
Hours Of Operation
object
key
additional properties
any
is_active
required
Is Active
boolean
max_concurrency
Max Concurrency
integer
consider_duplicate
Consider Duplicate
boolean
consider_duplicate_interval
Consider Duplicate Interval
integer
conversion_scope
required
Conversion Scope
integer
duplicate_conversion_action
Duplicate Conversion Action
string
rtb_timeout
Rtb Timeout
integer
outbound_ping_backoff_enabled
Outbound Ping Backoff Enabled
boolean
outbound_ping_backoff_threshold
Outbound Ping Backoff Threshold
integer
outbound_ping_backoff_seconds
Outbound Ping Backoff Seconds
integer
disable_recordings
Disable Recordings
boolean
access_to_call_recordings
required
Access To Call Recordings
boolean
advanced_caps
Advanced Caps
Array<object>
object
key
additional properties
any
is_paused
Is Paused
boolean
Example
{ "static_phone_number": "", "use_static_phone_number": false, "steps": [ { "headers": [ { "key": "Authorization", "value": "Bearer token-123" } ], "query_params": [ { "key": "caller_id", "value": "{{caller_id}}" } ], "body_params": [ { "key": "zip_code", "value": "{{zip_code}}" } ], "body_type": "none", "raw_body": "", "api_response": { "bid": 12.5, "duration": 90, "phoneNumber": "+15551234567" }, "run_on_rtb_group_win": false, "selected_keys": [ { "key": "bid", "path": "data.bid" } ], "response_field_mappings": [ { "fieldPath": "data.bid", "stepIndex": 0, "tagName": "bid" } ], "continue_on_failure": false, "processed_response": "", "process_response_code": "" } ], "mapped_response": { "bid": "data.bid", "duration": "data.duration", "phone_number": "data.phoneNumber" }, "zip_code_type": "dynamic", "static_zip_code": "", "caller_id_param": "", "zip_code_param": "", "caller_id_test": "", "misc_settings": { "retryCount": 2, "timeoutMs": 5000 }, "parsing_formula": { "parseInstructions": { "duration": "data.duration", "payout": "data.bid", "phoneNumber": "data.phoneNumber" } }, "hours_of_operation": { "always_open": true, "days": [] }, "max_concurrency": 0, "consider_duplicate": false, "consider_duplicate_interval": 30, "duplicate_conversion_action": "decline", "filters": { "enabled": true, "groups": [ { "conditions": [ { "field": "state", "operator": "in", "values": [ "CA", "TX" ] } ] } ] }, "rtb_timeout": 5000, "outbound_ping_rate_period": "min", "outbound_ping_backoff_enabled": false, "outbound_ping_backoff_threshold": 3, "outbound_ping_backoff_seconds": 60, "disable_recordings": false, "is_paused": 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>
ValidationErrorobject
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" }}
