API reference

Every endpoint of the moderation API in one table, the fraud prevention routes, and the OpenAPI document.

The base URL is https://api.openshield.dev. Every endpoint except the last two of the table needs an API key. The fraud prevention API has its own routes. The complete description, with every field, is the OpenAPI 3.1 document: /docs/api/openapi.json.

Endpoints

Method and pathWhat it does
POST /v1/imageChecks an image sent as the raw body, or at a public url. See images.
POST /v1/textChecks a text sent as JSON. See texts.
GET /v1/workflowsLists the names and current versions of the workflows the key may use. See workflows.
POST /1.0/check-workflow.jsonChecks an image, SightEngine-compatible, as a multipart form. See migrating from SightEngine.
GET /1.0/check-workflow.jsonChecks an image by its url, SightEngine-compatible, with the key in the api_secret query parameter.
POST /1.0/text/check-workflow.jsonChecks a text, SightEngine-compatible, as a multipart form.
GET /health{"status": "ok"} when the service is ready, 503 otherwise. No key.
GET /openapi.jsonThe OpenAPI document of the running version. No key.

Fraud prevention endpoints

The fraud prevention API runs under /fraud/v1, with the same base URL and keys that carry fraud access: fraud_events for the reporting routes, fraud for all of them. Fraud prevention describes how to use it. The complete list, with its fields, is in the OpenAPI document.

Method and pathWhat it doesScope
POST /fraud/v1/decideDecides on an event before you act on it.fraud_events
POST /fraud/v1/eventsReports an event after the fact.fraud_events
POST /fraud/v1/events/batchReports up to 100 events at once.fraud_events
POST /fraud/v1/cases/{id}/appealPasses on an end user's appeal of a case.fraud_events
GET /fraud/v1/statements/{id}Reads the statement of reasons of a decision.fraud_events
GET /fraud/v1/actors/{id}, /clusterReads an account, and the accounts linked to it.fraud
POST /fraud/v1/actors/{id}/label, /status, /snoozesLabels an account, sets its status, silences a rule for it.fraud
DELETE /fraud/v1/actors/{id}/snoozes/{rule}Lifts a snooze.fraud
GET /fraud/v1/tenants/{id}, POST .../statusReads a workspace of your own users, and sets its status.fraud
GET /fraud/v1/cases, GET /fraud/v1/cases/{id}, POST /fraud/v1/cases/{id}/resolveLists, reads and resolves cases.fraud
GET /fraud/v1/subjects/{id}/export, DELETE /fraud/v1/subjects/{id}Exports, or erases, what is kept about a person.fraud
GET /fraud/v1/lists, GET, POST and DELETE /fraud/v1/lists/{name}/itemsLists your lists and fills them.fraud

Its errors are in responses and errors, its prices in limits and quotas.

Common to every endpoint

  • Authentication: Authorization: Bearer <key> or X-Api-Key: <key>. The compatible endpoints take the key in the api_secret form field.
  • Server-side only: a request that carries an Origin header is refused with 403 forbidden.
  • Errors: {"status": "failure", "error": {"type", "code", "message"}}. See responses and errors for every type.
  • Headers: X-Request-Id, RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset, X-Quota-Used, X-Quota-Limit, and Retry-After when you must wait.
  • Limits: see limits and quotas.

The OpenAPI document

curl https://api.openshield.dev/openapi.json

Use it to generate a client, to import the API into a tool such as Postman or Insomnia, or to give an AI agent the exact contract. The copy under /docs/api/openapi.json is published with each release of these docs.