> For a complete page index, fetch https://docs.synthflow.ai/llms.txt. For full documentation content, fetch https://docs.synthflow.ai/llms-full.txt. # Attach phone numbers to an outbound agent PUT https://api.synthflow.ai/v2/assistants/{model_id}/phone_numbers Content-Type: application/json Attach multiple outbound phone numbers to an agent by phone numbers or by slugs. Reference: https://docs.synthflow.ai/api-reference/platform-api/agents/attach-phone-numbers-to-assistant ## Authentication - `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer `, where token is your auth token. ## Servers - `https://api.synthflow.ai/v2` (Global, default) - `https://api.us.synthflow.ai/v2` (United States) - `https://api.eu.synthflow.ai/v2` (European Union) ## Request ### Path parameters - `model_id` (string, required) — Agent ID. You can find it on the agent’s page in your dashboard. ### Body (application/json) This endpoint expects an attach-phone-numbers-to-assistant_Request. - `attach-phone-numbers-to-assistant_Request` ## Response ### 200 200 - `status` (string, optional) ## Errors ### 404 Not Found Error 404 - `detail` (AssistantsModelIdPhoneNumbersPutResponsesContentApplicationJsonSchemaDetail, optional) ## Types ### AttachPhoneNumbersToAssistantRequest0 - `phone_numbers` (list of string, required) — Phone numbers array. ### AttachPhoneNumbersToAssistantRequest1 - `phone_number_slugs` (list of string, required) — Phone number slugs. ### AssistantsModelIdPhoneNumbersPutResponsesContentApplicationJsonSchemaDetail - `status` (string, required) - `description` (string, required) - `request_id` (string, required) - `category` (string, required) ## Examples ### attach-phone-numbers-to-assistant_example **Response** ```json { "status": "ok" } ``` **SDK Code** ```python attach-phone-numbers-to-assistant_example import requests url = "https://api.synthflow.ai/v2/assistants/model_id/phone_numbers" headers = {"Authorization": "Bearer "} response = requests.put(url, headers=headers) print(response.json()) ``` ```go attach-phone-numbers-to-assistant_example package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.synthflow.ai/v2/assistants/model_id/phone_numbers" req, _ := http.NewRequest("PUT", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby attach-phone-numbers-to-assistant_example require 'uri' require 'net/http' url = URI("https://api.synthflow.ai/v2/assistants/model_id/phone_numbers") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java attach-phone-numbers-to-assistant_example import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.put("https://api.synthflow.ai/v2/assistants/model_id/phone_numbers") .header("Authorization", "Bearer ") .asString(); ``` ```csharp attach-phone-numbers-to-assistant_example using RestSharp; var client = new RestClient("https://api.synthflow.ai/v2/assistants/model_id/phone_numbers"); var request = new RestRequest(Method.PUT); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift attach-phone-numbers-to-assistant_example import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.synthflow.ai/v2/assistants/model_id/phone_numbers")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PUT" request.allHTTPHeaderFields = headers 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() ``` ### Attach by phone numbers **Request** ```json { "phone_numbers": [ "+16286666348", "+12131231214" ] } ``` **Response** ```json { "status": "ok" } ``` **SDK Code** ```python Attach by phone numbers import requests url = "https://api.synthflow.ai/v2/assistants/model_id/phone_numbers" payload = { "phone_numbers": ["+16286666348", "+12131231214"] } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```go Attach by phone numbers package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.synthflow.ai/v2/assistants/model_id/phone_numbers" payload := strings.NewReader("{\n \"phone_numbers\": [\n \"+16286666348\",\n \"+12131231214\"\n ]\n}") req, _ := http.NewRequest("PUT", 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 Attach by phone numbers require 'uri' require 'net/http' url = URI("https://api.synthflow.ai/v2/assistants/model_id/phone_numbers") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"phone_numbers\": [\n \"+16286666348\",\n \"+12131231214\"\n ]\n}" response = http.request(request) puts response.read_body ``` ```java Attach by phone numbers import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.put("https://api.synthflow.ai/v2/assistants/model_id/phone_numbers") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"phone_numbers\": [\n \"+16286666348\",\n \"+12131231214\"\n ]\n}") .asString(); ``` ```csharp Attach by phone numbers using RestSharp; var client = new RestClient("https://api.synthflow.ai/v2/assistants/model_id/phone_numbers"); var request = new RestRequest(Method.PUT); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"phone_numbers\": [\n \"+16286666348\",\n \"+12131231214\"\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Attach by phone numbers import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["phone_numbers": ["+16286666348", "+12131231214"]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.synthflow.ai/v2/assistants/model_id/phone_numbers")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PUT" 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() ``` ### Attach by slugs **Request** ```json { "phone_number_slugs": [ "16286666348", "1231242151" ] } ``` **Response** ```json { "status": "ok" } ``` **SDK Code** ```python Attach by slugs import requests url = "https://api.synthflow.ai/v2/assistants/model_id/phone_numbers" payload = { "phone_number_slugs": ["16286666348", "1231242151"] } headers = { "Authorization": "Bearer ", "Content-Type": "application/json" } response = requests.put(url, json=payload, headers=headers) print(response.json()) ``` ```go Attach by slugs package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.synthflow.ai/v2/assistants/model_id/phone_numbers" payload := strings.NewReader("{\n \"phone_number_slugs\": [\n \"16286666348\",\n \"1231242151\"\n ]\n}") req, _ := http.NewRequest("PUT", 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 Attach by slugs require 'uri' require 'net/http' url = URI("https://api.synthflow.ai/v2/assistants/model_id/phone_numbers") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"phone_number_slugs\": [\n \"16286666348\",\n \"1231242151\"\n ]\n}" response = http.request(request) puts response.read_body ``` ```java Attach by slugs import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.put("https://api.synthflow.ai/v2/assistants/model_id/phone_numbers") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"phone_number_slugs\": [\n \"16286666348\",\n \"1231242151\"\n ]\n}") .asString(); ``` ```csharp Attach by slugs using RestSharp; var client = new RestClient("https://api.synthflow.ai/v2/assistants/model_id/phone_numbers"); var request = new RestRequest(Method.PUT); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"phone_number_slugs\": [\n \"16286666348\",\n \"1231242151\"\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Attach by slugs import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["phone_number_slugs": ["16286666348", "1231242151"]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.synthflow.ai/v2/assistants/model_id/phone_numbers")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PUT" 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() ```