sourcebroker / t3api
REST API for your TYPO3 project. Config with annotations, build in filtering, pagination, typolinks, image processing, serialization contexts, responses in Hydra/JSON-LD format.
Requires
- php: ^8.1.0
- ext-json: *
- ext-pdo: *
- ext-tokenizer: *
- doctrine/annotations: ^1.13.3 || ^2.0
- jms/serializer: ^3.1
- phpdocumentor/reflection-docblock: ^5.2 || ^6.0
- symfony/cache: ^6.4 || ^7.0
- symfony/expression-language: ^6.4 || ^7.0
- symfony/http-foundation: ^6.4 || ^7.0
- symfony/mime: ^6.4 || ^7.0
- symfony/property-info: ^6.4 || ^7.0
- symfony/psr-http-message-bridge: ^6.4 || ^7.0
- symfony/routing: ^6.4 || ^7.0
- typo3/cms-core: ^12.4.18 || ^13.3 || ^14.0
- typo3/cms-extbase: ^12.4.18 || ^13.3 || ^14.0
- typo3/cms-frontend: ^12.4.18 || ^13.3 || ^14.0
Requires (Dev)
- composer/class-map-generator: ^1.7
- ergebnis/composer-normalize: ^2.47.0
- friendsofphp/php-cs-fixer: ^3.75.0
- phpstan/extension-installer: ^1.2.0
- phpstan/phpstan: ^1.12.26 || ^2.1
- saschaegerer/phpstan-typo3: ~1.10.2 || ^3.0
- seld/jsonlint: ^1.11.0
- symfony/yaml: ^6.0 || ^7.0
- typo3/cms-install: ^12.4.18 || ^13.3 || ^14.0
- typo3/coding-standards: ^0.8
- typo3/testing-framework: ^8.2.1 || ^9.5
Suggests
None
Provides
None
Conflicts
None
Replaces
- typo3-ter/t3api: 5.0.0
- dev-main
- 5.0.0
- 4.1.3
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.x-dev
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.0
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.9.0
- 0.8.0
- 0.7.1
- 0.7.0
- 0.6
- 0.5.1
- 0.5.0
- 0.4.0
- 0.3.0
- 0.2.0
- 0.1.0
- dev-task/readme-version-support
- dev-release/5.0.0
This package is auto-updated.
Last update: 2026-12-02 13:26:21 UTC
README
REST API for Extbase models. Resources, operations and filters are configured with annotations on the model class (or on a class extending a model of another extension), output with serializer metadata in annotations or YAML. Configuration options follow API Platform, responses use JSON-LD / Hydra format.
Features
Resources and operations
GET,POST,PATCH,PUTandDELETEoperations for Extbase models.- Configurable routing and base path of the API.
- Cascade persistence of relations, including inline (IRRE) relations.
- Slug fields generated according to TCA configuration.
- Multilanguage support (language prefix in URL or
X-Localeheader).
Collections
- Built-in filters: boolean, numeric, uid, contain, order, range, distance and search (partial, match against and exact strategies).
- Ordered UIDs filter and query modifiers - collections in externally resolved order (e.g. from a search engine).
- Pagination.
Output
- Serialization contexts (groups) - different output for every operation.
- Serializer metadata in annotations or YAML, custom handlers and subscribers.
- Typolinks, processed images and file references.
- File upload to FAL.
Access and HTTP
- Access control of operations and filters with expressions (
security,security_post_denormalize). - CORS configuration.
- Opt-in response cache with automatic tag-based invalidation.
Developer tools
- OpenAPI specification and backend module with Swagger UI for documentation and testing of the API.
- Events to customize processing of operations.
Quick start
composer require sourcebroker/t3api
Add the route enhancer to the config.yaml of your site:
imports: - { resource: "EXT:t3api/Configuration/Routing/config.yaml" }
Make an API resource from an Extbase model:
use SourceBroker\T3api\Annotation\ApiResource; /** * @ApiResource( * collectionOperations={ * "get"={"path"="/items"}, * }, * itemOperations={ * "get"={"path"="/items/{id}"}, * }, * ) */ class Item extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity { }
After flushing caches the items are available under https://example.com/_api/items and
https://example.com/_api/items/1.
Documentation
https://docs.typo3.org/p/sourcebroker/t3api/main/en-us/
Local test instance
After cloning the repository run:
ddev restart && ddev composer install
ddev ci 14
It installs a TYPO3 14 instance at https://14.t3api.ddev.site/ (backend login admin / Password1!) with
EXT:news records exposed as API resources, e.g.:
- https://14.t3api.ddev.site/_api/
- https://14.t3api.ddev.site/_api/news/news
- https://14.t3api.ddev.site/_api/news/news/1
- https://14.t3api.ddev.site/_api/news/categories
Run the Postman tests (full CRUD of news and categories, including image upload) with
ddev composer ci:tests:postman, or the full test suite with ddev composer ci.
Development
See https://docs.typo3.org/p/sourcebroker/t3api/main/en-us/Miscellaneous/Development/Index.html
Version support
| t3api | TYPO3 | PHP | Support |
|---|---|---|---|
| 5.x | 12.4, 13.4, 14 | 8.1 - 8.5 | Features, bugfixes, security |
| 4.x | 12.4, 13.4 | 8.1 - 8.3 | None |
| 3.x | 12.4 | 8.1 - 8.3 | None |
| 2.x | 10.4, 11.5 | 7.2 - 8.1 | None |
| 1.x | 8.7 - 10.4 | 7.2 - 7.4 | None |
Only the latest major version is supported. Versions 4.x and below receive no further releases - 5.x supports all TYPO3 versions of 4.x, see the changelog for breaking changes.