# Place a call

One request dials a number and streams the call audio to your agent.

Place an outbound call from your Vonyx number. Once the call connects, its audio streams to and from your agent over a [WebSocket](/docs/call-api/websocket).

```http
POST https://api.vocalstack.site/v1/calls
Content-Type: application/json
```

## Example

```bash
curl -X POST https://api.vocalstack.site/v1/calls \
  -H 'Content-Type: application/json' \
  -d '{
    "did": "91XXXXXXXXXX",
    "phone_number": "91XXXXXXXXXX",
    "websocket_url": "wss://your-agent.example.com/ws",
    "webhook_url": "https://your-server.example.com/call-status",
    "sample_rate": 8000,
    "ws_audio_format": "audio/x-l16"
  }'
```

## Request

<TypeTable
  type={{
    did: { type: 'string', description: 'Your Vonyx number. The call is placed from it.', required: true },
    phone_number: {
      type: 'string',
      description: 'The number to call: +91XXXXXXXXXX, 91XXXXXXXXXX, 0XXXXXXXXXX or XXXXXXXXXX. No routing prefix.',
      required: true,
    },
    websocket_url: { type: 'string', description: "Your agent's wss:// (or ws://) URL. Audio streams to and from it.", required: true },
    sample_rate: { type: '8000 | 16000', description: 'Audio sample rate in Hz.', required: true },
    webhook_url: { type: 'string', description: 'Receives a POST on every status change. See status webhooks.' },
    ws_audio_format: {
      type: "'audio/x-l16' | 'audio/x-mulaw'",
      description: '16-bit PCM, or 8-bit μ-law (use with sample_rate 8000).',
      default: 'audio/x-l16',
    },
    ws_protocol: { type: "'elevenlabs'", description: 'Connect an ElevenLabs agent directly. Leave out for the standard protocol.' },
  }}
/>

Any other field is rejected with `400`.

## Response

```json
{
  "status": 200,
  "message": "Call initiated",
  "data": {
    "call_id": "8b1f6a2e-4c3d-4e5f-9a7b-1c2d3e4f5a6b",
    "status": "success"
  }
}
```

Keep `data.call_id`. Status webhooks carry the same value as `CallUUID`.

<Callout type="warn" title="Allow 30 seconds">
  The request can take about 25 seconds while it waits for a free line. Set your client timeout to at least 30 seconds.
</Callout>
