> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.schoolset.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.schoolset.io/_mcp/server.

# Create and send a voice message

POST https://ssuccessv2.com/app/api/v1/services/voice/create
Content-Type: multipart/form-data

Uploads a voice recording, associates it with a supported school record, and queues delivery through the configured Twilio account.

Reference: https://docs.schoolset.io/api-reference/school-set-api/voice-messages/create-voice

## Authentication

- `Authorization` header (bearer token, required) — The signed-in SchoolSet user token sent by the frontend.

## Request

### Body (multipart/form-data)

This endpoint expects a multipart form containing a file.

- `from` (string, required)
- `to` (string, required)
- `title` (string, required)
- `voice` (file, required) — Voice recording uploaded for delivery.
- `model_name` (enum, required)
- `model_id` (integer, required)

## Response

### 200

Voice message was stored and queued or marked unavailable when Twilio settings are absent.

- `status` (string, optional)
- `message` (string, optional)
- `data` (ApiV1ServicesVoiceCreatePostResponsesContentApplicationJsonSchemaData, optional)

## Errors

### 401 Unauthorized Error

Authentication is required to create a voice message.

- `status` (string, required)
- `message` (string, required)
- `data` (any, optional, nullable)

### 403 Forbidden Error

The user lacks permission to create broadcasts for this school.

- `status` (string, required)
- `message` (string, required)
- `data` (any, optional, nullable)

### 404 Not Found Error

The configured service account or associated model record was not found.

- `status` (string, required)
- `message` (string, required)
- `data` (any, optional, nullable)

### 422 Unprocessable Entity Error

The recipient

- `message` (string, required)
- `errors` (map from string to list of string, required)

### 500 Internal Server Error

The voice file could not be stored or delivery could not be prepared.

- `status` (string, required)
- `message` (string, required)
- `data` (any, optional, nullable)

## Types

### ApiV1ServicesVoiceCreatePostResponsesContentApplicationJsonSchemaData

- `id` (integer, optional)
- `type` (string, optional)
- `title` (string, optional)
- `from` (string, optional)
- `to` (string, optional)
- `voice` (string, optional)

## Examples

**Request**

```json
{
  "from": "SchoolSet Academy",
  "to": "+15551234567",
  "title": "Reminder about tomorrow's pickup",
  "voice": "<file: string>",
  "model_name": "Contract",
  "model_id": 1842
}
```

**Response**

```json
{
  "status": "success",
  "message": "Saved successfully",
  "data": {
    "id": 901,
    "type": "Voice",
    "title": "Reminder about tomorrow's pickup",
    "from": "SchoolSet Academy",
    "to": "+15551234567",
    "voice": "schools/12/users/44/a1b2c3.mp3"
  }
}
```

**SDK Code**

```python
import requests

url = "https://ssuccessv2.com/app/api/v1/services/voice/create"

files = { "voice": "open('string', 'rb')" }
payload = {
    "from": "SchoolSet Academy",
    "to": "+15551234567",
    "title": "Reminder about tomorrow's pickup",
    "model_name": "Contract",
    "model_id": "1842"
}
headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, data=payload, files=files, headers=headers)

print(response.json())
```

```javascript
const url = 'https://ssuccessv2.com/app/api/v1/services/voice/create';
const form = new FormData();
form.append('from', 'SchoolSet Academy');
form.append('to', '+15551234567');
form.append('title', 'Reminder about tomorrow's pickup');
form.append('voice', 'string');
form.append('model_name', 'Contract');
form.append('model_id', '1842');

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
package main

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

func main() {

	url := "https://ssuccessv2.com/app/api/v1/services/voice/create"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"from\"\r\n\r\nSchoolSet Academy\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"to\"\r\n\r\n+15551234567\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"title\"\r\n\r\nReminder about tomorrow's pickup\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nContract\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_id\"\r\n\r\n1842\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
require 'uri'
require 'net/http'

url = URI("https://ssuccessv2.com/app/api/v1/services/voice/create")

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=\"from\"\r\n\r\nSchoolSet Academy\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"to\"\r\n\r\n+15551234567\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"title\"\r\n\r\nReminder about tomorrow's pickup\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nContract\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_id\"\r\n\r\n1842\r\n-----011000010111000001101001--\r\n"

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

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

HttpResponse<String> response = Unirest.post("https://ssuccessv2.com/app/api/v1/services/voice/create")
  .header("Authorization", "Bearer <token>")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"from\"\r\n\r\nSchoolSet Academy\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"to\"\r\n\r\n+15551234567\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"title\"\r\n\r\nReminder about tomorrow's pickup\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nContract\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_id\"\r\n\r\n1842\r\n-----011000010111000001101001--\r\n")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://ssuccessv2.com/app/api/v1/services/voice/create', [
  'multipart' => [
    [
        'name' => 'from',
        'contents' => 'SchoolSet Academy'
    ],
    [
        'name' => 'to',
        'contents' => '+15551234567'
    ],
    [
        'name' => 'title',
        'contents' => 'Reminder about tomorrow\'s pickup'
    ],
    [
        'name' => 'voice',
        'filename' => 'string',
        'contents' => null
    ],
    [
        'name' => 'model_name',
        'contents' => 'Contract'
    ],
    [
        'name' => 'model_id',
        'contents' => '1842'
    ]
  ]
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://ssuccessv2.com/app/api/v1/services/voice/create");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"from\"\r\n\r\nSchoolSet Academy\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"to\"\r\n\r\n+15551234567\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"title\"\r\n\r\nReminder about tomorrow's pickup\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"voice\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_name\"\r\n\r\nContract\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"model_id\"\r\n\r\n1842\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]
let parameters = [
  [
    "name": "from",
    "value": "SchoolSet Academy"
  ],
  [
    "name": "to",
    "value": "+15551234567"
  ],
  [
    "name": "title",
    "value": "Reminder about tomorrow's pickup"
  ],
  [
    "name": "voice",
    "fileName": "string"
  ],
  [
    "name": "model_name",
    "value": "Contract"
  ],
  [
    "name": "model_id",
    "value": "1842"
  ]
]

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://ssuccessv2.com/app/api/v1/services/voice/create")! 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()
```