#### How To Initiate Batch Calls

To initiate several calls in a batch, send a POST request to the `/v2/projects/{projectId}/calls` endpoint. The request body contains a SVAML payload describing the call flow and a list of parameters for each call in the batch. The API queues and triggers calls according to the provided configuration, such as maximum calls per second (`maxCps`) and time-to-live (`ttlSeconds`).

```json
{
  "commands": [
    {
      "command": "dial",
      "callName": "batch-notification",
      "from": { 
        "type": "PHONE",
        "phone": { "number": "@from" } 
      },
      "to": { 
        "type": "PHONE",
        "phone": { "number": "@to" } 
      },
      "events": {
        "onAnswer": [
          {
            "command": "messages",
            "messages": [
              {
                "type": "SAY",
                "say": {
                  "text": "Hello @name, you have an appointment tomorrow at 10 AM.",
                  "voiceName": "Emma"
                }
              }
            ]
          }
        ]
      }
    }
  ],
  "parameters": [
    { "from": "+46712345678", "to": "+46787654321", "name": "Alice" },
    { "from": "+46712345678", "to": "+46781234567", "name": "Bob" }
  ],
  "batchOptions": {
    "maxCps": 10,
    "ttlSeconds": 60
  }
}
```

- **commands:** SVAML commands describing the call flow for each call in the batch. Parameter placeholders start with `@` and can be used as variables for each call. They can be used alone as in `@from` or in combination with text in a say message (e.g., `Hello @name, your appointment is at @time`).
- **parameters:** An array of objects, each specifying the values for the placeholders in the commands. Each object represents a call to be queued and triggered.
- **batchOptions:** Controls how the batch is processed:
  - `maxCps`: Maximum number of calls per second to be initiated.
  - `ttlSeconds`: Time-to-live for the batch in seconds; calls not initiated within this time window will be skipped.


The API responds with metadata for the queued calls:

- **sessionIds:** Each call in the batch is assigned a unique sessionId, which can be used to track the state and progress of individual calls.
- **batchId:** The batchId identifies the entire batch operation, allowing batch state and summaries to be queried, or the batch to be managed as a whole (e.g., cancel unprocessed calls).
- **Other properties:** The response may also include other Ids, timestamps, and state related information.