> For a complete documentation index, fetch https://docs.voximplant.ai/llms.txt

# CreateCallList

POST https://api.voximplant.com/platform_api/CreateCallList
Content-Type: multipart/form-data

Adds a new CSV file for call list processing and starts the specified rule immediately. To send a file, use the request body. To set the call time constraints, use the following options in a CSV file: <ul><li>**__start_execution_time** – when the call list processing starts every day, UTC+0 24-h format: HH:mm:ss</li><li>**__end_execution_time** – when the call list processing stops every day,  UTC+0 24-h format: HH:mm:ss</li><li>**__start_at** – when the call list processing starts, UNIX timestamp. If not specified, the processing starts immediately after a method call</li><li>**__task_uuid** – call list UUID. A string up to 40 characters, can contain latin letters, digits, hyphens (-) and colons (:). Unique within the call list</li></ul>

This method accepts CSV files with custom delimiters, such a commas (,), semicolons (;) and other. To specify a delimiter, pass it to the **delimiter** parameter.

**IMPORTANT:** the account's balance should be equal or greater than 1 USD. If the balance is lower than 1 USD, the call list processing does not start, or it stops immediately if it is active.

Allowed roles: `Owner`, `Admin`, `Developer`, `Call list manager`.

Reference: https://docs.voximplant.ai/api-reference/management-api/reference/call-lists/create-call-list

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: management-api
  version: 1.0.0
