Import emails by domain
curl --request POST \
--url https://api.cx.stax.ai/clients/{client}/_import \
--header 'x-api-key: <api-key>'import requests
url = "https://api.cx.stax.ai/clients/{client}/_import"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.cx.stax.ai/clients/{client}/_import', 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.cx.stax.ai/clients/{client}/_import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.cx.stax.ai/clients/{client}/_import"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.cx.stax.ai/clients/{client}/_import")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cx.stax.ai/clients/{client}/_import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"messages": [
{
"_id": "<string>",
"attachments": [
{
"content_id": "<string>",
"file": "<string>",
"filename": "<string>",
"isInline": true,
"size": 123,
"source_id": "<string>",
"url": "<string>"
}
],
"bcc": "<string>",
"bookmark": true,
"brief": "<string>",
"cc": "<string>",
"checksum": "<string>",
"clients": [
"<string>"
],
"created_at": "<string>",
"date": "<string>",
"deleted_at": "<string>",
"domains": [
"<string>"
],
"draft": true,
"from": "<string>",
"html": "<string>",
"importance": 123,
"in_reply_to": "<string>",
"internal": true,
"message_folders": [
"<string>"
],
"outbox": true,
"private": true,
"read": "<string>",
"references": "<string>",
"reply": "<string>",
"requires_response": true,
"responses": [
"<string>"
],
"safe_for_everyone": true,
"schedule_id": "<string>",
"schedule_send_at": "<string>",
"secure": true,
"send_failed": true,
"send_scheduled": true,
"send_state": "<string>",
"sentiment": 123,
"source": "<string>",
"source_history_id": "<string>",
"source_id": "<string>",
"subject": "<string>",
"summary": [
"<string>"
],
"tags": [
"<string>"
],
"tasks": [
"<string>"
],
"team": "<string>",
"text": "<string>",
"thread": "<string>",
"to": "<string>",
"unique_key": "<string>",
"user": "<string>"
}
]
}{}{}clients
Import emails by domain
Import emails matching a domain and attach them to a client
POST
/
clients
/
{client}
/
_import
Import emails by domain
curl --request POST \
--url https://api.cx.stax.ai/clients/{client}/_import \
--header 'x-api-key: <api-key>'import requests
url = "https://api.cx.stax.ai/clients/{client}/_import"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.cx.stax.ai/clients/{client}/_import', 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.cx.stax.ai/clients/{client}/_import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.cx.stax.ai/clients/{client}/_import"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
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.cx.stax.ai/clients/{client}/_import")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cx.stax.ai/clients/{client}/_import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"messages": [
{
"_id": "<string>",
"attachments": [
{
"content_id": "<string>",
"file": "<string>",
"filename": "<string>",
"isInline": true,
"size": 123,
"source_id": "<string>",
"url": "<string>"
}
],
"bcc": "<string>",
"bookmark": true,
"brief": "<string>",
"cc": "<string>",
"checksum": "<string>",
"clients": [
"<string>"
],
"created_at": "<string>",
"date": "<string>",
"deleted_at": "<string>",
"domains": [
"<string>"
],
"draft": true,
"from": "<string>",
"html": "<string>",
"importance": 123,
"in_reply_to": "<string>",
"internal": true,
"message_folders": [
"<string>"
],
"outbox": true,
"private": true,
"read": "<string>",
"references": "<string>",
"reply": "<string>",
"requires_response": true,
"responses": [
"<string>"
],
"safe_for_everyone": true,
"schedule_id": "<string>",
"schedule_send_at": "<string>",
"secure": true,
"send_failed": true,
"send_scheduled": true,
"send_state": "<string>",
"sentiment": 123,
"source": "<string>",
"source_history_id": "<string>",
"source_id": "<string>",
"subject": "<string>",
"summary": [
"<string>"
],
"tags": [
"<string>"
],
"tasks": [
"<string>"
],
"team": "<string>",
"text": "<string>",
"thread": "<string>",
"to": "<string>",
"unique_key": "<string>",
"user": "<string>"
}
]
}{}{}