Official Sinch API skills for AI coding agents — SMS, Voice, Verification, Numbers, Mailgun email, and more.
71
89%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Advisory
Suggest reviewing before use
from sinch import SinchClient
sinch = SinchClient(
application_key="YOUR_APPLICATION_KEY",
application_secret="YOUR_APPLICATION_SECRET",
)response = sinch.voice.callouts.text_to_speech(
destination={"type": "number", "endpoint": "+14045005000"},
cli="+14045001000",
locale="en-US",
text="Hello! This is a test call from Sinch.",
)
print(f"Call ID: {response.call_id}")response = sinch.voice.callouts.conference(
destination={"type": "number", "endpoint": "+14045005000"},
cli="+14045001000",
conference_id="myConference",
enable_ace=True,
enable_dice=True,
)
print(f"Call ID: {response.call_id}")import json
response = sinch.voice.callouts.custom(
destination={"type": "number", "endpoint": "+14045005000"},
cli="+14045001000",
ice=json.dumps({
"action": {
"name": "connectPstn",
"number": "+14045009000",
"cli": "+14045001000",
}
}),
ace=json.dumps({
"action": {"name": "continue"}
}),
)call_info = sinch.voice.calls.get(call_id="4398599d1ba84ef3bde0a82dfb61abed")
print(f"Status: {call_info.status}, Duration: {call_info.duration}s")sinch.voice.calls.update(
call_id="4398599d1ba84ef3bde0a82dfb61abed",
instructions=[
{"name": "say", "text": "This call will now end.", "locale": "en-US"}
],
action={"name": "hangup"},
)conf = sinch.voice.conferences.get(conference_id="myConference")
print(f"Participants: {conf.participants}")sinch.voice.conferences.kick_all(conference_id="myConference")from flask import Flask, request, jsonify
app = Flask(__name__)
@app.post("/voice/ice")
def ice():
data = request.json
print(f"Incoming call from {data['cli']} to {data['to']['endpoint']}")
return jsonify({
"instructions": [
{"name": "say", "text": "Welcome! Press 1 for sales.", "locale": "en-US"}
],
"action": {
"name": "runMenu",
"mainMenu": "main",
"menus": [{
"id": "main",
"mainPrompt": "#tts[Press 1 for sales or 2 for support.]",
"options": [
{"dtmf": 1, "action": "return(sales)"},
{"dtmf": 2, "action": "return(support)"},
],
}],
},
})
@app.post("/voice/ace")
def ace():
return jsonify({"action": {"name": "continue"}})
@app.post("/voice/pie")
def pie():
menu_result = request.json["menuResult"]
number = "+14045009001" if menu_result["value"] == "sales" else "+14045009002"
return jsonify({
"instructions": [
{"name": "say", "text": f"Connecting you to {menu_result['value']}.", "locale": "en-US"}
],
"action": {"name": "connectPstn", "number": number, "cli": "+14045001000"},
})
@app.post("/voice/dice")
def dice():
data = request.json
print(f"Call ended: {data['reason']}, duration: {data['duration']}s")
return "", 200
if __name__ == "__main__":
app.run(port=3000)skills
sinch-10dlc
references
sinch-authentication
sinch-conversation-api
sinch-elastic-sip-trunking
references
sinch-fax-api
sinch-imported-numbers-hosting-orders
references
sinch-in-app-calling
sinch-mailgun
references
sinch-mailgun-inspect
references
sinch-mailgun-optimize
references
sinch-mailgun-validate
sinch-number-lookup-api
sinch-number-order-api
sinch-numbers-api
references
sinch-porting-api
sinch-provisioning-api
sinch-sdks
sinch-verification-api