Call a tool

The two addresses every API call uses, the request and answer shapes, and the rules every action shares.

Reference

At a glance

MethodAddressWhat it does
GEThttps://app.alchex.com/api/v1/toolsLists the actions this key may call
POSThttps://app.alchex.com/api/v1/tools/<tool>/<action>Calls one action
  • Send the body as JSON with Content-Type: application/json. An action with no input takes an empty body.
  • A field the action does not know is refused with 400 invalid_body, not ignored, so a typo shows in your log.
  • A body over 200 KB is refused with 413 body_too_large.

List what a key may call

bash
curl https://app.alchex.com/api/v1/tools \  -H "Authorization: Bearer EXAMPLE_API_KEY"
json
{  "tools": [    {      "name": "read_document",      "actions": [        {          "name": "rows",          "method": "POST",          "path": "/api/v1/tools/read_document/rows",          "permissions": ["registers:rows:read"],          "input": { "type": "object", "properties": { "register": { "type": "string" } } }        }      ]    }  ]}

The answer names only the actions this key's permissions open. permissions lists the permissions that would each open the action. input is the full JSON Schema of the body; it is shortened here. This request is free and does not count toward the rate limit.

Call an action

bash
curl -X POST https://app.alchex.com/api/v1/tools/write_record/change \  -H "Authorization: Bearer EXAMPLE_API_KEY" \  -H "Content-Type: application/json" \  -d '{ "register": "Suppliers", "rowId": "ROW_ID", "cells": { "Risk": "Low" } }'

A read answers 200 with the data it found. A write answers with a message that says what changed, and a link where there is one. The link is a path in Alchex: put https://app.alchex.com in front to open it.

json
{ "rowId": "ROW_ID", "message": "…", "link": "/app/governance/sheets/…" }

Adding rows answers 201. Every error has the same shape; see Errors.

Every action

ToolActionsReference
read_documentlist_registers, list_columns, rows, record, changes, search, document, readiness, evidenceread_document
write_recordadd, change, delete, change_findingRows, write_record
write_projectadd_project, change_projectwrite_project
write_documentcreate, edit, comment, archive, send_for_approvalwrite_document
write_foldercreate, update, file, deletewrite_folder

The action must match the body

The body must be the action you call. Sending "status": "Archived" to write_document/edit, for example, is refused with 403 not_allowed_for_api_key. Nothing is changed.