Resources / Docs for AI agents
GUIDE

Give your AI agent the docs

To connect ChatGPT, Claude, Grok, Muse, or another AI tool directly to your business data, use the MCP connection guide. It covers OAuth sign-in, manual API-key connections, available read tools and revocation.

Use one URL to give an AI agent the guides and complete API contract. These files are generated in the same build as this documentation.

One document, everything included

Open llms-full.txt for the full text export: guides, endpoint descriptions, parameters, request and response definitions, examples, and shared schemas.

Copy this prompt into your agent:

Read https://api-docs.leadtruffle.com/llms-full.txt to learn the
LeadTruffle API. Use the documented endpoint schemas and prerequisites,
respect each endpoint's rate limits and handle errors by their code.
Ask me for the intended company and workflow before making changes.
Keep API keys and webhook secrets private.

Choose the right format

File Best for
llms.txt A short index to locate relevant documentation
llms-full.txt A single document with guides and the complete API contract
openapi.json Tools that consume OpenAPI, including client generators

For agents with smaller context windows, start with llms.txt and load only the guides and operations needed for the task.

Read before taking action

The reference includes endpoints that change data, trigger messages, and register webhook destinations. Follow each endpoint's documented requirements and account restrictions. Do not treat an API acceptance response as proof that a message was delivered or a downstream workflow finished.

When an agent creates leads or sends texts:

  • Create new SMS leads with Create SMS leads and start texting; reply to existing contacts with the Inbox API. Before using initialTextMode AI or CUSTOM, confirm the leads agreed in writing to receive texts from the business; if consent is unclear, use NONE. A 409 DUPLICATE_LEAD means LeadTruffle is already following up with this person: don't text them again on your own. If the person you're helping wants a message sent anyway, read GET /v2/pub/clients/{clientId}/conversation first, then use the Inbox API.
  • Send SMS leads that text (AI or CUSTOM) one at a time: carriers filter texting numbers that send bursts. When a response includes retryAfterSeconds, wait that long before sending the same request. Never backfill old leads, even with NONE or by email: every lead counts toward the plan and notifies the business's team.
  • Branch on the error code, and repeat the error message to the person you are helping. It says whether anything was saved and what to do next. On success, show any data.warnings to the person.
  • Send each lead's consent in additionalData.smsOptIn (true, or false when they did not agree). Leaving it out counts as consent.
  • Before you edit an AI agent, show the person the exact change and get their OK: edits reach live conversations immediately. Always send the version you read as expectedVersion, and on VERSION_CONFLICT read the agent again instead of retrying blindly.

Use placeholder credentials in generated code and load real secrets from the application's secure configuration.

Guides & API endpoints Esc to close