JavaScript
import AIInbx from 'aiinbx';
const client = new AIInbx({
apiKey: process.env['AI_INBX_API_KEY'], // This is the default and can be omitted
});
const response = await client.threads.forward('threadId', { to: 'dev@stainless.com' });
console.log(response.emailId);import os
from aiinbx import AIInbx
client = AIInbx(
api_key=os.environ.get("AI_INBX_API_KEY"), # This is the default and can be omitted
)
response = client.threads.forward(
thread_id="threadId",
to="dev@stainless.com",
)
print(response.email_id)curl --request POST \
--url https://api.aiinbx.com/api/v1/threads/{threadId}/forward \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "jsmith@example.com",
"cc": "jsmith@example.com",
"bcc": "jsmith@example.com",
"note": "<string>",
"includeAttachments": true,
"from": "jsmith@example.com",
"from_name": "<string>",
"is_draft": false,
"attachments": [
{
"file_name": "<string>",
"content": "<string>",
"content_type": "<string>",
"cid": "<string>"
}
],
"track_opens": true,
"track_clicks": true
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aiinbx.com/api/v1/threads/{threadId}/forward",
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([
'to' => 'jsmith@example.com',
'cc' => 'jsmith@example.com',
'bcc' => 'jsmith@example.com',
'note' => '<string>',
'includeAttachments' => true,
'from' => 'jsmith@example.com',
'from_name' => '<string>',
'is_draft' => false,
'attachments' => [
[
'file_name' => '<string>',
'content' => '<string>',
'content_type' => '<string>',
'cid' => '<string>'
]
],
'track_opens' => true,
'track_clicks' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.aiinbx.com/api/v1/threads/{threadId}/forward"
payload := strings.NewReader("{\n \"to\": \"jsmith@example.com\",\n \"cc\": \"jsmith@example.com\",\n \"bcc\": \"jsmith@example.com\",\n \"note\": \"<string>\",\n \"includeAttachments\": true,\n \"from\": \"jsmith@example.com\",\n \"from_name\": \"<string>\",\n \"is_draft\": false,\n \"attachments\": [\n {\n \"file_name\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"cid\": \"<string>\"\n }\n ],\n \"track_opens\": true,\n \"track_clicks\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.aiinbx.com/api/v1/threads/{threadId}/forward")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"jsmith@example.com\",\n \"cc\": \"jsmith@example.com\",\n \"bcc\": \"jsmith@example.com\",\n \"note\": \"<string>\",\n \"includeAttachments\": true,\n \"from\": \"jsmith@example.com\",\n \"from_name\": \"<string>\",\n \"is_draft\": false,\n \"attachments\": [\n {\n \"file_name\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"cid\": \"<string>\"\n }\n ],\n \"track_opens\": true,\n \"track_clicks\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiinbx.com/api/v1/threads/{threadId}/forward")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": \"jsmith@example.com\",\n \"cc\": \"jsmith@example.com\",\n \"bcc\": \"jsmith@example.com\",\n \"note\": \"<string>\",\n \"includeAttachments\": true,\n \"from\": \"jsmith@example.com\",\n \"from_name\": \"<string>\",\n \"is_draft\": false,\n \"attachments\": [\n {\n \"file_name\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"cid\": \"<string>\"\n }\n ],\n \"track_opens\": true,\n \"track_clicks\": true\n}"
response = http.request(request)
puts response.read_body{
"emailId": "<string>",
"threadId": "<string>",
"messageId": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Threads
Forward a thread to email
Forward the entire thread as a readable transcript.
POST
/
threads
/
{threadId}
/
forward
JavaScript
import AIInbx from 'aiinbx';
const client = new AIInbx({
apiKey: process.env['AI_INBX_API_KEY'], // This is the default and can be omitted
});
const response = await client.threads.forward('threadId', { to: 'dev@stainless.com' });
console.log(response.emailId);import os
from aiinbx import AIInbx
client = AIInbx(
api_key=os.environ.get("AI_INBX_API_KEY"), # This is the default and can be omitted
)
response = client.threads.forward(
thread_id="threadId",
to="dev@stainless.com",
)
print(response.email_id)curl --request POST \
--url https://api.aiinbx.com/api/v1/threads/{threadId}/forward \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "jsmith@example.com",
"cc": "jsmith@example.com",
"bcc": "jsmith@example.com",
"note": "<string>",
"includeAttachments": true,
"from": "jsmith@example.com",
"from_name": "<string>",
"is_draft": false,
"attachments": [
{
"file_name": "<string>",
"content": "<string>",
"content_type": "<string>",
"cid": "<string>"
}
],
"track_opens": true,
"track_clicks": true
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aiinbx.com/api/v1/threads/{threadId}/forward",
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([
'to' => 'jsmith@example.com',
'cc' => 'jsmith@example.com',
'bcc' => 'jsmith@example.com',
'note' => '<string>',
'includeAttachments' => true,
'from' => 'jsmith@example.com',
'from_name' => '<string>',
'is_draft' => false,
'attachments' => [
[
'file_name' => '<string>',
'content' => '<string>',
'content_type' => '<string>',
'cid' => '<string>'
]
],
'track_opens' => true,
'track_clicks' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.aiinbx.com/api/v1/threads/{threadId}/forward"
payload := strings.NewReader("{\n \"to\": \"jsmith@example.com\",\n \"cc\": \"jsmith@example.com\",\n \"bcc\": \"jsmith@example.com\",\n \"note\": \"<string>\",\n \"includeAttachments\": true,\n \"from\": \"jsmith@example.com\",\n \"from_name\": \"<string>\",\n \"is_draft\": false,\n \"attachments\": [\n {\n \"file_name\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"cid\": \"<string>\"\n }\n ],\n \"track_opens\": true,\n \"track_clicks\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.aiinbx.com/api/v1/threads/{threadId}/forward")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"jsmith@example.com\",\n \"cc\": \"jsmith@example.com\",\n \"bcc\": \"jsmith@example.com\",\n \"note\": \"<string>\",\n \"includeAttachments\": true,\n \"from\": \"jsmith@example.com\",\n \"from_name\": \"<string>\",\n \"is_draft\": false,\n \"attachments\": [\n {\n \"file_name\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"cid\": \"<string>\"\n }\n ],\n \"track_opens\": true,\n \"track_clicks\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiinbx.com/api/v1/threads/{threadId}/forward")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": \"jsmith@example.com\",\n \"cc\": \"jsmith@example.com\",\n \"bcc\": \"jsmith@example.com\",\n \"note\": \"<string>\",\n \"includeAttachments\": true,\n \"from\": \"jsmith@example.com\",\n \"from_name\": \"<string>\",\n \"is_draft\": false,\n \"attachments\": [\n {\n \"file_name\": \"<string>\",\n \"content\": \"<string>\",\n \"content_type\": \"<string>\",\n \"cid\": \"<string>\"\n }\n ],\n \"track_opens\": true,\n \"track_clicks\": true\n}"
response = http.request(request)
puts response.read_body{
"emailId": "<string>",
"threadId": "<string>",
"messageId": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "UNAUTHORIZED",
"message": "Authorization not provided",
"issues": []
}{
"code": "FORBIDDEN",
"message": "Insufficient access",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Authorizations
API Key authentication using Bearer token
Path Parameters
The ID of the thread to forward
Body
application/json
Maximum string length:
2000Maximum string length:
320Show child attributes
Show child attributes
Was this page helpful?
⌘I