Get started
Use the API
Make a call from your code. Read the transcript, outcome and next steps when it ends.
You need a phone number on your account and a private key from Settings → API keys. Keep private keys on your server. Anyone who has one can act on your whole business.
#Set your key
cURLexport BLUEPENGUIN_KEY="bp_live_..."#Find your assistant and number
curl https://app.bluepenguin.io/api/v1/assistants -H "Authorization: Bearer $BLUEPENGUIN_KEY" curl https://app.bluepenguin.io/api/v1/phone-numbers -H "Authorization: Bearer $BLUEPENGUIN_KEY"const h = { authorization: `Bearer ${process.env.BLUEPENGUIN_KEY}` } const assistants = await (await fetch('https://app.bluepenguin.io/api/v1/assistants', { headers: h })).json() const numbers = await (await fetch('https://app.bluepenguin.io/api/v1/phone-numbers', { headers: h })).json()import os, requests h = {"Authorization": f"Bearer {os.environ['BLUEPENGUIN_KEY']}"} assistants = requests.get("https://app.bluepenguin.io/api/v1/assistants", headers=h).json() numbers = requests.get("https://app.bluepenguin.io/api/v1/phone-numbers", headers=h).json()#Start a call
curl https://app.bluepenguin.io/api/v1/calls \ -H "Authorization: Bearer $BLUEPENGUIN_KEY" \ -H "Content-Type: application/json" \ -d '{"assistant_id": 12, "phone_number_id": 3, "to": "+15555550142", "variables": {"first_name": "Maya"}}'const call = await (await fetch('https://app.bluepenguin.io/api/v1/calls', { method: 'POST', headers: { ...h, 'content-type': 'application/json' }, body: JSON.stringify({ assistant_id: 12, phone_number_id: 3, to: '+15555550142', variables: { first_name: 'Maya' } }), })).json() console.log(call.id)call = requests.post("https://app.bluepenguin.io/api/v1/calls", headers=h, json={ "assistant_id": 12, "phone_number_id": 3, "to": "+15555550142", "variables": {"first_name": "Maya"}}).json() print(call["id"])Your phone rings within a few seconds.
{{first_name}}in the assistant's first message or instructions becomes "Maya". See Variables.#Read the result
When the call ends it is summarised and analysed. Either fetch it:
cURLcurl https://app.bluepenguin.io/api/v1/calls/8812 -H "Authorization: Bearer $BLUEPENGUIN_KEY"or, better, add a webhook for
call.completedso the result is pushed to you. See Webhooks.