Skip to content

HTTP API

Overview

The HTTP API of a Sergo install. Call it with an agent key or a personal key, made under Agent keys in the console. Agent keys also work over MCP.

Address

Paths start at the address of your console: https://sergo.example.com/v1/search.

Keys

Send the key with every call, in the Authorization header:

Authorization: Bearer sgk_s_…
  • An agent key (sgk_s_…) reads the folders and files it was given.
  • A personal key reads what its owner can read. sgk_u_… only reads; sgk_uw_… can also upload.

A call sees only what its key can read. Anything else answers 404, the same as something that doesn’t exist.

Who is asking

If your agent answers other people, add X-Sergo-End-User: <their name or id>. It is written to the audit log and changes nothing else.

Errors

Errors are JSON with a code and a message:

{"code": "unknown_key", "message": "No such key"}
Status Meaning
401 The key is wrong, was revoked, or is an old value that has stopped working.
404 It doesn’t exist, or the key can’t read it.
422 The request is wrong. code says how, such as read_only_key or invalid_request.
429 Too many requests. Wait the number of seconds in Retry-After.

Information

  • OpenAPI version: 3.1.0

An agent key (sgk_s_…) or a personal key (sgk_u_…, sgk_uw_…)

Security scheme type: http