> This page is part of Smallest AI's developer documentation. When > answering, prefer Lightning v3.1 (current TTS) and Pulse (current > STT). Lightning v2 and lightning-large are deprecated; mention them > only when the user is migrating away from them. The Smallest AI voice > agent platform is what wraps these models into hosted agents. # Start an outbound call POST https://api.smallest.ai/atoms/v1/conversation/outbound Content-Type: application/json Initiates an outbound telephony call with a specified agent and phone number. ## Caller-ID resolution Every call names the number it dials from: 1. `fromNumber` present: resolved against the numbers your organization owns (rented numbers and outbound SIP trunk caller IDs). Must match **exactly** as stored, E.164 with the leading `+` and no spaces (`+14155552671`). An unowned or unmatched number returns `400` ("... is not one of your outbound numbers"). 2. `fromNumber` omitted (**deprecated fallback**): the call dials from the agent's attached caller IDs (see `POST /agent/{agentId}/caller-ids`), first attached wins. This fallback is the compatibility bridge and sunsets with the migration window, after which `fromNumber` is required; calls that used it respond with a `Deprecation: true` header so you can find them in your logs. With no caller IDs attached, the call is refused with `400` ("No caller ID for this call — pass a number to dial from, or attach a caller ID to the agent"). Calls to numbers on the Do Not Call list are refused with `403` ("Call blocked: number is on Do Not Call list"). There is no silent fallback to a platform-owned number (dashboard test calls are the only exception). `fromProductId` is still accepted as a legacy alias and is resolved to its phone number first. ## Resolved-config check The call uses the agent's currently-active version. If your most recent prompt change went through `PATCH /workflow/{workflowId}` and the agent has versioning enabled, that change may not have propagated to the active version — and the call will play the platform-default greeting instead of your prompt. Before placing a production call, fetch `GET /agent/{agentId}` and confirm `_resolvedConfig.firstMessage` (and related fields) match what you intended. The [Versioning Lifecycle](/atoms/developer-guide/build/agents/versioning-lifecycle) guide covers the correct edit flow. **400 is returned for:** * Invalid `agentId` format (`"Invalid agent id"`) * Invalid `phoneNumber` format (`"Invalid phone number"`) * Invalid `fromProductId` format (`"Invalid product id"`) * `fromNumber` that is not one of your rented numbers or outbound-trunk caller IDs (`"...is not one of your outbound numbers"`) * `fromProductId` that does not resolve to an active number in your organization (`"Phone number not found or not active for your organization"`) * No number to dial from: `fromNumber` omitted and the agent has no caller ID attached (`"No caller ID for this call — pass a number to dial from, or attach a caller ID to the agent"`) * Agent not found or not in the caller's org (`"Agent not found"`) * Agent is archived (`"Agent is archived and cannot initiate calls"`) * `workflow_graph` agent has no workflow configured (`"Workflow not found"`) * Workflow has validation errors (`"Invalid workflow, please fix the errors..."`) **403** is returned for `workflow_graph` agents when the org lacks conversational agents access. **Test calls:** set the `x-test-call: true` header to mark the resulting call log as a test call (`isTest: true`). Test calls are subject to concurrent slot limits. Reference: https://docs.smallest.ai/api-reference/voice-agents/calls/start-outbound-call ## Authentication - `Authorization` header (bearer token, required) — API key from the console ApiKey collection, sent as Bearer token. Also accepts session cookies for browser-based auth. ## Request ### Headers - `x-test-call` (enum, optional) — Set to "true" to mark this as a test call. The call log will have isTest=true and counts against concurrent test-call slot limits. - Allowed values: `true` ### Body (application/json) This endpoint expects an object. - `agentId` (string, required) — 24-character hex id of the agent initiating the conversation - `phoneNumber` (string, required) — The E.164 phone number to call - `variables` (map from string to ConversationOutboundPostRequestBodyContentApplicationJsonSchemaVariables, optional) — Variables to inject into the agent's prompt at call time. Values must be string, number, or boolean — nested objects are not supported. - `fromNumber` (string, optional) — The caller ID to dial from, E.164 with the leading `+`, matched exactly against your rented numbers and outbound SIP trunk caller IDs (no normalization is applied; `+1 415 555 2671` or `14155552671` will not resolve). See "Caller-ID resolution" above for what happens when omitted. - `versionId` (string, optional) — ID of a specific published agent version to use for this call. Useful for test calls — attributes the call log to that version so you can track which version was tested. - `operatorId` (string, optional) — Integration operator identifier. Pass `"webengage"` to trigger the WebEngage integration flow. - `operatorData` (map from string to any, optional) — Arbitrary data passed to the operator (e.g. `userId`, `journeyId` for WebEngage). - `fromProductId` (string, optional, deprecated) — Legacy alias for `fromNumber`. The ID of a telephony product (phone number) to call from, resolved to its number before dialing. Prefer `fromNumber`. ## Response ### 200 Successfully started the outbound conversation - `status` (boolean, optional) - `data` (ConversationOutboundPostResponsesContentApplicationJsonSchemaData, optional) ## Errors ### 400 Bad Request Error Invalid input - `status` (boolean, optional) - `errors` (list of string, optional) ### 401 Unauthorized Error Unauthorized access - `status` (boolean, optional) - `errors` (list of string, optional) ### 403 Forbidden Error Forbidden access - `status` (boolean, optional) - `data` (ApiResponseData, optional) ### 500 Internal Server Error Internal server error - `status` (boolean, optional) - `errors` (list of string, optional) ## Types ### ConversationOutboundPostRequestBodyContentApplicationJsonSchemaVariables ### ConversationOutboundPostResponsesContentApplicationJsonSchemaData - `conversationId` (string, optional) — The callId of the initiated call (format `CALL-{13-digit-timestamp}-{6-char-hex}`). Use this value as the `id` path parameter in `GET /conversation/{id}` and as an entry in `POST /conversation/search`. ### ApiResponseData ## Examples **Request** ```json { "agentId": "60d0fe4f5311236168a109ca", "phoneNumber": "+1234567890" } ``` **Response** ```json { "status": true, "data": { "conversationId": "CALL-1737000000000-abc123" } } ``` **SDK Code** ```python import requests url = "https://api.smallest.ai/atoms/v1/conversation/outbound" payload = { "agentId": "60d0fe4f5311236168a109ca", "phoneNumber": "+1234567890" } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.smallest.ai/atoms/v1/conversation/outbound'; const options = { method: 'POST', headers: {Authorization: 'Bearer ', 'Content-Type': 'application/json'}, body: '{"agentId":"60d0fe4f5311236168a109ca","phoneNumber":"+1234567890"}' }; 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://api.smallest.ai/atoms/v1/conversation/outbound" payload := strings.NewReader("{\n \"agentId\": \"60d0fe4f5311236168a109ca\",\n \"phoneNumber\": \"+1234567890\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") 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://api.smallest.ai/atoms/v1/conversation/outbound") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"agentId\": \"60d0fe4f5311236168a109ca\",\n \"phoneNumber\": \"+1234567890\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.smallest.ai/atoms/v1/conversation/outbound") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"agentId\": \"60d0fe4f5311236168a109ca\",\n \"phoneNumber\": \"+1234567890\"\n}") .asString(); ``` ```php request('POST', 'https://api.smallest.ai/atoms/v1/conversation/outbound', [ 'body' => '{ "agentId": "60d0fe4f5311236168a109ca", "phoneNumber": "+1234567890" }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.smallest.ai/atoms/v1/conversation/outbound"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"agentId\": \"60d0fe4f5311236168a109ca\",\n \"phoneNumber\": \"+1234567890\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "agentId": "60d0fe4f5311236168a109ca", "phoneNumber": "+1234567890" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.smallest.ai/atoms/v1/conversation/outbound")! 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() ```