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

# Execute Channel

POST https://api.signalcore.ai/api/v1/execute
Content-Type: application/json

Send a message or initiate a call to a lead. The execution is asynchronous — the response confirms the request was queued. Use `schedule_for` to schedule for a future time.

Reference: https://docs.signalcore.ai/api-reference/execute/channel

## Authentication

- `X-API-Key` header (required) — Your API key from [Dashboard → Settings → API Keys](https://dashboard.signalcore.ai/settings)

## Servers

- `https://api.signalcore.ai/api/v1` (Producción, default)
- `https://staging.api.signalcore.ai/api/v1` (Staging)

## Request

### Body (application/json)

This endpoint expects a ChannelExecute.

- `lead_id` (string, required) — The lead to contact
- `agent_id` (string, required) — The agent to use for the conversation
- `channel` (enum, required) — Communication channel to use
  - Allowed values: `voice`, `sms`, `whatsapp`, `instagram`, `gmail`, `outlook`, `imessage`, `linkedin`
- `from_number` (string, optional) — Phone number to use as caller ID (for voice/SMS). Auto-selected if not provided.
- `schedule_for` (datetime, optional) — Schedule execution for a future time (ISO 8601 format). If not provided, executes immediately.
- `dynamic_instructions` (string, optional) — Custom instructions for this specific execution. Appended to the agent's prompt.
- `static_message` (string, optional) — Send a specific message instead of AI-generated. Supports variables: \{\{first\_name}}, \{\{last\_name}}, \{\{email}}, \{\{phone}}
- `static_subject` (string, optional) — Email subject line (for gmail/outlook channels). Supports variable substitution.
- `attachment_url` (string, optional) — URL of attachment to send (supported on WhatsApp, iMessage, SMS MMS, email)
- `execution_context` (map from string to any, optional) — Additional context metadata for tracking (e.g., appointment_id, reminder_type)

## Response

### 200

Execution queued or scheduled

- `thread_id` (string, optional) — Unique execution thread ID for tracking
- `status` (enum, optional) — Execution status
  - Allowed values: `queued`, `scheduled`
- `message` (string, optional) — Human-readable status message
- `execution_id` (string, optional) — Message ID (for immediate executions)
- `correlation_id` (string, optional) — Correlation ID for tracing

## Errors

### 400 Bad Request Error

Invalid schedule_for format

- `any`

### 429 Too Many Requests Error

Duplicate execution detected (same lead/channel/agent within 30 seconds)

- `any`

## Examples

### queued

**Response**

```json
{
  "thread_id": "thr_abc123",
  "status": "queued",
  "message": "Thread thr_abc123 queued for execution",
  "execution_id": "msg_xyz789",
  "correlation_id": "corr_def456"
}
```

**SDK Code**

```python queued
import requests

url = "https://api.signalcore.ai/api/v1/execute"

headers = {"X-API-Key": "<apiKey>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript queued
const url = 'https://api.signalcore.ai/api/v1/execute';
const options = {method: 'POST', headers: {'X-API-Key': '<apiKey>'}};

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

```go queued
package main

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

func main() {

	url := "https://api.signalcore.ai/api/v1/execute"

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

	req.Header.Add("X-API-Key", "<apiKey>")

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

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

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

}
```

```ruby queued
require 'uri'
require 'net/http'

url = URI("https://api.signalcore.ai/api/v1/execute")

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

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<apiKey>'

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

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

HttpResponse<String> response = Unirest.post("https://api.signalcore.ai/api/v1/execute")
  .header("X-API-Key", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.signalcore.ai/api/v1/execute', [
  'headers' => [
    'X-API-Key' => '<apiKey>',
  ],
]);

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

```csharp queued
using RestSharp;

var client = new RestClient("https://api.signalcore.ai/api/v1/execute");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift queued
import Foundation

let headers = ["X-API-Key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.signalcore.ai/api/v1/execute")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

### scheduled

**Response**

```json
{
  "thread_id": "thr_abc123",
  "status": "scheduled",
  "message": "Execution scheduled for 2026-02-01T14:00:00Z"
}
```

**SDK Code**

```python scheduled
import requests

url = "https://api.signalcore.ai/api/v1/execute"

