Skip to content

Create a target

POST
/api/v1/targets
curl --request POST \
--url https://external-api.moja-ai.com/api/v1/targets \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "name": "example", "buyer_id": "example", "type": "number", "number": "example", "sip_endpoint": "example", "sip_username": "example", "sip_password": "example", "sip_headers": { "X-Campaign": "sales", "X-Trace-Id": "trace-123" }, "connection_timeout": 1, "timezone": "America/New_York", "is_active": false, "max_concurrency": 1, "revenue": 1, "payout": 1, "payout_condition": "call_successfully_connected", "payout_condition_duration": 1, "conversion_scope": 10, "duplicate_conversion_action": "decline", "consider_duplicate": false, "consider_duplicate_on": "example", "consider_duplicate_length": 1, "consider_duplicate_interval": 30, "disable_recordings": false, "access_to_call_recordings": true, "filters": { "enabled": true, "groups": [ { "conditions": [ { "field": "state", "operator": "in", "values": [ "CA", "TX" ] } ] } ] }, "hours_of_operation": { "always_open": false, "days": [ { "day": "monday", "hours": "custom", "isOpen": true, "timeRanges": [ { "end": "17:00", "start": "09:00" } ] } ] }, "external_id": "example", "advanced_caps": [ {} ] }'
X-API-Key
Any of:
string
Media typeapplication/json
TargetCreate
object
name
required
Name
string
>= 1 characters <= 255 characters
buyer_id
required
Buyer Id
string
>= 1 characters
type
required
Type
string
Allowed values: number phone sip sip_target sip-target
number
Any of:
string
sip_endpoint
Any of:
string
sip_username
Any of:
string
sip_password
Any of:
string
sip_headers
Any of:
object
key
additional properties
any
connection_timeout
Any of:
integer
timezone
Timezone
string
default: America/New_York
is_active
Is Active
boolean
max_concurrency
Any of:
integer
revenue
Any of:
number
payout
Any of:
number
payout_condition
Payout Condition
string
default: call_successfully_connected
Allowed values: call_successfully_connected call_length_connected
payout_condition_duration
Any of:
integer
conversion_scope
Conversion Scope
integer
default: 10
duplicate_conversion_action
Duplicate Conversion Action
string
default: decline
Allowed values: decline route_no_pay route_no_revenue route_no_revenue_no_pay
consider_duplicate
Consider Duplicate
boolean
consider_duplicate_on
Any of:
string
consider_duplicate_length
Any of:
integer
consider_duplicate_interval
Consider Duplicate Interval

Lookback window in days for the consider-duplicate check

integer
default: 30 >= 1
disable_recordings
Disable Recordings
boolean
access_to_call_recordings
Any of:
boolean
filters
Any of:
object
key
additional properties
any
hours_of_operation
Any of:
object
key
additional properties
any
external_id
Any of:
string
>= 1 characters <= 64 characters
advanced_caps
Any of:
Array<object>
object
key
additional properties
any

Successful Response

Media typeapplication/json
TargetResponse
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
buyer_id
Any of:
string
buyer_name
Any of:
string
type
Any of:
string
number
Any of:
string
sip_endpoint
Any of:
string
sip_username
Any of:
string
sip_password
Any of:
string
sip_headers
Any of:
object
key
additional properties
any
connection_timeout
Any of:
integer
timezone
Timezone
string
default: America/New_York
is_active
required
Is Active
boolean
max_concurrency
Any of:
integer
revenue
Any of:
number
payout
Any of:
number
payout_condition
Any of:
string
payout_condition_duration
Any of:
integer
conversion_scope
required
Conversion Scope
integer
duplicate_conversion_action
Duplicate Conversion Action
string
default: decline
Allowed values: decline route_no_pay route_no_revenue route_no_revenue_no_pay
consider_duplicate
Consider Duplicate
boolean
consider_duplicate_on
Any of:
string
consider_duplicate_length
Any of:
integer
consider_duplicate_interval
Consider Duplicate Interval
integer
default: 30
disable_recordings
Disable Recordings
boolean
access_to_call_recordings
required
Access To Call Recordings
boolean
filters
Any of:
object
key
additional properties
any
hours_of_operation
Any of:
object
key
additional properties
any
external_id
Any of:
string
advanced_caps
Advanced Caps
Array<object>
object
key
additional properties
any
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
Example
{
"sip_headers": {
"X-Campaign": "sales",
"X-Trace-Id": "trace-123"
},
"timezone": "America/New_York",
"duplicate_conversion_action": "decline",
"consider_duplicate": false,
"consider_duplicate_interval": 30,
"disable_recordings": false,
"filters": {
"enabled": true,
"groups": [
{
"conditions": [
{
"field": "state",
"operator": "in",
"values": [
"CA",
"TX"
]
}
]
}
]
},
"hours_of_operation": {
"always_open": false,
"days": [
{
"day": "monday",
"hours": "custom",
"isOpen": true,
"timeRanges": [
{
"end": "17:00",
"start": "09:00"
}
]
}
]
},
"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>
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"
}
}