Pause a target
POST
/api/v1/targets/{target_id}/pause
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://external-api.moja-ai.com/api/v1/targets/example/pause"), Headers = { { "X-API-Key", "<X-API-Key>" }, }, Content = new StringContent("{ \"duration_minutes\": 1, \"paused_until\": \"2026-04-15T12:00:00Z\", \"unlimited\": false }") { 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/targets/example/pause"
payload := strings.NewReader("{ \"duration_minutes\": 1, \"paused_until\": \"2026-04-15T12:00:00Z\", \"unlimited\": false }")
req, _ := http.NewRequest("POST", 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/targets/example/pause';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"duration_minutes":1,"paused_until":"2026-04-15T12:00:00Z","unlimited":false}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://external-api.moja-ai.com/api/v1/targets/example/pause \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "duration_minutes": 1, "paused_until": "2026-04-15T12:00:00Z", "unlimited": false }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”target_id
required
Target Id
string
Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Successful Response
Media typeapplication/json
TargetResponse
object
id
required
Id
string
name
required
Name
string
org_id
required
Org Id
string
timezone
Timezone
string
is_active
required
Is Active
boolean
conversion_scope
required
Conversion Scope
integer
duplicate_conversion_action
Duplicate Conversion Action
string
consider_duplicate
Consider Duplicate
boolean
consider_duplicate_interval
Consider Duplicate Interval
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
{ "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>
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" }}
