Call the REST API#

The REST API is versioned under /v1 and described by an OpenAPI document. Every capability guide lists its routes.

Prerequisites#

  • A server URL, such as https://geonemo.example.com.

  • An API token: an API personal token, or the access token from geonemo login (Sign in and tokens).

Steps#

  1. Put the token in a shell variable, then call discovery to list the capabilities and endpoints the server advertises:

    export TOKEN=<token>
    curl -H "Authorization: Bearer $TOKEN" \
      https://geonemo.example.com/v1/discovery
    
  2. Send the headers on every request:

    Header

    Value

    Authorization

    Bearer <token>

    X-GeoNemo-Project-ID

    Your project, default default

    Idempotency-Key

    1 to 256 visible ASCII characters, on operations that create work

  3. Read the response. Errors carry a JSON body {"detail": ...}.

Conventions#

Topic

Behavior

Base path

/v1/...; discovery’s endpoints.api is /v1

Health

GET /v1/health/live and /v1/health/ready need no token

Reads

GET, plus search-style POST routes (/search, /query, /scan, /window) need services:read

Changes

Other POST, PUT, PATCH, DELETE need tools:execute, or gkb:publish under /v1/gkb

Paging

Responses return next_cursor (or next_after); send it back as cursor (or after) until it is null

Feeds

after and limit read event feeds; HTTP 410 means the position expired

Idempotency

Repeating a key with the same request returns the first result; a different request with the same key returns 409

Status codes: 401 for a missing or invalid token, 403 for a missing scope, 404 for an unknown resource, 409 for a conflict, 422 for an invalid request.

OpenAPI#

Source

Where

Running server

GET /openapi.json (needs a token), interactive page at /docs

Repository

contracts/openapi/v1.json for the combined contract, core-v1.json for the Toolkit alone

Generate a client from either file with your usual tool.

Result#

You can call any route from any HTTP client. See REST API for every operation, grouped by tag.