paths:
  /CreateCallList:
    post:
      operationId: create-call-list
      summary: CreateCallList
      description: >-
        Adds a new CSV file for call list processing and starts the specified
        rule immediately. To send a file, use the request body. To set the call
        time constraints, use the following options in a CSV file:
        <ul><li>**__start_execution_time** – when the call list processing
        starts every day, UTC+0 24-h format:
        HH:mm:ss</li><li>**__end_execution_time** – when the call list
        processing stops every day,  UTC+0 24-h format:
        HH:mm:ss</li><li>**__start_at** – when the call list processing starts,
        UNIX timestamp. If not specified, the processing starts immediately
        after a method call</li><li>**__task_uuid** – call list UUID. A string
        up to 40 characters, can contain latin letters, digits, hyphens (-) and
        colons (:). Unique within the call list</li></ul>


        This method accepts CSV files with custom delimiters, such a commas (,),
        semicolons (;) and other. To specify a delimiter, pass it to the
        **delimiter** parameter.


        **IMPORTANT:** the account's balance should be equal or greater than 1
        USD. If the balance is lower than 1 USD, the call list processing does
        not start, or it stops immediately if it is active.


        Allowed roles: `Owner`, `Admin`, `Developer`, `Call list manager`.
      tags:
        - subpackage_callLists
      parameters:
        - name: rule_id
          in: query
          description: >-
            Rule ID. It is specified in the <a
            href='//manage.voximplant.com/applications'>Applications</a> section
            of the Control Panel
          required: true
          schema:
            type: integer
        - name: priority
          in: query
          description: >-
            Call list priority. The value is in the range of [0 ... 2^31] where
            zero is the highest priority
          required: true
          schema:
            type: integer
        - name: max_simultaneous
          in: query
          description: Number of simultaneously processed tasks
          required: true
          schema:
            type: integer
        - name: num_attempts
          in: query
          description: Number of attempts. Minimum is **1**, maximum is **5**
          required: true
          schema:
            type: integer
        - name: name
          in: query
          description: >-
            File name, up to 255 characters and cannot contain the '/' and '\'
            symbols
          required: true
          schema:
            type: string
        - name: interval_seconds
          in: query
          description: Interval between call attempts in seconds. The default value is 0
          required: false
          schema:
            type: integer
        - name: encoding
          in: query
          description: Encoding file. The default value is UTF-8
          required: false
          schema:
            type: string
        - name: delimiter
          in: query
          description: Separator values. The default value is ';'
          required: false
          schema:
            type: string
        - name: escape
          in: query
          description: Escape character for parsing csv
          required: false
          schema:
            type: string
        - name: reference_ip
          in: query
          description: >-
            IP from the geolocation of the call list subscribers. It allows
            selecting the nearest server for serving subscribers
          required: false
          schema:
            type: string
        - name: server_location
          in: query
          description: >-
            Location of the server where the scenario needs to be executed. Has
            higher priority than `reference_ip`. Request
            [getServerLocations](https://api.voximplant.com/getServerLocations)
            for possible values
          required: false
          schema:
            type: string
        - name: task_priority_strategy
          in: query
          description: >-
            Optional. Whether to prioritize first calling attempts or repeated
            ones. The possible values are: first_attempts, repeated_attempts.
            The default values is first_attempts.
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          description: >-
            Voximplant Management API uses signed JWT tokens generated from your
            service-account private key. Pass the token in the `Authorization`
            header as a Bearer value:


            ```

            Authorization: Bearer $VOXIMPLANT_TOKEN

            ```


            See [Authorization](/api-reference/management-api/authorization) for
            ready-to-copy snippets in bash, Python, Node.js and Go that turn
            your `credentials.json` into a token.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/call-lists_CreateCallList_Response_200'
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file_content:
                  type: string
                  format: binary
                  description: >-
                    Send as the "body" part of the HTTP request or as multiform.
                    The sending "file_content" via URL is at its own risk
                    because the network devices tend to drop HTTP requests with
                    large headers
              required:
                - file_content
servers:
  - url: https://api.voximplant.com/platform_api
components:
  schemas:
    call-lists_CreateCallList_Response_200:
      type: object
      properties:
        result:
          type: boolean
          description: Whether the request completed successfully
        count:
          type: integer
          description: Number of stored records
        list_id:
          type: integer
          description: List ID
        batch_id:
          type: string
          description: Batch UUID
      title: call-lists_CreateCallList_Response_200
  securitySchemes:
    JwtAuth:
      type: http
      scheme: bearer
      description: >-
        Voximplant Management API uses signed JWT tokens generated from your
        service-account private key. Pass the token in the `Authorization`
        header as a Bearer value:


        ```

        Authorization: Bearer $VOXIMPLANT_TOKEN

        ```


        See [Authorization](/api-reference/management-api/authorization) for
        ready-to-copy snippets in bash, Python, Node.js and Go that turn your
        `credentials.json` into a token.

```

## SDK Code Examples

```python Example 1
import requests

url = "https://api.voximplant.com/platform_api/CreateCallList"

querystring = {"rule_id":"1","priority":"1","max_simultaneous":"1","num_attempts":"1","name":"name"}

files = { "file_content": "open('phone_number,__start_execution_time,__end_execution_time,__task_uuid
+1234567890,08:00:00,18:00:00,task-1234-5678-90ab-cdef', 'rb')" }
headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, files=files, headers=headers, params=querystring)

print(response.json())
```

```javascript Example 1
const url = 'https://api.voximplant.com/platform_api/CreateCallList?rule_id=1&priority=1&max_simultaneous=1&num_attempts=1&name=name';
const form = new FormData();
form.append('file_content', 'phone_number,__start_execution_time,__end_execution_time,__task_uuid
+1234567890,08:00:00,18:00:00,task-1234-5678-90ab-cdef');

const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Example 1
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.voximplant.com/platform_api/CreateCallList?rule_id=1&priority=1&max_simultaneous=1&num_attempts=1&name=name"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_content\"; filename=\"phone_number,__start_execution_time,__end_execution_time,__task_uuid\n+1234567890,08:00:00,18:00:00,task-1234-5678-90ab-cdef\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Example 1
require 'uri'
require 'net/http'

url = URI("https://api.voximplant.com/platform_api/CreateCallList?rule_id=1&priority=1&max_simultaneous=1&num_attempts=1&name=name")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_content\"; filename=\"phone_number,__start_execution_time,__end_execution_time,__task_uuid\n+1234567890,08:00:00,18:00:00,task-1234-5678-90ab-cdef\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java Example 1
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.voximplant.com/platform_api/CreateCallList?rule_id=1&priority=1&max_simultaneous=1&num_attempts=1&name=name")
  .header("Authorization", "Bearer <token>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_content\"; filename=\"phone_number,__start_execution_time,__end_execution_time,__task_uuid\n+1234567890,08:00:00,18:00:00,task-1234-5678-90ab-cdef\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php Example 1
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.voximplant.com/platform_api/CreateCallList?rule_id=1&priority=1&max_simultaneous=1&num_attempts=1&name=name', [
  'multipart' => [
    [
        'name' => 'file_content',
        'filename' => 'phone_number,__start_execution_time,__end_execution_time,__task_uuid
+1234567890,08:00:00,18:00:00,task-1234-5678-90ab-cdef',
        'contents' => null
    ]
  ]
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Example 1
using RestSharp;

var client = new RestClient("https://api.voximplant.com/platform_api/CreateCallList?rule_id=1&priority=1&max_simultaneous=1&num_attempts=1&name=name");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file_content\"; filename=\"phone_number,__start_execution_time,__end_execution_time,__task_uuid\n+1234567890,08:00:00,18:00:00,task-1234-5678-90ab-cdef\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Example 1
import Foundation

let headers = ["Authorization": "Bearer <token>"]
let parameters = [
  [
    "name": "file_content",
    "fileName": "phone_number,__start_execution_time,__end_execution_time,__task_uuid
+1234567890,08:00:00,18:00:00,task-1234-5678-90ab-cdef"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://api.voximplant.com/platform_api/CreateCallList?rule_id=1&priority=1&max_simultaneous=1&num_attempts=1&name=name")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```