Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.layercode.com/llms.txt

Use this file to discover all available pages before exploring further.

You will need:
This guide walks you through triggering an outbound phone call from your Layercode Agent. To trigger an outbound call, use the https://api.layercode.com/v1/agents/AGENT_ID/calls/initiate_outbound endpoint. You can call this endpoint from your backend whenever you want to initiate a call. You must have already set up your Layercode Agent to work with Twilio. If you haven’t done that yet, see Inbound calls with Twilio. Goto REST API docs for more details about calling initiate_outbound.

Example Request

  curl -X POST https://api.layercode.com/v1/agents/ag-123456/calls/initiate_outbound \
  -H 'Authorization: Bearer $LAYERCODE_API_KEY' \
  -H 'Content-Type: application/json' \
  -D '{
      "from_phone_number": "NUMBER_ASSIGNED_TO_YOUR_AGENT",
      "to_phone_number": "PHONE_NUMBER_TO_CALL"
  }'