Skip to content

REST API

BraDypUS exposes a read-only public REST API that allows external applications to query records without a full authentication session.

Authentication

Two authentication methods are supported:

An API key is a long random token that acts like a service account. Keys are managed by admins in Config → API Keys.

Pass the key in the Authorization header:

Authorization: Bearer bdus_<key>

Each key has a maximum privilege level. A key with privilege 30 (reader) can only read data; a key with privilege 20 (editor) can also write.

JWT (user session)

The same JWT issued at login can be used in API calls:

Authorization: Bearer <jwt_token>

Base URL

All API endpoints are under /api/. The application name is NOT part of the path (unlike older v3/v4 versions). The active app is determined from the token.

Listing records

GET /api/records/{table}

Returns a paginated JSON response:

json
{
  "status": "success",
  "total": 42,
  "fields": [{"name": "sigla", "label": "Sigla"}, ...],
  "data": [{"id": 1, "sigla": "US001", ...}, ...]
}

Pagination parameters

ParameterDefaultDescription
page1Page number
per_page30Records per page (max 200)
sort_fieldColumn to sort by
sort_dirascasc or desc

Filtering records

Use the Directus-style filter parameter. It accepts either bracket notation (GET-friendly) or a JSON body (POST).

Bracket notation (GET)

GET /api/records/us?filter[periodo][_eq]=Basso+Medioevo

Multiple conditions:

GET /api/records/us?filter[periodo][_eq]=Basso+Medioevo&filter[sigla][_icontains]=US

JSON body (POST)

http
POST /api/records/us
Content-Type: application/json

{
  "filter": {
    "periodo": { "_eq": "Basso Medioevo" },
    "sigla":   { "_icontains": "US" }
  }
}

Multiple conditions are joined with AND by default. For OR:

json
{
  "filter": {
    "_or": [
      { "periodo": { "_eq": "Basso Medioevo" } },
      { "periodo": { "_eq": "Alto Medioevo"  } }
    ]
  }
}

Filter operators

OperatorMeaning
_eqEqual
_neqNot equal
_icontainsCase-insensitive contains
_ncontainsDoes not contain
_starts_withStarts with
_ends_withEnds with
_gtGreater than
_ltLess than
_gteGreater than or equal
_lteLess than or equal
_emptyIs NULL or empty string
_nemptyIs not NULL and not empty
_inValue is in the list
_ninValue is not in the list

Reading a single record

GET /api/record/{table}/{id}

Returns the full record with all fields, plugin sub-tables, file list, and associated RS data.

Interactive API reference

See the API Reference section for an interactive OpenAPI explorer with all available endpoints.