API Usage
Once a resource is configured, it is automatically available under the API
prefix (/_ by default).
CRUD endpoints
All resources follow a standard REST pattern:
| Method | Endpoint | Description |
|---|---|---|
GET | /_ | List collection. |
GET | /_ | Show a single item. |
POST | /_ | Create a new item. Send a JSON body or multipart/ for file
uploads. |
PUT | /_ | Full update. All writable fields are expected. Use multipart/
when uploading files. |
PATCH | /_ | Partial update. Only submitted fields are updated. Existing file references are preserved when the upload field is omitted. |
DELETE | /_ | Delete an item. |
Response format
All responses use Hydra JSON-LD (application/).
Single item response
{
"@context": "http://www.w3.org/ns/hydra/context.jsonld",
"@type": "Article",
"@id": "/_api/articles/1",
"uid": 1,
"title": "Hello World"
}
Collection response
{
"@context": "http://www.w3.org/ns/hydra/context.jsonld",
"@type": "hydra:Collection",
"hydra:totalItems": 42,
"hydra:member": [
{
"@type": "Article",
"@id": "/_api/articles/1",
"uid": 1,
"title": "Hello World"
}
],
"hydra:view": {
"@type": "hydra:PartialCollectionView",
"hydra:first": "/_api/articles?page=1",
"hydra:last": "/_api/articles?page=3",
"hydra:next": "/_api/articles?page=2"
}
}
Pagination
Collections support offset-based pagination with Hydra Partial
links.
GET /_api/articles?page=2
GET /_api/articles?page=2&itemsPerPage=10
The response includes navigation links in the hydra: object
(hydra:, hydra:, hydra:, hydra:).
The default page size is controlled by:
- The resource's
itemssetting (per-resource override).Per Page - The site setting
tca_(global default, 20).api. default Items Per Page
Filtering
Filter parameters can be passed as plain top-level query parameters:
GET /_api/articles?title=Hello
GET /_api/articles?color_id=1
GET /_api/articles?categories=5
The legacy bracket notation is also accepted:
GET /_api/articles?filters[title]=Hello
GET /_api/articles?filters[price][gte]=10&filters[price][lte]=100
When both styles are present for the same column, the bracket form wins. Only columns declared as filters in the resource configuration are matched; other top-level parameters are ignored.
See Filters for the full list of filter strategies and configuration.
Sorting
Sorting is controlled via the order query parameter:
GET /_api/articles?order[title]=asc
GET /_api/articles?order[uid]=desc
See Sorting for configuration details.
Sparse fieldsets
Use the fields parameter to request only specific columns:
GET /_api/articles?fields[]=title&fields[]=uid
Only the requested fields (plus @id, @type, and uid) are included in
the response.
Virtual properties are addressed by their property name and are subject to the same filter — a virtual property that is not listed is neither serialized nor computed, so its processor or callback never runs:
GET /_api/news?fields[]=title&fields[]=url
Note
A virtual property whose callback reads other keys from the serialized row sees only the fields that were requested alongside it. Request its dependencies explicitly.
OpenAPI spec & Swagger UI
The extension generates a live OpenAPI 3.1.0 JSON spec from the registered resources and exposes two additional endpoints:
| Endpoint | Description |
|---|---|
{api | Machine-readable OpenAPI spec (e.g. /_). |
{api | Interactive Swagger UI (e.g. /_). |
Access to both endpoints is controlled by the tca_ and
tca_ site settings respectively. Both default to
PUBLIC.
Generating the spec on the command line
The spec only depends on the TCA, the resource configs and the site settings, so it can be written without a running site or a database, for example in a CI build stage that generates client types before anything is deployed:
vendor/bin/typo3 tca-api:openapi main --output openapi.json
The argument is the site identifier and may be omitted when there is only one
site. Without -- the spec is written to stdout. The output is the
same as the response of {api, independent of
tca_.
Backend module (TYPO3 v14+)
On TYPO3 v14 the extension registers a TCA API module under the
Integrations main module (alongside Reactions and Webhooks) that renders
the Swagger UI directly in the backend. It is available to administrators and is
always enabled — independent of the tca_,
tca_, and tca_ site settings that
gate the public frontend endpoints. The specification is built per site; when
more than one site is configured, a site selector is shown in the module's doc
header.
API Platform Admin
TCA_API is compatible with API Platform Admin out of the box. The extension emits the Hydra vocabulary that the admin's analyzer expects:
- Entrypoint (
{api) lists all resources as Hydra links.Prefix}/ - API documentation (
{api) describes supported classes, properties, and operations in Hydra class format.Prefix}/ docs. jsonld - Collection responses include a
hydra:block with an IRI template that advertises filter parameters using plain field names (e.g.search color_,id title), which the admin's analyzer maps directly to filter controls. - Relations are serialized as plain IRI strings, which API Platform Admin resolves automatically when navigating to a related record.
Point the admin at the entrypoint URL and it will discover resources, relations, and available filters without further configuration:
import { HydraAdmin } from "@api-platform/admin";
export default () => (
<HydraAdmin entrypoint="https://example.com/_api/" />
);
Bundled admin site set
The extension also ships a ready-made admin as a second site set,
maikschneider/. Adding it to a site turns that site's
pages into a React-based API Platform Admin wired to the configured
tca_:
dependencies:
- maikschneider/tca-api
- maikschneider/api-platform-admin
Warning
This bundled UI is intended for exploring an API during extension development, not for production use, and may be removed in a future release. It renders on every page of the site it is added to — use a dedicated site or a separate TYPO3 site configuration for it.
File uploads
Columns configured with an upload key accept files via
multipart/ on POST, PUT, and PATCH requests. See
File Uploads for a complete guide including request examples, the
upload config reference, validation error codes, and filename mask
placeholders.