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.search();
console.log(response.pagination);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.search()
print(response.pagination)curl --request POST \
--url https://api.aiinbx.com/api/v1/threads/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"limit": 20,
"offset": 0,
"createdAfter": "<string>",
"createdBefore": "<string>",
"lastEmailAfter": "<string>",
"lastEmailBefore": "<string>",
"hasParticipantEmails": [
"jsmith@example.com"
],
"hasEmailFromAddress": "jsmith@example.com",
"hasEmailToAddress": "jsmith@example.com",
"subjectContains": "<string>",
"staleThresholdDays": 7,
"sortBy": "lastEmailAt",
"sortOrder": "desc"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aiinbx.com/api/v1/threads/search",
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([
'limit' => 20,
'offset' => 0,
'createdAfter' => '<string>',
'createdBefore' => '<string>',
'lastEmailAfter' => '<string>',
'lastEmailBefore' => '<string>',
'hasParticipantEmails' => [
'jsmith@example.com'
],
'hasEmailFromAddress' => 'jsmith@example.com',
'hasEmailToAddress' => 'jsmith@example.com',
'subjectContains' => '<string>',
'staleThresholdDays' => 7,
'sortBy' => 'lastEmailAt',
'sortOrder' => 'desc'
]),
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/search"
payload := strings.NewReader("{\n \"limit\": 20,\n \"offset\": 0,\n \"createdAfter\": \"<string>\",\n \"createdBefore\": \"<string>\",\n \"lastEmailAfter\": \"<string>\",\n \"lastEmailBefore\": \"<string>\",\n \"hasParticipantEmails\": [\n \"jsmith@example.com\"\n ],\n \"hasEmailFromAddress\": \"jsmith@example.com\",\n \"hasEmailToAddress\": \"jsmith@example.com\",\n \"subjectContains\": \"<string>\",\n \"staleThresholdDays\": 7,\n \"sortBy\": \"lastEmailAt\",\n \"sortOrder\": \"desc\"\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/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"limit\": 20,\n \"offset\": 0,\n \"createdAfter\": \"<string>\",\n \"createdBefore\": \"<string>\",\n \"lastEmailAfter\": \"<string>\",\n \"lastEmailBefore\": \"<string>\",\n \"hasParticipantEmails\": [\n \"jsmith@example.com\"\n ],\n \"hasEmailFromAddress\": \"jsmith@example.com\",\n \"hasEmailToAddress\": \"jsmith@example.com\",\n \"subjectContains\": \"<string>\",\n \"staleThresholdDays\": 7,\n \"sortBy\": \"lastEmailAt\",\n \"sortOrder\": \"desc\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiinbx.com/api/v1/threads/search")
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 \"limit\": 20,\n \"offset\": 0,\n \"createdAfter\": \"<string>\",\n \"createdBefore\": \"<string>\",\n \"lastEmailAfter\": \"<string>\",\n \"lastEmailBefore\": \"<string>\",\n \"hasParticipantEmails\": [\n \"jsmith@example.com\"\n ],\n \"hasEmailFromAddress\": \"jsmith@example.com\",\n \"hasEmailToAddress\": \"jsmith@example.com\",\n \"subjectContains\": \"<string>\",\n \"staleThresholdDays\": 7,\n \"sortBy\": \"lastEmailAt\",\n \"sortOrder\": \"desc\"\n}"
response = http.request(request)
puts response.read_body{
"threads": [
{
"id": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"subject": "<string>",
"snippet": "<string>",
"lastEmailAt": "<string>",
"participantEmails": [
"<string>"
],
"emailCount": 123
}
],
"pagination": {
"total": 123,
"limit": 123,
"offset": 123,
"hasMore": true
}
}{
"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
Search threads with filters
Search threads with various filtering options optimized for AI agents
POST
/
threads
/
search
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.search();
console.log(response.pagination);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.search()
print(response.pagination)curl --request POST \
--url https://api.aiinbx.com/api/v1/threads/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"limit": 20,
"offset": 0,
"createdAfter": "<string>",
"createdBefore": "<string>",
"lastEmailAfter": "<string>",
"lastEmailBefore": "<string>",
"hasParticipantEmails": [
"jsmith@example.com"
],
"hasEmailFromAddress": "jsmith@example.com",
"hasEmailToAddress": "jsmith@example.com",
"subjectContains": "<string>",
"staleThresholdDays": 7,
"sortBy": "lastEmailAt",
"sortOrder": "desc"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aiinbx.com/api/v1/threads/search",
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([
'limit' => 20,
'offset' => 0,
'createdAfter' => '<string>',
'createdBefore' => '<string>',
'lastEmailAfter' => '<string>',
'lastEmailBefore' => '<string>',
'hasParticipantEmails' => [
'jsmith@example.com'
],
'hasEmailFromAddress' => 'jsmith@example.com',
'hasEmailToAddress' => 'jsmith@example.com',
'subjectContains' => '<string>',
'staleThresholdDays' => 7,
'sortBy' => 'lastEmailAt',
'sortOrder' => 'desc'
]),
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/search"
payload := strings.NewReader("{\n \"limit\": 20,\n \"offset\": 0,\n \"createdAfter\": \"<string>\",\n \"createdBefore\": \"<string>\",\n \"lastEmailAfter\": \"<string>\",\n \"lastEmailBefore\": \"<string>\",\n \"hasParticipantEmails\": [\n \"jsmith@example.com\"\n ],\n \"hasEmailFromAddress\": \"jsmith@example.com\",\n \"hasEmailToAddress\": \"jsmith@example.com\",\n \"subjectContains\": \"<string>\",\n \"staleThresholdDays\": 7,\n \"sortBy\": \"lastEmailAt\",\n \"sortOrder\": \"desc\"\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/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"limit\": 20,\n \"offset\": 0,\n \"createdAfter\": \"<string>\",\n \"createdBefore\": \"<string>\",\n \"lastEmailAfter\": \"<string>\",\n \"lastEmailBefore\": \"<string>\",\n \"hasParticipantEmails\": [\n \"jsmith@example.com\"\n ],\n \"hasEmailFromAddress\": \"jsmith@example.com\",\n \"hasEmailToAddress\": \"jsmith@example.com\",\n \"subjectContains\": \"<string>\",\n \"staleThresholdDays\": 7,\n \"sortBy\": \"lastEmailAt\",\n \"sortOrder\": \"desc\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aiinbx.com/api/v1/threads/search")
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 \"limit\": 20,\n \"offset\": 0,\n \"createdAfter\": \"<string>\",\n \"createdBefore\": \"<string>\",\n \"lastEmailAfter\": \"<string>\",\n \"lastEmailBefore\": \"<string>\",\n \"hasParticipantEmails\": [\n \"jsmith@example.com\"\n ],\n \"hasEmailFromAddress\": \"jsmith@example.com\",\n \"hasEmailToAddress\": \"jsmith@example.com\",\n \"subjectContains\": \"<string>\",\n \"staleThresholdDays\": 7,\n \"sortBy\": \"lastEmailAt\",\n \"sortOrder\": \"desc\"\n}"
response = http.request(request)
puts response.read_body{
"threads": [
{
"id": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"subject": "<string>",
"snippet": "<string>",
"lastEmailAt": "<string>",
"participantEmails": [
"<string>"
],
"emailCount": 123
}
],
"pagination": {
"total": 123,
"limit": 123,
"offset": 123,
"hasMore": true
}
}{
"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
Body
application/json
Required range:
1 <= x <= 100Required range:
x >= 0Available options:
DRAFT, QUEUED, ACCEPTED, SENT, RECEIVED, FAILED, BOUNCED, COMPLAINED, REJECTED, READ, ARCHIVED Available options:
INBOUND, OUTBOUND Available options:
awaiting_reply, needs_reply, active, stale Required range:
1 <= x <= 365Available options:
createdAt, lastEmailAt, subject Available options:
asc, desc Was this page helpful?
⌘I