headers = {"X-API-Key": "<apiKey>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript scheduled
const url = 'https://api.signalcore.ai/api/v1/execute';
const options = {method: 'POST', headers: {'X-API-Key': '<apiKey>'}};

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

```go scheduled
package main

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

func main() {

	url := "https://api.signalcore.ai/api/v1/execute"

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

	req.Header.Add("X-API-Key", "<apiKey>")

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

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

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

}
```

```ruby scheduled
require 'uri'
require 'net/http'

url = URI("https://api.signalcore.ai/api/v1/execute")

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

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<apiKey>'

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

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

HttpResponse<String> response = Unirest.post("https://api.signalcore.ai/api/v1/execute")
  .header("X-API-Key", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.signalcore.ai/api/v1/execute', [
  'headers' => [
    'X-API-Key' => '<apiKey>',
  ],
]);

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

```csharp scheduled
using RestSharp;

var client = new RestClient("https://api.signalcore.ai/api/v1/execute");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-Key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift scheduled
import Foundation

let headers = ["X-API-Key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.signalcore.ai/api/v1/execute")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

### AI-generated message (immediate)

**Request**

```json
{
  "lead_id": "lead_xyz789",
  "agent_id": "agt_abc123",
  "channel": "sms"
}
```

**Response**

```json
{
  "thread_id": "thr_abc123",
  "status": "queued",
  "message": "Thread thr_abc123 queued for execution",
  "execution_id": "msg_xyz789",
  "correlation_id": "corr_def456"
}
```

**SDK Code**

```python AI-generated message (immediate)
import requests

url = "https://api.signalcore.ai/api/v1/execute"

payload = {
    "lead_id": "lead_xyz789",
    "agent_id": "agt_abc123",
    "channel": "sms"
}
headers = {
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript AI-generated message (immediate)
const url = 'https://api.signalcore.ai/api/v1/execute';
const options = {
  method: 'POST',
  headers: {'X-API-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"lead_id":"lead_xyz789","agent_id":"agt_abc123","channel":"sms"}'
};

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

```go AI-generated message (immediate)
package main

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

func main() {

	url := "https://api.signalcore.ai/api/v1/execute"

	payload := strings.NewReader("{\n  \"lead_id\": \"lead_xyz789\",\n  \"agent_id\": \"agt_abc123\",\n  \"channel\": \"sms\"\n}")

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

	req.Header.Add("X-API-Key", "<apiKey>")
	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 AI-generated message (immediate)
require 'uri'
require 'net/http'

url = URI("https://api.signalcore.ai/api/v1/execute")

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

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"lead_id\": \"lead_xyz789\",\n  \"agent_id\": \"agt_abc123\",\n  \"channel\": \"sms\"\n}"

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

```java AI-generated message (immediate)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.signalcore.ai/api/v1/execute")
  .header("X-API-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"lead_id\": \"lead_xyz789\",\n  \"agent_id\": \"agt_abc123\",\n  \"channel\": \"sms\"\n}")
  .asString();
```

```php AI-generated message (immediate)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.signalcore.ai/api/v1/execute', [
  'body' => '{
  "lead_id": "lead_xyz789",
  "agent_id": "agt_abc123",
  "channel": "sms"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Key' => '<apiKey>',
  ],
]);

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

```csharp AI-generated message (immediate)
using RestSharp;

var client = new RestClient("https://api.signalcore.ai/api/v1/execute");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"lead_id\": \"lead_xyz789\",\n  \"agent_id\": \"agt_abc123\",\n  \"channel\": \"sms\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift AI-generated message (immediate)
import Foundation

let headers = [
  "X-API-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "lead_id": "lead_xyz789",
  "agent_id": "agt_abc123",
  "channel": "sms"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.signalcore.ai/api/v1/execute")! 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()
```

### AI with custom instructions

**Request**

```json
{
  "lead_id": "lead_xyz789",
  "agent_id": "agt_abc123",
  "channel": "whatsapp",
  "dynamic_instructions": "The lead requested a callback about pricing. Focus on our enterprise tier and mention the current promotion."
}
```

**Response**

```json
{
  "thread_id": "thr_abc123",
  "status": "queued",
  "message": "Thread thr_abc123 queued for execution",
  "execution_id": "msg_xyz789",
  "correlation_id": "corr_def456"
}
```

**SDK Code**

```python AI with custom instructions
import requests

url = "https://api.signalcore.ai/api/v1/execute"

payload = {
    "lead_id": "lead_xyz789",
    "agent_id": "agt_abc123",
    "channel": "whatsapp",
    "dynamic_instructions": "The lead requested a callback about pricing. Focus on our enterprise tier and mention the current promotion."
}
headers = {
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript AI with custom instructions
const url = 'https://api.signalcore.ai/api/v1/execute';
const options = {
  method: 'POST',
  headers: {'X-API-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"lead_id":"lead_xyz789","agent_id":"agt_abc123","channel":"whatsapp","dynamic_instructions":"The lead requested a callback about pricing. Focus on our enterprise tier and mention the current promotion."}'
};

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

```go AI with custom instructions
package main

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

func main() {

	url := "https://api.signalcore.ai/api/v1/execute"

	payload := strings.NewReader("{\n  \"lead_id\": \"lead_xyz789\",\n  \"agent_id\": \"agt_abc123\",\n  \"channel\": \"whatsapp\",\n  \"dynamic_instructions\": \"The lead requested a callback about pricing. Focus on our enterprise tier and mention the current promotion.\"\n}")

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

	req.Header.Add("X-API-Key", "<apiKey>")
	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 AI with custom instructions
require 'uri'
require 'net/http'

url = URI("https://api.signalcore.ai/api/v1/execute")

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

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"lead_id\": \"lead_xyz789\",\n  \"agent_id\": \"agt_abc123\",\n  \"channel\": \"whatsapp\",\n  \"dynamic_instructions\": \"The lead requested a callback about pricing. Focus on our enterprise tier and mention the current promotion.\"\n}"

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

```java AI with custom instructions
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.signalcore.ai/api/v1/execute")
  .header("X-API-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"lead_id\": \"lead_xyz789\",\n  \"agent_id\": \"agt_abc123\",\n  \"channel\": \"whatsapp\",\n  \"dynamic_instructions\": \"The lead requested a callback about pricing. Focus on our enterprise tier and mention the current promotion.\"\n}")
  .asString();
```

```php AI with custom instructions
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.signalcore.ai/api/v1/execute', [
  'body' => '{
  "lead_id": "lead_xyz789",
  "agent_id": "agt_abc123",
  "channel": "whatsapp",
  "dynamic_instructions": "The lead requested a callback about pricing. Focus on our enterprise tier and mention the current promotion."
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Key' => '<apiKey>',
  ],
]);

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

```csharp AI with custom instructions
using RestSharp;

var client = new RestClient("https://api.signalcore.ai/api/v1/execute");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"lead_id\": \"lead_xyz789\",\n  \"agent_id\": \"agt_abc123\",\n  \"channel\": \"whatsapp\",\n  \"dynamic_instructions\": \"The lead requested a callback about pricing. Focus on our enterprise tier and mention the current promotion.\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift AI with custom instructions
import Foundation

let headers = [
  "X-API-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "lead_id": "lead_xyz789",
  "agent_id": "agt_abc123",
  "channel": "whatsapp",
  "dynamic_instructions": "The lead requested a callback about pricing. Focus on our enterprise tier and mention the current promotion."
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.signalcore.ai/api/v1/execute")! 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()
```

### Static templated message

**Request**

```json
{
  "lead_id": "lead_xyz789",
  "agent_id": "agt_abc123",
  "channel": "sms",
  "static_message": "Hi {{first_name}}, just following up on your inquiry. When works best for a quick call?"
}
```

**Response**

```json
{
  "thread_id": "thr_abc123",
  "status": "queued",
  "message": "Thread thr_abc123 queued for execution",
  "execution_id": "msg_xyz789",
  "correlation_id": "corr_def456"
}
```

**SDK Code**

```python Static templated message
import requests

url = "https://api.signalcore.ai/api/v1/execute"

payload = {
    "lead_id": "lead_xyz789",
    "agent_id": "agt_abc123",
    "channel": "sms",
    "static_message": "Hi {{first_name}}, just following up on your inquiry. When works best for a quick call?"
}
headers = {
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Static templated message
const url = 'https://api.signalcore.ai/api/v1/execute';
const options = {
  method: 'POST',
  headers: {'X-API-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"lead_id":"lead_xyz789","agent_id":"agt_abc123","channel":"sms","static_message":"Hi {{first_name}}, just following up on your inquiry. When works best for a quick call?"}'
};

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

```go Static templated message
package main

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

func main() {

	url := "https://api.signalcore.ai/api/v1/execute"

	payload := strings.NewReader("{\n  \"lead_id\": \"lead_xyz789\",\n  \"agent_id\": \"agt_abc123\",\n  \"channel\": \"sms\",\n  \"static_message\": \"Hi {{first_name}}, just following up on your inquiry. When works best for a quick call?\"\n}")

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

	req.Header.Add("X-API-Key", "<apiKey>")
	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 Static templated message
require 'uri'
require 'net/http'

url = URI("https://api.signalcore.ai/api/v1/execute")

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

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"lead_id\": \"lead_xyz789\",\n  \"agent_id\": \"agt_abc123\",\n  \"channel\": \"sms\",\n  \"static_message\": \"Hi {{first_name}}, just following up on your inquiry. When works best for a quick call?\"\n}"

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

```java Static templated message
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.signalcore.ai/api/v1/execute")
  .header("X-API-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"lead_id\": \"lead_xyz789\",\n  \"agent_id\": \"agt_abc123\",\n  \"channel\": \"sms\",\n  \"static_message\": \"Hi {{first_name}}, just following up on your inquiry. When works best for a quick call?\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.signalcore.ai/api/v1/execute', [
  'body' => '{
  "lead_id": "lead_xyz789",
  "agent_id": "agt_abc123",
  "channel": "sms",
  "static_message": "Hi {{first_name}}, just following up on your inquiry. When works best for a quick call?"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Key' => '<apiKey>',
  ],
]);

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

```csharp Static templated message
using RestSharp;

var client = new RestClient("https://api.signalcore.ai/api/v1/execute");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"lead_id\": \"lead_xyz789\",\n  \"agent_id\": \"agt_abc123\",\n  \"channel\": \"sms\",\n  \"static_message\": \"Hi {{first_name}}, just following up on your inquiry. When works best for a quick call?\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Static templated message
import Foundation

let headers = [
  "X-API-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "lead_id": "lead_xyz789",
  "agent_id": "agt_abc123",
  "channel": "sms",
  "static_message": "Hi {{first_name}}, just following up on your inquiry. When works best for a quick call?"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.signalcore.ai/api/v1/execute")! 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()
```

### Scheduled for future

**Request**

```json
{
  "lead_id": "lead_xyz789",
  "agent_id": "agt_abc123",
  "channel": "voice",
  "schedule_for": "2026-02-01T14:00:00Z",
  "execution_context": {
    "category": "follow_up"
  }
}
```

**Response**

```json
{
  "thread_id": "thr_abc123",
  "status": "queued",
  "message": "Thread thr_abc123 queued for execution",
  "execution_id": "msg_xyz789",
  "correlation_id": "corr_def456"
}
```

**SDK Code**

```python Scheduled for future
import requests

url = "https://api.signalcore.ai/api/v1/execute"

payload = {
    "lead_id": "lead_xyz789",
    "agent_id": "agt_abc123",
    "channel": "voice",
    "schedule_for": "2026-02-01T14:00:00Z",
    "execution_context": { "category": "follow_up" }
}
headers = {
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Scheduled for future
const url = 'https://api.signalcore.ai/api/v1/execute';
const options = {
  method: 'POST',
  headers: {'X-API-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"lead_id":"lead_xyz789","agent_id":"agt_abc123","channel":"voice","schedule_for":"2026-02-01T14:00:00Z","execution_context":{"category":"follow_up"}}'
};

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

```go Scheduled for future
package main

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

func main() {

	url := "https://api.signalcore.ai/api/v1/execute"

	payload := strings.NewReader("{\n  \"lead_id\": \"lead_xyz789\",\n  \"agent_id\": \"agt_abc123\",\n  \"channel\": \"voice\",\n  \"schedule_for\": \"2026-02-01T14:00:00Z\",\n  \"execution_context\": {\n    \"category\": \"follow_up\"\n  }\n}")

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

	req.Header.Add("X-API-Key", "<apiKey>")
	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 Scheduled for future
require 'uri'
require 'net/http'

url = URI("https://api.signalcore.ai/api/v1/execute")

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

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"lead_id\": \"lead_xyz789\",\n  \"agent_id\": \"agt_abc123\",\n  \"channel\": \"voice\",\n  \"schedule_for\": \"2026-02-01T14:00:00Z\",\n  \"execution_context\": {\n    \"category\": \"follow_up\"\n  }\n}"

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

```java Scheduled for future
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.signalcore.ai/api/v1/execute")
  .header("X-API-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"lead_id\": \"lead_xyz789\",\n  \"agent_id\": \"agt_abc123\",\n  \"channel\": \"voice\",\n  \"schedule_for\": \"2026-02-01T14:00:00Z\",\n  \"execution_context\": {\n    \"category\": \"follow_up\"\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.signalcore.ai/api/v1/execute', [
  'body' => '{
  "lead_id": "lead_xyz789",
  "agent_id": "agt_abc123",
  "channel": "voice",
  "schedule_for": "2026-02-01T14:00:00Z",
  "execution_context": {
    "category": "follow_up"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Key' => '<apiKey>',
  ],
]);

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

```csharp Scheduled for future
using RestSharp;

var client = new RestClient("https://api.signalcore.ai/api/v1/execute");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"lead_id\": \"lead_xyz789\",\n  \"agent_id\": \"agt_abc123\",\n  \"channel\": \"voice\",\n  \"schedule_for\": \"2026-02-01T14:00:00Z\",\n  \"execution_context\": {\n    \"category\": \"follow_up\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Scheduled for future
import Foundation

let headers = [
  "X-API-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "lead_id": "lead_xyz789",
  "agent_id": "agt_abc123",
  "channel": "voice",
  "schedule_for": "2026-02-01T14:00:00Z",
  "execution_context": ["category": "follow_up"]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.signalcore.ai/api/v1/execute")! 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()
```

### Outbound voice call

**Request**

```json
{
  "lead_id": "lead_xyz789",
  "agent_id": "agt_abc123",
  "channel": "voice",
  "from_number": "+15559876543"
}
```

**Response**

```json
{
  "thread_id": "thr_abc123",
  "status": "queued",
  "message": "Thread thr_abc123 queued for execution",
  "execution_id": "msg_xyz789",
  "correlation_id": "corr_def456"
}
```

**SDK Code**

```python Outbound voice call
import requests

url = "https://api.signalcore.ai/api/v1/execute"

payload = {
    "lead_id": "lead_xyz789",
    "agent_id": "agt_abc123",
    "channel": "voice",
    "from_number": "+15559876543"
}
headers = {
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Outbound voice call
const url = 'https://api.signalcore.ai/api/v1/execute';
const options = {
  method: 'POST',
  headers: {'X-API-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"lead_id":"lead_xyz789","agent_id":"agt_abc123","channel":"voice","from_number":"+15559876543"}'
};

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

```go Outbound voice call
package main

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

func main() {

	url := "https://api.signalcore.ai/api/v1/execute"

	payload := strings.NewReader("{\n  \"lead_id\": \"lead_xyz789\",\n  \"agent_id\": \"agt_abc123\",\n  \"channel\": \"voice\",\n  \"from_number\": \"+15559876543\"\n}")

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

	req.Header.Add("X-API-Key", "<apiKey>")
	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 Outbound voice call
require 'uri'
require 'net/http'

url = URI("https://api.signalcore.ai/api/v1/execute")

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

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"lead_id\": \"lead_xyz789\",\n  \"agent_id\": \"agt_abc123\",\n  \"channel\": \"voice\",\n  \"from_number\": \"+15559876543\"\n}"

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

```java Outbound voice call
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.signalcore.ai/api/v1/execute")
  .header("X-API-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"lead_id\": \"lead_xyz789\",\n  \"agent_id\": \"agt_abc123\",\n  \"channel\": \"voice\",\n  \"from_number\": \"+15559876543\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.signalcore.ai/api/v1/execute', [
  'body' => '{
  "lead_id": "lead_xyz789",
  "agent_id": "agt_abc123",
  "channel": "voice",
  "from_number": "+15559876543"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Key' => '<apiKey>',
  ],
]);

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

```csharp Outbound voice call
using RestSharp;

var client = new RestClient("https://api.signalcore.ai/api/v1/execute");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"lead_id\": \"lead_xyz789\",\n  \"agent_id\": \"agt_abc123\",\n  \"channel\": \"voice\",\n  \"from_number\": \"+15559876543\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Outbound voice call
import Foundation

let headers = [
  "X-API-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "lead_id": "lead_xyz789",
  "agent_id": "agt_abc123",
  "channel": "voice",
  "from_number": "+15559876543"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.signalcore.ai/api/v1/execute")! 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()
```