Create a publisher
POST
/api/v1/publishers
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/publishers"), Headers = { { "X-API-Key", "<X-API-Key>" }, }, Content = new StringContent("{ \"name\": \"example\", \"street_address\": \"example\", \"city\": \"example\", \"state\": \"example\", \"zip_code\": \"example\", \"country\": \"example\", \"phone_number\": \"example\", \"email\": \"\", \"website\": \"\", \"timezone\": \"America/New_York\", \"block_calls_if_capped\": true, \"access_to_call_recordings\": true, \"disable_recordings\": false, \"is_active\": true, \"advanced_caps\": [ {} ], \"everflow_affiliate_id\": \"example\", \"external_id\": \"example\" }") { 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/publishers"
payload := strings.NewReader("{ \"name\": \"example\", \"street_address\": \"example\", \"city\": \"example\", \"state\": \"example\", \"zip_code\": \"example\", \"country\": \"example\", \"phone_number\": \"example\", \"email\": \"\", \"website\": \"\", \"timezone\": \"America/New_York\", \"block_calls_if_capped\": true, \"access_to_call_recordings\": true, \"disable_recordings\": false, \"is_active\": true, \"advanced_caps\": [ {} ], \"everflow_affiliate_id\": \"example\", \"external_id\": \"example\" }")
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/publishers';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"name":"example","street_address":"example","city":"example","state":"example","zip_code":"example","country":"example","phone_number":"example","email":"","website":"","timezone":"America/New_York","block_calls_if_capped":true,"access_to_call_recordings":true,"disable_recordings":false,"is_active":true,"advanced_caps":[{}],"everflow_affiliate_id":"example","external_id":"example"}'};
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/publishers \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "name": "example", "street_address": "example", "city": "example", "state": "example", "zip_code": "example", "country": "example", "phone_number": "example", "email": "", "website": "", "timezone": "America/New_York", "block_calls_if_capped": true, "access_to_call_recordings": true, "disable_recordings": false, "is_active": true, "advanced_caps": [ {} ], "everflow_affiliate_id": "example", "external_id": "example" }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
PublisherCreate
object
name
required
Name
string
street_address
required
Street Address
string
city
required
City
string
state
required
State
string
zip_code
required
Zip Code
string
country
required
Country
string
phone_number
required
Phone Number
string
email
Email
string
website
Website
string
timezone
Timezone
string
block_calls_if_capped
required
Block Calls If Capped
boolean
access_to_call_recordings
required
Access To Call Recordings
boolean
disable_recordings
Disable Recordings
boolean
is_active
required
Is Active
boolean
advanced_caps
Any of:
Array<object>
object
key
additional properties
any
null
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
PublisherResponse
object
id
required
Id
string
org_id
required
Org Id
string
name
required
Name
string
street_address
required
Street Address
string
city
required
City
string
state
required
State
string
zip_code
required
Zip Code
string
country
required
Country
string
phone_number
required
Phone Number
string
email
required
Email
string
website
required
Website
string
timezone
required
Timezone
string
block_calls_if_capped
required
Block Calls If Capped
boolean
access_to_call_recordings
required
Access To Call Recordings
boolean
disable_recordings
Disable Recordings
boolean
is_active
required
Is Active
boolean
hourly
Hourly
integer
daily
Daily
integer
weekly
Weekly
integer
monthly
Monthly
integer
yearly
Yearly
integer
total
Total
integer
advanced_caps
Advanced Caps
Array<object>
object
key
additional properties
any
Example
{ "disable_recordings": false, "hourly": 0, "daily": 0, "weekly": 0, "monthly": 0, "yearly": 0, "total": 0}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" }}
