curl --request POST \
--url https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/agents/{agentId}/outbound \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data @- <<EOF
{
"contact": {
"identifier": "+573001234567",
"identifierType": "PHONE",
"messageProviderType": "WHATSAPP",
"providerChannelId": "c4f2a1e0-9b8d-4e7c-a6f5-1d2e3f4a5b6c"
},
"template": {
"id": "7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f",
"name": "leadscout_outbound_fb_v1",
"orderedParams": [
"Maria",
"ACME"
],
"parameters": {
"recipient_first_name": "Maria",
"tracking_code": "TRK123"
},
"media": {
"type": "IMAGE",
"mediaId": null,
"url": null
}
},
"additionalMessages": [
{
"messageBody": "Just confirming we're still on for tomorrow at 10am.",
"mediaIds": []
}
],
"agentContext": {
"notes": "The Contact asked about pricing tiers last week.",
"mediaIds": []
},
"consent": {
"status": "GRANTED",
"capturedAt": "2026-04-20T10:00:00.000Z"
},
"handoffOverride": {
"preAssignedUser": {
"identifier": "advisor@acme.com",
"identifierType": "EMAIL"
}
},
"brandId": null,
"campaignId": null,
"forceSend": false
}
EOFimport requests
url = "https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/agents/{agentId}/outbound"
payload = {
"contact": {
"identifier": "+573001234567",
"identifierType": "PHONE",
"messageProviderType": "WHATSAPP",
"providerChannelId": "c4f2a1e0-9b8d-4e7c-a6f5-1d2e3f4a5b6c"
},
"template": {
"id": "7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f",
"name": "leadscout_outbound_fb_v1",
"orderedParams": ["Maria", "ACME"],
"parameters": {
"recipient_first_name": "Maria",
"tracking_code": "TRK123"
},
"media": {
"type": "IMAGE",
"mediaId": None,
"url": None
}
},
"additionalMessages": [
{
"messageBody": "Just confirming we're still on for tomorrow at 10am.",
"mediaIds": []
}
],
"agentContext": {
"notes": "The Contact asked about pricing tiers last week.",
"mediaIds": []
},
"consent": {
"status": "GRANTED",
"capturedAt": "2026-04-20T10:00:00.000Z"
},
"handoffOverride": { "preAssignedUser": {
"identifier": "advisor@acme.com",
"identifierType": "EMAIL"
} },
"brandId": None,
"campaignId": None,
"forceSend": False
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contact: {
identifier: '+573001234567',
identifierType: 'PHONE',
messageProviderType: 'WHATSAPP',
providerChannelId: 'c4f2a1e0-9b8d-4e7c-a6f5-1d2e3f4a5b6c'
},
template: {
id: '7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f',
name: 'leadscout_outbound_fb_v1',
orderedParams: ['Maria', 'ACME'],
parameters: {recipient_first_name: 'Maria', tracking_code: 'TRK123'},
media: {type: 'IMAGE', mediaId: null, url: null}
},
additionalMessages: [
{
messageBody: 'Just confirming we\'re still on for tomorrow at 10am.',
mediaIds: []
}
],
agentContext: {notes: 'The Contact asked about pricing tiers last week.', mediaIds: []},
consent: {status: 'GRANTED', capturedAt: '2026-04-20T10:00:00.000Z'},
handoffOverride: {preAssignedUser: {identifier: 'advisor@acme.com', identifierType: 'EMAIL'}},
brandId: null,
campaignId: null,
forceSend: false
})
};
fetch('https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/agents/{agentId}/outbound', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/agents/{agentId}/outbound",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'contact' => [
'identifier' => '+573001234567',
'identifierType' => 'PHONE',
'messageProviderType' => 'WHATSAPP',
'providerChannelId' => 'c4f2a1e0-9b8d-4e7c-a6f5-1d2e3f4a5b6c'
],
'template' => [
'id' => '7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f',
'name' => 'leadscout_outbound_fb_v1',
'orderedParams' => [
'Maria',
'ACME'
],
'parameters' => [
'recipient_first_name' => 'Maria',
'tracking_code' => 'TRK123'
],
'media' => [
'type' => 'IMAGE',
'mediaId' => null,
'url' => null
]
],
'additionalMessages' => [
[
'messageBody' => 'Just confirming we\'re still on for tomorrow at 10am.',
'mediaIds' => [
]
]
],
'agentContext' => [
'notes' => 'The Contact asked about pricing tiers last week.',
'mediaIds' => [
]
],
'consent' => [
'status' => 'GRANTED',
'capturedAt' => '2026-04-20T10:00:00.000Z'
],
'handoffOverride' => [
'preAssignedUser' => [
'identifier' => 'advisor@acme.com',
'identifierType' => 'EMAIL'
]
],
'brandId' => null,
'campaignId' => null,
'forceSend' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/agents/{agentId}/outbound"
payload := strings.NewReader("{\n \"contact\": {\n \"identifier\": \"+573001234567\",\n \"identifierType\": \"PHONE\",\n \"messageProviderType\": \"WHATSAPP\",\n \"providerChannelId\": \"c4f2a1e0-9b8d-4e7c-a6f5-1d2e3f4a5b6c\"\n },\n \"template\": {\n \"id\": \"7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f\",\n \"name\": \"leadscout_outbound_fb_v1\",\n \"orderedParams\": [\n \"Maria\",\n \"ACME\"\n ],\n \"parameters\": {\n \"recipient_first_name\": \"Maria\",\n \"tracking_code\": \"TRK123\"\n },\n \"media\": {\n \"type\": \"IMAGE\",\n \"mediaId\": null,\n \"url\": null\n }\n },\n \"additionalMessages\": [\n {\n \"messageBody\": \"Just confirming we're still on for tomorrow at 10am.\",\n \"mediaIds\": []\n }\n ],\n \"agentContext\": {\n \"notes\": \"The Contact asked about pricing tiers last week.\",\n \"mediaIds\": []\n },\n \"consent\": {\n \"status\": \"GRANTED\",\n \"capturedAt\": \"2026-04-20T10:00:00.000Z\"\n },\n \"handoffOverride\": {\n \"preAssignedUser\": {\n \"identifier\": \"advisor@acme.com\",\n \"identifierType\": \"EMAIL\"\n }\n },\n \"brandId\": null,\n \"campaignId\": null,\n \"forceSend\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/agents/{agentId}/outbound")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"contact\": {\n \"identifier\": \"+573001234567\",\n \"identifierType\": \"PHONE\",\n \"messageProviderType\": \"WHATSAPP\",\n \"providerChannelId\": \"c4f2a1e0-9b8d-4e7c-a6f5-1d2e3f4a5b6c\"\n },\n \"template\": {\n \"id\": \"7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f\",\n \"name\": \"leadscout_outbound_fb_v1\",\n \"orderedParams\": [\n \"Maria\",\n \"ACME\"\n ],\n \"parameters\": {\n \"recipient_first_name\": \"Maria\",\n \"tracking_code\": \"TRK123\"\n },\n \"media\": {\n \"type\": \"IMAGE\",\n \"mediaId\": null,\n \"url\": null\n }\n },\n \"additionalMessages\": [\n {\n \"messageBody\": \"Just confirming we're still on for tomorrow at 10am.\",\n \"mediaIds\": []\n }\n ],\n \"agentContext\": {\n \"notes\": \"The Contact asked about pricing tiers last week.\",\n \"mediaIds\": []\n },\n \"consent\": {\n \"status\": \"GRANTED\",\n \"capturedAt\": \"2026-04-20T10:00:00.000Z\"\n },\n \"handoffOverride\": {\n \"preAssignedUser\": {\n \"identifier\": \"advisor@acme.com\",\n \"identifierType\": \"EMAIL\"\n }\n },\n \"brandId\": null,\n \"campaignId\": null,\n \"forceSend\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/agents/{agentId}/outbound")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contact\": {\n \"identifier\": \"+573001234567\",\n \"identifierType\": \"PHONE\",\n \"messageProviderType\": \"WHATSAPP\",\n \"providerChannelId\": \"c4f2a1e0-9b8d-4e7c-a6f5-1d2e3f4a5b6c\"\n },\n \"template\": {\n \"id\": \"7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f\",\n \"name\": \"leadscout_outbound_fb_v1\",\n \"orderedParams\": [\n \"Maria\",\n \"ACME\"\n ],\n \"parameters\": {\n \"recipient_first_name\": \"Maria\",\n \"tracking_code\": \"TRK123\"\n },\n \"media\": {\n \"type\": \"IMAGE\",\n \"mediaId\": null,\n \"url\": null\n }\n },\n \"additionalMessages\": [\n {\n \"messageBody\": \"Just confirming we're still on for tomorrow at 10am.\",\n \"mediaIds\": []\n }\n ],\n \"agentContext\": {\n \"notes\": \"The Contact asked about pricing tiers last week.\",\n \"mediaIds\": []\n },\n \"consent\": {\n \"status\": \"GRANTED\",\n \"capturedAt\": \"2026-04-20T10:00:00.000Z\"\n },\n \"handoffOverride\": {\n \"preAssignedUser\": {\n \"identifier\": \"advisor@acme.com\",\n \"identifierType\": \"EMAIL\"\n }\n },\n \"brandId\": null,\n \"campaignId\": null,\n \"forceSend\": false\n}"
response = http.request(request)
puts response.read_body{
"conversation": {
"id": "b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234",
"workspaceId": "b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234",
"participants": {
"externals": [
{
"identifier": "ef7ee722-5f95-415a-9a98-81eeae178b11",
"identifierType": "EMAIL",
"role": "EXTERNAL",
"joinedAt": "2004-04-10T09:00:00.000Z",
"lastSeenAt": null
}
],
"internals": [
{
"identifier": "ef7ee722-5f95-415a-9a98-81eeae178b11",
"identifierType": "EMAIL",
"role": "EXTERNAL",
"joinedAt": "2004-04-10T09:00:00.000Z",
"lastSeenAt": null
}
]
},
"createdAt": "2003-04-10T09:00:00.000Z",
"updatedAt": "2003-04-10T09:00:00.000Z",
"name": "Bridge Support Team",
"status": "ACTIVE"
},
"contact": {
"id": "b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234",
"workspaceId": "92b2d4f3-81e1-4b61-a7ec-6f4ff3b58be5",
"type": "NORMAL",
"createdAt": "2003-04-10T08:00:00.000Z",
"updatedAt": "2003-04-10T08:00:00.000Z",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"cellphone": "+14084029292",
"customAttributes": [
{
"key": "<string>",
"values": [
"<string>"
]
}
],
"languageCode": "EN",
"ownerId": "37673840-6259-40f9-bbe5-a7db40f8e3cf"
},
"templateSent": {
"name": "leadscout_outbound_fb_v1",
"id": "7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f",
"messageId": "7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f"
},
"additionalMessagesPersisted": 0,
"alreadyInitiated": false,
"recovered": false
}Iniciar conversación saliente con un Contact como Agent específico
Inicia una conversación saliente con un Contact conocido, atendida por el Agent indicado.
Funciona con Agents LeadScout y Service. Primero se resuelve el Contact y después el Agent, que debe existir en el workspace y estar disponible (consulta GET /agents). La plantilla se referencia mediante template.id o template.name (id tiene prioridad si se envían ambos), debe existir y estar APPROVED, y cualquier Bridge User de handoffOverride debe ser válido. Si template.media.mediaId es desconocido, la solicitud falla con 400 BRIDGE_AI_LEADSCOUT_0016 solo después de crear o recuperar la conversación, por lo que un reintento tras ese error puede responder de otra manera. Las reglas del cuerpo (consent.status=GRANTED sin capturedAt, o template.media sin exactamente uno de mediaId o url) fallan con 400 BRIDGE_CORE_0103.
La conversación se abre en una de las líneas activas de WhatsApp del Agent, bajo su control, con la plantilla como primer mensaje. Se elige una línea en este orden:
- Una línea libre.
- En su defecto, una línea con una conversación liberada recuperable con este Contact. La recuperación devuelve
recovered=truey reemplaza el contexto saliente anterior yagentContext. Esto ocurre incluso conforceSend=false. - Si ninguna línea está libre o es recuperable:
forceSend=false(predeterminado) falla con 409BRIDGE_AI_LEADSCOUT_0008;forceSend=truereutiliza una línea ocupada por una conversación activa con este Contact, dando preferencia a una que controle este Agent. Si la conversación elegida está controlada por otro Agent o un Bridge User, la llamada falla con 409BRIDGE_AI_AGENT_OUTBOUND_0006y no se escribe nada. Libérala primero y reintenta después. Nunca se usan líneas cuya conversación esté bloqueada o se haya liberado sin recuperación, por lo que, si ninguna línea está ocupada por una conversación activa, la llamada falla con 409BRIDGE_AI_LEADSCOUT_0008incluso conforceSend=true.
contact.providerChannelId es una preferencia: la línea indicada se usa cuando está libre o es recuperable; de lo contrario, se aplica el mismo orden entre todas las líneas del Agent. Entre las líneas ocupadas, tiene prioridad una que controle este Agent; si no existe, se reutiliza la línea indicada (y puede fallar con 0006).
La reutilización de una conversación depende del tipo de Agent:
- LeadScout: si su sesión de LeadScout sigue abierta y no ha vencido, la llamada falla con 409
BRIDGE_AI_LEADSCOUT_0017(extraincluyeconversationId,sessionIdystage). Si no se puede finalizar una sesión vencida, falla con 409BRIDGE_AI_LEADSCOUT_0018. - Service Agent: se continúa una sesión de servicio abierta que no haya vencido; una sesión vencida se cierra como abandonada y se abre una nueva.
Consulta la guía completa de envío saliente para los requisitos, la tabla de decisión de forceSend, la recuperación, el trabajo parcial y las decisiones de reintento seguro.
curl --request POST \
--url https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/agents/{agentId}/outbound \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data @- <<EOF
{
"contact": {
"identifier": "+573001234567",
"identifierType": "PHONE",
"messageProviderType": "WHATSAPP",
"providerChannelId": "c4f2a1e0-9b8d-4e7c-a6f5-1d2e3f4a5b6c"
},
"template": {
"id": "7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f",
"name": "leadscout_outbound_fb_v1",
"orderedParams": [
"Maria",
"ACME"
],
"parameters": {
"recipient_first_name": "Maria",
"tracking_code": "TRK123"
},
"media": {
"type": "IMAGE",
"mediaId": null,
"url": null
}
},
"additionalMessages": [
{
"messageBody": "Just confirming we're still on for tomorrow at 10am.",
"mediaIds": []
}
],
"agentContext": {
"notes": "The Contact asked about pricing tiers last week.",
"mediaIds": []
},
"consent": {
"status": "GRANTED",
"capturedAt": "2026-04-20T10:00:00.000Z"
},
"handoffOverride": {
"preAssignedUser": {
"identifier": "advisor@acme.com",
"identifierType": "EMAIL"
}
},
"brandId": null,
"campaignId": null,
"forceSend": false
}
EOFimport requests
url = "https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/agents/{agentId}/outbound"
payload = {
"contact": {
"identifier": "+573001234567",
"identifierType": "PHONE",
"messageProviderType": "WHATSAPP",
"providerChannelId": "c4f2a1e0-9b8d-4e7c-a6f5-1d2e3f4a5b6c"
},
"template": {
"id": "7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f",
"name": "leadscout_outbound_fb_v1",
"orderedParams": ["Maria", "ACME"],
"parameters": {
"recipient_first_name": "Maria",
"tracking_code": "TRK123"
},
"media": {
"type": "IMAGE",
"mediaId": None,
"url": None
}
},
"additionalMessages": [
{
"messageBody": "Just confirming we're still on for tomorrow at 10am.",
"mediaIds": []
}
],
"agentContext": {
"notes": "The Contact asked about pricing tiers last week.",
"mediaIds": []
},
"consent": {
"status": "GRANTED",
"capturedAt": "2026-04-20T10:00:00.000Z"
},
"handoffOverride": { "preAssignedUser": {
"identifier": "advisor@acme.com",
"identifierType": "EMAIL"
} },
"brandId": None,
"campaignId": None,
"forceSend": False
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
contact: {
identifier: '+573001234567',
identifierType: 'PHONE',
messageProviderType: 'WHATSAPP',
providerChannelId: 'c4f2a1e0-9b8d-4e7c-a6f5-1d2e3f4a5b6c'
},
template: {
id: '7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f',
name: 'leadscout_outbound_fb_v1',
orderedParams: ['Maria', 'ACME'],
parameters: {recipient_first_name: 'Maria', tracking_code: 'TRK123'},
media: {type: 'IMAGE', mediaId: null, url: null}
},
additionalMessages: [
{
messageBody: 'Just confirming we\'re still on for tomorrow at 10am.',
mediaIds: []
}
],
agentContext: {notes: 'The Contact asked about pricing tiers last week.', mediaIds: []},
consent: {status: 'GRANTED', capturedAt: '2026-04-20T10:00:00.000Z'},
handoffOverride: {preAssignedUser: {identifier: 'advisor@acme.com', identifierType: 'EMAIL'}},
brandId: null,
campaignId: null,
forceSend: false
})
};
fetch('https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/agents/{agentId}/outbound', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/agents/{agentId}/outbound",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'contact' => [
'identifier' => '+573001234567',
'identifierType' => 'PHONE',
'messageProviderType' => 'WHATSAPP',
'providerChannelId' => 'c4f2a1e0-9b8d-4e7c-a6f5-1d2e3f4a5b6c'
],
'template' => [
'id' => '7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f',
'name' => 'leadscout_outbound_fb_v1',
'orderedParams' => [
'Maria',
'ACME'
],
'parameters' => [
'recipient_first_name' => 'Maria',
'tracking_code' => 'TRK123'
],
'media' => [
'type' => 'IMAGE',
'mediaId' => null,
'url' => null
]
],
'additionalMessages' => [
[
'messageBody' => 'Just confirming we\'re still on for tomorrow at 10am.',
'mediaIds' => [
]
]
],
'agentContext' => [
'notes' => 'The Contact asked about pricing tiers last week.',
'mediaIds' => [
]
],
'consent' => [
'status' => 'GRANTED',
'capturedAt' => '2026-04-20T10:00:00.000Z'
],
'handoffOverride' => [
'preAssignedUser' => [
'identifier' => 'advisor@acme.com',
'identifierType' => 'EMAIL'
]
],
'brandId' => null,
'campaignId' => null,
'forceSend' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/agents/{agentId}/outbound"
payload := strings.NewReader("{\n \"contact\": {\n \"identifier\": \"+573001234567\",\n \"identifierType\": \"PHONE\",\n \"messageProviderType\": \"WHATSAPP\",\n \"providerChannelId\": \"c4f2a1e0-9b8d-4e7c-a6f5-1d2e3f4a5b6c\"\n },\n \"template\": {\n \"id\": \"7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f\",\n \"name\": \"leadscout_outbound_fb_v1\",\n \"orderedParams\": [\n \"Maria\",\n \"ACME\"\n ],\n \"parameters\": {\n \"recipient_first_name\": \"Maria\",\n \"tracking_code\": \"TRK123\"\n },\n \"media\": {\n \"type\": \"IMAGE\",\n \"mediaId\": null,\n \"url\": null\n }\n },\n \"additionalMessages\": [\n {\n \"messageBody\": \"Just confirming we're still on for tomorrow at 10am.\",\n \"mediaIds\": []\n }\n ],\n \"agentContext\": {\n \"notes\": \"The Contact asked about pricing tiers last week.\",\n \"mediaIds\": []\n },\n \"consent\": {\n \"status\": \"GRANTED\",\n \"capturedAt\": \"2026-04-20T10:00:00.000Z\"\n },\n \"handoffOverride\": {\n \"preAssignedUser\": {\n \"identifier\": \"advisor@acme.com\",\n \"identifierType\": \"EMAIL\"\n }\n },\n \"brandId\": null,\n \"campaignId\": null,\n \"forceSend\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/agents/{agentId}/outbound")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"contact\": {\n \"identifier\": \"+573001234567\",\n \"identifierType\": \"PHONE\",\n \"messageProviderType\": \"WHATSAPP\",\n \"providerChannelId\": \"c4f2a1e0-9b8d-4e7c-a6f5-1d2e3f4a5b6c\"\n },\n \"template\": {\n \"id\": \"7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f\",\n \"name\": \"leadscout_outbound_fb_v1\",\n \"orderedParams\": [\n \"Maria\",\n \"ACME\"\n ],\n \"parameters\": {\n \"recipient_first_name\": \"Maria\",\n \"tracking_code\": \"TRK123\"\n },\n \"media\": {\n \"type\": \"IMAGE\",\n \"mediaId\": null,\n \"url\": null\n }\n },\n \"additionalMessages\": [\n {\n \"messageBody\": \"Just confirming we're still on for tomorrow at 10am.\",\n \"mediaIds\": []\n }\n ],\n \"agentContext\": {\n \"notes\": \"The Contact asked about pricing tiers last week.\",\n \"mediaIds\": []\n },\n \"consent\": {\n \"status\": \"GRANTED\",\n \"capturedAt\": \"2026-04-20T10:00:00.000Z\"\n },\n \"handoffOverride\": {\n \"preAssignedUser\": {\n \"identifier\": \"advisor@acme.com\",\n \"identifierType\": \"EMAIL\"\n }\n },\n \"brandId\": null,\n \"campaignId\": null,\n \"forceSend\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/agents/{agentId}/outbound")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"contact\": {\n \"identifier\": \"+573001234567\",\n \"identifierType\": \"PHONE\",\n \"messageProviderType\": \"WHATSAPP\",\n \"providerChannelId\": \"c4f2a1e0-9b8d-4e7c-a6f5-1d2e3f4a5b6c\"\n },\n \"template\": {\n \"id\": \"7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f\",\n \"name\": \"leadscout_outbound_fb_v1\",\n \"orderedParams\": [\n \"Maria\",\n \"ACME\"\n ],\n \"parameters\": {\n \"recipient_first_name\": \"Maria\",\n \"tracking_code\": \"TRK123\"\n },\n \"media\": {\n \"type\": \"IMAGE\",\n \"mediaId\": null,\n \"url\": null\n }\n },\n \"additionalMessages\": [\n {\n \"messageBody\": \"Just confirming we're still on for tomorrow at 10am.\",\n \"mediaIds\": []\n }\n ],\n \"agentContext\": {\n \"notes\": \"The Contact asked about pricing tiers last week.\",\n \"mediaIds\": []\n },\n \"consent\": {\n \"status\": \"GRANTED\",\n \"capturedAt\": \"2026-04-20T10:00:00.000Z\"\n },\n \"handoffOverride\": {\n \"preAssignedUser\": {\n \"identifier\": \"advisor@acme.com\",\n \"identifierType\": \"EMAIL\"\n }\n },\n \"brandId\": null,\n \"campaignId\": null,\n \"forceSend\": false\n}"
response = http.request(request)
puts response.read_body{
"conversation": {
"id": "b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234",
"workspaceId": "b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234",
"participants": {
"externals": [
{
"identifier": "ef7ee722-5f95-415a-9a98-81eeae178b11",
"identifierType": "EMAIL",
"role": "EXTERNAL",
"joinedAt": "2004-04-10T09:00:00.000Z",
"lastSeenAt": null
}
],
"internals": [
{
"identifier": "ef7ee722-5f95-415a-9a98-81eeae178b11",
"identifierType": "EMAIL",
"role": "EXTERNAL",
"joinedAt": "2004-04-10T09:00:00.000Z",
"lastSeenAt": null
}
]
},
"createdAt": "2003-04-10T09:00:00.000Z",
"updatedAt": "2003-04-10T09:00:00.000Z",
"name": "Bridge Support Team",
"status": "ACTIVE"
},
"contact": {
"id": "b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234",
"workspaceId": "92b2d4f3-81e1-4b61-a7ec-6f4ff3b58be5",
"type": "NORMAL",
"createdAt": "2003-04-10T08:00:00.000Z",
"updatedAt": "2003-04-10T08:00:00.000Z",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"cellphone": "+14084029292",
"customAttributes": [
{
"key": "<string>",
"values": [
"<string>"
]
}
],
"languageCode": "EN",
"ownerId": "37673840-6259-40f9-bbe5-a7db40f8e3cf"
},
"templateSent": {
"name": "leadscout_outbound_fb_v1",
"id": "7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f",
"messageId": "7e1d2c3b-4a5f-6e7d-8c9b-0a1b2c3d4e5f"
},
"additionalMessagesPersisted": 0,
"alreadyInitiated": false,
"recovered": false
}Parámetros de ruta
Cuerpo
Cuerpo de la solicitud para iniciar una conversación saliente atendida por un Agent específico.
Controla qué ocurre cuando ninguna línea del Agent está libre o es recuperable. Siempre tiene prioridad una línea libre, seguida de una línea con una conversación liberada recuperable con este Contact, sea cual sea el valor de esta opción. Cuando ninguna existe: con false (predeterminado), la solicitud falla con 409 BRIDGE_AI_LEADSCOUT_0008; con true, se reutiliza una línea ocupada por una conversación activa con este Contact, dando preferencia a una que controle este Agent. Si la conversación elegida está controlada por otro Agent o por un Bridge User, la solicitud falla con 409 BRIDGE_AI_AGENT_OUTBOUND_0006 y no se escribe nada; libérala primero y reintenta después. Nunca se usan líneas cuya conversación esté bloqueada o se haya liberado sin recuperación; por tanto, si ninguna línea está ocupada por una conversación activa, la solicitud falla con 409 BRIDGE_AI_LEADSCOUT_0008 incluso con true.
false
true
Respuesta
Respuesta satisfactoria
Cuerpo de respuesta de un inicio saliente de Agent satisfactorio.
True cuando esta solicitud satisfactoria reutilizó una conversación activa existente mediante forceSend=true. False para creación o recuperación; consulta recovered para distinguir esas rutas. Es informativo: una reutilización satisfactoria también guarda la nueva plantilla y los seguimientos, por lo que repetir la solicitud puede agregar mensajes.
false
true
¿Esta página le ayudó?

