---
title: "Create an outbound call log"
description: "Creates an outbound voice call log entry and attributes it to the initiating human agent when a user ID is supplied."
---

> Documentation Index
> Fetch the complete documentation index at: https://developer.channelautomations.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Channel Automation API › Twilio

`POST /api/calls/initiate`

Creates an outbound voice call log entry and attributes it to the initiating human agent when a user ID is supplied.

## Request body

_Required._

- `contactId` (`post/api/calls/initiate.contactId`; string, required)
- `workspaceId` (`post/api/calls/initiate.workspaceId`; string, required)
- `phoneNumber` (`post/api/calls/initiate.phoneNumber`; string, required)
- `fromNumber` (`post/api/calls/initiate.fromNumber`; string, optional)
- `userId` (`post/api/calls/initiate.userId`; string, optional) — Logged-in agent user ID for human-agent reporting.
- `agentUserId` (`post/api/calls/initiate.agentUserId`; string, optional) — Alias for userId.
- `agentName` (`post/api/calls/initiate.agentName`; string, optional)
- `agentEmail` (`post/api/calls/initiate.agentEmail`; string, optional)

## Example request

```json
{
  "contactId": "string",
  "workspaceId": "string",
  "phoneNumber": "string",
  "fromNumber": "string",
  "userId": "string",
  "agentUserId": "string",
  "agentName": "string",
  "agentEmail": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.channelautomation.com/api/calls/initiate \
  --header 'Content-Type: application/json' \
  --data '
{
  "contactId": "string",
  "workspaceId": "string",
  "phoneNumber": "string",
  "fromNumber": "string",
  "userId": "string",
  "agentUserId": "string",
  "agentName": "string",
  "agentEmail": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/calls/initiate';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    contactId: 'string',
    workspaceId: 'string',
    phoneNumber: 'string',
    fromNumber: 'string',
    userId: 'string',
    agentUserId: 'string',
    agentName: 'string',
    agentEmail: 'string'
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.channelautomation.com/api/calls/initiate"

payload = {
    "contactId": "string",
    "workspaceId": "string",
    "phoneNumber": "string",
    "fromNumber": "string",
    "userId": "string",
    "agentUserId": "string",
    "agentName": "string",
    "agentEmail": "string"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Call log created

### 400

Missing required fields

### 500

Failed to create call log


Source: https://developer.channelautomations.com/api/post-api-calls-initiate/index.md
