# REST — the JSON-LD action endpoint

One data-plane endpoint. Wrap any Schema.org entity in CreateAction, SearchAction, FindAction, UpdateAction, or DeleteAction.

> HTML version: https://staging.agentdb.com/integrations/rest — this file (/docs/integrations/rest.md) is its markdown twin.

## One endpoint, five verbs

All tenant data flows through `POST /api/action` with a bearer JWT. The
action type is the verb; the `object` (or `query`) is the payload:

| Action         | Purpose                                                 |
| -------------- | ------------------------------------------------------- |
| `CreateAction` | Create or upsert an entity (idempotent on `identifier`) |
| `SearchAction` | Semantic + structured search                            |
| `FindAction`   | Exact lookup by `@id` or `identifier`                   |
| `UpdateAction` | Patch an existing entity                                |
| `DeleteAction` | Remove an entity                                        |

```jsonld
{
  "@context": "https://schema.org/",
  "@type": "SearchAction",
  "query": "first entity",
  "object": { "@type": "Product" }
}
```

Responses are JSON-LD too. `SearchAction` (and `AssessAction`) replies are
the completed action node — `actionStatus` plus a `result` carrying the
matches — while `CreateAction` and `FindAction` return the stored entity
itself. The exact shapes are in the
[contract](/start/contract).

The same contract is published as OpenAPI 3.1 at
[/api/openapi.json](/api/openapi.json) — one action contract, three
descriptions (JSON-LD `potentialAction`, OpenAPI,
[MCP](/integrations/mcp)), kept consistent by this site's CI.

## Rules that keep payloads valid

Use native Schema.org properties for data — the platform rejects
`additionalProperty` stuffing. If your domain needs controlled values,
define them once as a [vocab pack](/vocab) and every payload gets validated
against it.

## Actions declared on this page (JSON-LD)

```jsonld
[
  {
    "@type": "CreateAction",
    "name": "Create an entity",
    "target": {
      "@type": "EntryPoint",
      "urlTemplate": "https://staging-api.agentdb.com/api/action",
      "httpMethod": "POST",
      "contentType": "application/ld+json"
    },
    "object-input": {
      "@type": "PropertyValueSpecification",
      "valueName": "object",
      "valueRequired": true
    }
  }
]
```
