aethexDocs

API Reference

Reference links

Attach URLs to an agent and have them crawled into its knowledge base. Every endpoint here is scoped to one agent.

Base URL
https://api.aethexai.com/api/v1
Endpoints
9
Scopes
agents:readagents:write
POST/agents/:id/reference-links

Attach one or more URLs and queue their first crawl.

Attach reference links

Returns immediately with each link crawl_state = queued: a fifty-page crawl with embedding does not fit inside an HTTP request, and there is nothing to review until it has run. All or nothing. One bad URL rejects the whole request with a message naming it, rather than creating the others and leaving you to work out which ones landed.

Path & Query

1
  • idstringrequired

    The agent the link belongs to.

Request body

3

Errors

6
401Missing or invalid API key

The X-API-Key header was absent, malformed, or the key has been revoked.

Send a live key from your dashboard.

403Key lacks the required scope

Reading links needs agents:read; attaching, approving, accepting and deleting need agents:write.

Use a key that carries the scope, or add it to this one.

404Agent not found

No agent with that id exists on your account. Agents are scoped to the key's tenant, so another account's agent reads as absent.

Check the agent id.

409Link already attached

This agent already has a link for one of these URLs. Because URLs are normalised first, /docs and /docs?utm_source=x collide here.

The error names the URLs. Drop them from the request, or re-crawl the existing link instead.

422Malformed URL

A URL is not http/https, carries credentials, contains control characters, or exceeds 2048 characters. The same request also fails if it lists one page twice.

The message names the offending URL. Fix it and resend the whole list.

422Too many links

An agent can carry at most ten reference links, and the request would take it past that.

Delete links you no longer need, or split the pages across agents.

POST/agents/:id/reference-links/:link_id/approve

Put the link's pending pages into service, minus the ones you exclude.

Approve a link's pages

One endpoint rather than an approve and a reject pair: it mirrors what a reviewer does, untick then confirm, it is a single transaction, and it leaves no state where half the link is live. An excluded page becomes rejected and loses its chunks, so the index carries nothing that will never be served; the decision is remembered, and a later re-crawl re-proposes the page only if the site changed it.

Path & Query

2
  • idstringrequired

    The agent the link belongs to.

Request body

1
  • excludearrayoptional

    Page ids to turn down, from the preview endpoint. Omit or send an empty list to approve everything.

Errors

4
401Missing or invalid API key

The X-API-Key header was absent, malformed, or the key has been revoked.

Send a live key from your dashboard.

403Key lacks the required scope

Reading links needs agents:read; attaching, approving, accepting and deleting need agents:write.

Use a key that carries the scope, or add it to this one.

404Agent not found

No agent with that id exists on your account. Agents are scoped to the key's tenant, so another account's agent reads as absent.

Check the agent id.

404Reference link not found

No link with that id is attached to this agent.

List the agent's links and use an id from the response.

POST/agents/:id/reference-links/:link_id/pages/:doc_id/accept-candidate

Publish the extraction a re-crawl held back on one page.

Accept a held candidate

A re-crawl that comes back with a fraction of the text keeps serving what it had and stores the new extraction aside. This publishes it: the page is re-chunked and re-embedded, and it never leaves service while that happens. Its own route rather than a flag on approve, because approve is link-scoped and its exclude list means "turn this page down". A page left in would have to mean "replace what is live with this new text". There is deliberately no counterpart that dismisses a candidate: the hold says the source is serving a page that lost most of its text, which stays true until the site changes, and clears itself when it does.

Path & Query

3
  • idstringrequired

    The agent the link belongs to.

  • doc_idstringrequired

    The page, from the id returned by the preview endpoint.

Errors

6
401Missing or invalid API key

The X-API-Key header was absent, malformed, or the key has been revoked.

Send a live key from your dashboard.

403Key lacks the required scope

Reading links needs agents:read; attaching, approving, accepting and deleting need agents:write.

Use a key that carries the scope, or add it to this one.

404Agent not found

No agent with that id exists on your account. Agents are scoped to the key's tenant, so another account's agent reads as absent.

Check the agent id.

404Reference link not found

No link with that id is attached to this agent.

List the agent's links and use an id from the response.

404Page not found on this link

No page with that id belongs to this link.

Take the id from the preview endpoint.

409Nothing held for review

This page has no candidate. Either it never had one, or a later pass resolved it: a healthy re-crawl clears the hold on its own.

Re-read the preview: if candidate is null there is nothing to publish.

POST/agents/:id/reference-links/:link_id/recrawl

Run a pass now instead of waiting for the schedule.

Force a re-crawl

Returns the link as it stands, before the pass runs. The job id is deterministic, so pressing this while a pass is already queued or running collapses into that one rather than putting two crawls on the same pages.

Path & Query

2
  • idstringrequired

    The agent the link belongs to.

Errors

4
401Missing or invalid API key

The X-API-Key header was absent, malformed, or the key has been revoked.

Send a live key from your dashboard.

403Key lacks the required scope

Reading links needs agents:read; attaching, approving, accepting and deleting need agents:write.

Use a key that carries the scope, or add it to this one.

404Agent not found

No agent with that id exists on your account. Agents are scoped to the key's tenant, so another account's agent reads as absent.

Check the agent id.

404Reference link not found

No link with that id is attached to this agent.

List the agent's links and use an id from the response.