Label a batch of messages
POST
/api/v1/mailbox/ai/classifyClassifies up to 20 messages by subject and preview into a closed label vocabulary with a confidence per item. One batch costs one call against the monthly allowance; the response carries ai_calls_remaining.
Request body
Request
POST
/api/v1/mailbox/ai/classifycurl -X POST 'https://app.mailyte.com/api/v1/mailbox/ai/classify' \
-H 'Authorization: Bearer MAILBOX_TOKEN'const response = await fetch('https://app.mailyte.com/api/v1/mailbox/ai/classify', {
method: 'POST',
headers: {
Authorization: 'Bearer MAILBOX_TOKEN',
},
});
const { data } = await response.json();import requests
response = requests.post(
"https://app.mailyte.com/api/v1/mailbox/ai/classify",
headers={"Authorization": "Bearer MAILBOX_TOKEN"},
)
data = response.json()["data"]<?php
$response = Http::withToken('MAILBOX_TOKEN')
->post('https://app.mailyte.com/api/v1/mailbox/ai/classify');
$data = $response->json('data');require "net/http"
require "json"
uri = URI("https://app.mailyte.com/api/v1/mailbox/ai/classify")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer MAILBOX_TOKEN"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }Response
Successful Response
Returned inside the standard envelope.
Errors
| Status | When |
|---|---|
422 | Validation Error |
Every status, with what causes it and what to do, is on the error reference.