Guide

Call AI read tools over REST

The AI assistant's read tools (lookups, reports) can be called directly with an API key, no MCP server needed. Good for scripts, spreadsheets and automations.

  1. 1Create an API key

    The key needs at least one permission of the tool's module. Tools run with the permissions of the key's creator: whatever that person cannot see, the key cannot see either.

    API keys →

  2. 2Pick a tool

    Open the AI tools catalog, pick a module and read its parameters. Only Read tools can be called over REST.

    AI tools →

  3. 3Call it

    The request body is the tool's parameters as-is (not wrapped in args). The response is the tool's JSON result.

    curl
    curl -X POST https://api.nextx.vn/api/v1/ai/tools/crm/crm_appointments_query/read \
      -H "X-Api-Key: $API_KEY" -H "Content-Type: application/json" \
      -d '{"op":"group","groupBy":"status"}'

    crm_appointments_query →

  4. 4Handle errors

    401 wrong or revoked key · 403 key lacks the module permission · 404 no such tool · 429 over the limit, read Retry-After.

    Error codes →Rate limit →