Docs
GuidesAPI referenceWebhooksWeb widget

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.

  1. #Set your key

    cURL
    export BLUEPENGUIN_KEY="bp_live_..."
  2. #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"
  3. #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"}}'

    Your phone rings within a few seconds. {{first_name}} in the assistant's first message or instructions becomes "Maya". See Variables.

  4. #Read the result

    When the call ends it is summarised and analysed. Either fetch it:

    cURL
    curl https://app.bluepenguin.io/api/v1/calls/8812 -H "Authorization: Bearer $BLUEPENGUIN_KEY"

    or, better, add a webhook for call.completed so the result is pushed to you. See Webhooks.

#Next