Create an agent
const url = 'https://api.tryletterhead.com/api/v3/agents';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"api":true,"type":0,"name":"example","guidelines":"example","channels":["example"],"runMode":0,"frequency":{}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tryletterhead.com/api/v3/agents \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "api": true, "type": 0, "name": "example", "guidelines": "example", "channels": [ "example" ], "runMode": 0, "frequency": {} }'Create a new agent for the company.
Authorizations
Section titled βAuthorizations βRequest Body required
Section titled βRequest Body required βobject
Required. Set to true to authenticate with an API key.
Required. 0 for a Preflight agent, 2 for an Analyze agent. Analyze agents return a 403 when your company does not have Analyze agents turned on.
Example
0Up to 255 characters.
Instructions for the agent, up to 1,500 characters.
0 manual, 1 automatic, 2 on a schedule. Preflight agents can use 0 or 1. Analyze agents need 2 before they can be activated.
Not allowed for Preflight agents. Analyze agents need one before they can be activated. mode (0 or 1), daysOfWeek (values 0 to 6), dayOfMonth (1 to 28), time as H:i, and emailNotifications (up to 5).
object
Responses
Section titled β Responses β201 Created
object
object
How the agent runs: 0 manual, 1 automatic, 2 on a schedule.
The run schedule, or null when the agent has none. Includes mode, time, emailNotifications, and either daysOfWeek or dayOfMonth.
object
Validation status code for the agent. Defaults to 200.
Example
{ "items": { "uniqueId": "mofuehvagv", "name": "House style checker", "type": 0, "guidelines": "> Check the draft against our house style guide.\n> - Use the serial comma.\n> - Spell out numbers under 10; use numerals for 10 and above.\n> - Em dashes take no surrounding spaces.\n>\n> Flag every violation with the specific line it appears on.", "status": 0, "runMode": 0, "frequency": null, "validationCode": 200, "lastRunAt": null, "channels": [ "the-daily" ], "createdAt": "2026-04-11T10:05:33+00:00", "updatedAt": "2026-04-11T10:05:33+00:00" }, "message": "", "total": 10}Still can’t find what you need? Contact support.