Ringly.io
Ringly.io API
Ringly.io API
  • Ringly.io API reference
  • API Reference
    • Make an outbound phone call V2
    • Make an outbound phone call (deprecated)
Powered by GitBook
On this page
  • Headers
  • Body
  • Example requests
  • Response
  1. API Reference

Make an outbound phone call V2

Make an outbound phone call with one of your AI phone agents.

POST https://app.ringly.io/api/1.1/wf/make-outbound-call-v2


Headers

You can find your Ringly.io API key in Settings > API key and then generate an API key.

Name
Value

Content-Type

application/json

Authorization

<Your Ringly.io API key>

What is new in V2? Instead of just sending the customer name, you can now send as many info as you like to use in the phone call with the new dynamic_variables!

Body


from_number string required

A phone number you own in Ringly.io, in E.164 format. Example: "+12153331234".


to_number string required

The number you want to call, in E.164 format. Example: "+12153331234".


agent_tag string required

The tag of one your AI phone agents. Does not need to have a phone number, as long as the 'from_number' is yours. Example: "agent_124532h23i5ad2543b3289bsj3". You can find the agent_tag by going to your agent, and scroll all the way down. Note: not all agent_tag's start with "agent_"


dynamic_variables object optional

Add dynamic variables in key-value pairs of string that you can use in the phone call.

Example: "Hey, am I speaking with {{customer_name}} from the {{property}} at {{address}}?"

Ringly.io automatically replace the variables with the actual values: "Hey, am I speaking with Ruben from the apartment at Fifth Avenue 138?"

Keys in dynamic_variables must use only letters and underscores: customer_name (No spaces or special characters).

When adding it to your agent's instructions or greeting, add 2 curly braces around it: {{customer_name}}


Example requests

curl --request POST \
  --url https://app.ringly.io/api/1.1/wf/make-outbound-call-v2 \
  --header 'Authorization: Your_Ringly_API_key' \
  --header 'Content-Type: application/json' \
  --data '{
  "from_number": "+1234567890",
  "to_number": "+19876543210",
  "agent_tag": "agent_1234abcd",
  "dynamic_variables": {
      "customer_name": "Jack",
      "property": "apartment",
      "address": "Fifth Avenue 138",
      "company_name": "Ringly.io",
      "outstanding_payment": "$3605.20"
   }
}'
import requests

url = "https://app.ringly.io/api/1.1/wf/make-outbound-call-v2"

payload = {
    "from_number": "+1234567890",
    "to_number": "+19876543210",
    "agent_tag": "agent_1234abcd",
    "dynamic_variables": {
      "customer_name": "Jack",
      "property": "apartment",
      "address": "Fifth Avenue 138",
      "company_name": "Ringly.io",
      "outstanding_payment": "$3605.20"
   }
}
headers = {
    "Content-Type": "application/json",
    "Authorization": "Your_Ringly_API_key"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
require 'uri'
require 'net/http'
require 'uri'
require 'json'

url = URI.parse("https://app.ringly.io/api/1.1/wf/make-outbound-call-v2")

payload = {
  from_number: "+1234567890",
  to_number: "+19876543210",
  agent_tag: "agent_1234abcd",
  dynamic_variables: {
    customer_name: "Jack",
    property: "apartment",
    address: "Fifth Avenue 138",
    company_name: "Ringly.io",
    outstanding_payment: "$3605.20"
  }
}

headers = {
  "Content-Type" => "application/json",
  "Authorization" => "Bearer Your_Ringly_API_key"
}

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url.path, headers)
request.body = payload.to_json

response = http.request(request)
puts JSON.parse(response.body)
const url = "https://app.ringly.io/api/1.1/wf/make-outbound-call-v2";

const payload = {
  from_number: "+1234567890",
  to_number: "+19876543210",
  agent_tag: "agent_1234abcd",
  dynamic_variables: {
    customer_name: "Jack",
    property: "apartment",
    address: "Fifth Avenue 138",
    company_name: "Ringly.io",
    outstanding_payment: "$3605.20"
  }
};

const headers = {
  "Content-Type": "application/json",
  Authorization: "Your_Ringly_API_key"
};

fetch(url, {
  method: "POST",
  headers: headers,
  body: JSON.stringify(payload)
})
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error("Error:", error));

Response

{
  "from_number": "+12137771234",
  "to_number": "+12137771235",
  "agent_tag": "agent_b7893d54b31985d73b459",
  "call_status": "registered",
  "dynamic_variables": {
      "customer_name": "Jack",
      "property": "apartment",
      "address": "Fifth Avenue 138",
      "company_name": "Ringly.io",
      "outstanding_payment": "$3605.20",
   }
}
{
  "error_message": "Invalid request format, please check API reference."
}
{ 
  "error_message": "API key is missing or invalid." 
}
{ 
  "error_message": "Trial has ended, please add payment method." 
}
{ 
  "error_message": "Cannot find requested asset under given api key." 
}
{ 
  "error_message": "Account rate limited, please throttle your requests." 
}
{ 
  "error_message": "An unexpected server error occurred."
}
PreviousRingly.io API referenceNextMake an outbound phone call (deprecated)

Last updated 5 months ago

Make sure you adhere to local laws and regulations when making outbound phone calls. Read our for more.

Terms of Service