> ## Documentation Index
> Fetch the complete documentation index at: https://docs.salesgraph.com/llms.txt
> Use this file to discover all available pages before exploring further.

# REST API

> Call the same commands over plain HTTP, without MCP.

The same engine behind the MCP tools is also available as a small REST API under `/api/v1`. Use
it from any HTTP client when you don't want to run an MCP connection. Every endpoint uses the
same [API key authentication](/authentication). Command endpoints return **markdown**
(`Content-Type: text/markdown`), except errors, while OMS endpoints return JSON.

Base URL: `https://salesgraph.com`

## API inventory

All published REST endpoints below are standard Antinuous service interfaces. No
customer-specific custom APIs are published here.

| Method | Path | Classification | Purpose |
| - | - | - | - |
| `GET` | `/api/v1/commands` | Standard | Returns the command catalog. |
| `POST` | `/api/v1/commands/{command}` | Standard | Runs a command. |
| `GET` | `/api/v1/runs/{kind}/{id}` | Standard | Polls an async run. |
| `POST` | `/api/v1/audit` | Standard | Starts the org audit shortcut. |
| `GET` | `/api/v1/audit?id=<id>` | Standard | Polls an org audit by id. |
| `GET` | `/api/v1/oms/metadata` | Standard | Returns visible OMS metadata. |
| `POST` | `/api/v1/oms/search`, `/get`, `/pivot`, `/provenance` | Standard | Queries visible OMS data. |
| `GET`, `POST`, `DELETE` | `/api/v1/oms/watches` | Standard | Lists, creates, or cancels research watches. |
| `POST` | `/api/v1/oms/actions` | Standard | Requests an approved OMS action. |

## List commands

```http theme={null}
GET /api/v1/commands
```

Returns the markdown command catalog (same content as the [`help`](/tools/help) tool).

```bash theme={null}
curl -s https://salesgraph.com/api/v1/commands \
  -H "Authorization: Bearer $SALESGRAPH_API_KEY"
```

## Run a command

```http theme={null}
POST /api/v1/commands/{command}
```

`{command}` is one of `research`, `competitors`, `gtm-audit`, `audit`, `help`. Send the
command's arguments as a JSON body. Optionally include `userContext` (string) for extra context.

```bash theme={null}
curl -s https://salesgraph.com/api/v1/commands/research \
  -H "Authorization: Bearer $SALESGRAPH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "topic": "Stripe" }'
```

* **Sync commands** (`research`, `competitors`, `help`) return `200` with the markdown result.
* **Async commands** (`gtm-audit`, `audit`) return `202` with the run id in the `X-Run-Id` or
  `X-Audit-Id` header and `X-Run-Status: running`. Poll the run endpoint below.

| Status | Meaning |
| - | - |
| `200` | Sync result returned as markdown. |
| `202` | Async run started; poll for the result. |
| `400` | Invalid arguments. |
| `401` | Missing or invalid API key. |
| `404` | Unknown command. |
| `428` | Onboarding required — finish your org's sales profile. |
| `429` | Rate limited. |

## Poll a run

```http theme={null}
GET /api/v1/runs/{kind}/{id}
```

`{kind}` is `gtm-audit` or `audit`; `{id}` is the run id from the start response. Returns a
status markdown line while running, and the full result markdown once `completed`. The
`X-Run-Status` header carries the current status.

```bash theme={null}
curl -s https://salesgraph.com/api/v1/runs/gtm-audit/<id> \
  -H "Authorization: Bearer $SALESGRAPH_API_KEY"
```

Returns `404` if the id is unknown or belongs to another organization.

## Org audit shortcut

```http theme={null}
POST /api/v1/audit
```

Starts your org's audit. By default returns `202` with a run id to poll. Pass `{"wait": true}`
(or `?wait=true`) to block until the audit finishes and return the result inline — note this can
take several minutes and returns `504` if it exceeds the server timeout (the run keeps going;
poll its id). `GET /api/v1/audit?id=<id>` polls an existing org audit.

```bash theme={null}
curl -s -X POST "https://salesgraph.com/api/v1/audit?wait=true" \
  -H "Authorization: Bearer $SALESGRAPH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## OMS API

OMS endpoints return JSON. `metadata` is a `GET`; object reads use `POST` with the same object
`type` and public `key` used by MCP. `search` and `pivot` return
`{ "objects": [...], "nextPageToken": string | null }`; `get` returns one object; and
`provenance` returns `{ "properties": [...], "relationships": [...], "history": [...] }`.

```bash theme={null}
curl -s https://salesgraph.com/api/v1/oms/metadata \
  -H "Authorization: Bearer $SALESGRAPH_API_KEY"

curl -s https://salesgraph.com/api/v1/oms/get \
  -H "Authorization: Bearer $SALESGRAPH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "type": "Account", "key": "domain:acme.com" }'
```

### Research watches

`GET /api/v1/oms/watches` returns `{ "watches": [...], "nextCursor": string | null }`.
Pass `?id=<watch-id>` to fetch one, and `DELETE /api/v1/oms/watches?id=<watch-id>` to cancel it.
Create a watch with `POST /api/v1/oms/watches`:

```json theme={null}
{
  "target": { "type": "Account", "key": "domain:acme.com" },
  "query": "Acme funding and leadership changes",
  "purpose": "account intelligence",
  "idempotencyKey": "acme-news-v1",
  "frequency": "1d",
  "processor": "lite",
  "sourcePolicy": { "includeDomains": ["acme.com"] },
  "monthlyCostCapMicros": 3000
}
```

Frequencies are from `1h` through 30 days. `lite` watches require a cap of at least `3000`
micros and `base` watches require at least `10000`; either can be at most `100000000`.
`sourcePolicy` accepts up to 25 valid domains in each include or exclude list, and a domain may
not appear in both. A successful create, get, or cancel response is a JSON watch object with
`target: { "type", "key" }`, schedule fields, cost cap, status, and ISO timestamps.

`POST /api/v1/oms/actions` returns `202` and a JSON approval request. All OMS input, access, and
missing-resource errors use JSON `{ "error": "invalid_input" | "access_denied" | "not_found" }`.

<Note>
  For agent integrations, prefer the [MCP server](/quickstart) — it handles tool discovery and
  invocation for you. The REST API is here for simple scripts and non-MCP clients.
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.