Directus provides a comprehensive REST API that instantly layers on top of any SQL database. The API follows RESTful principles and returns JSON responses.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/directus/directus/llms.txt
Use this file to discover all available pages before exploring further.
Base URL
All API requests should be made to:API Versioning
The Directus API does not use versioning in the URL. The platform maintains backward compatibility and uses a rolling release cycle.Response Format
All successful responses return a JSON object with adata property:
HTTP Methods
The API uses standard HTTP methods:- GET - Retrieve resources
- POST - Create new resources
- PATCH - Update existing resources
- DELETE - Delete resources
Authentication
The API supports multiple authentication methods:- Static Tokens - For server-to-server communication
- Temporary Tokens - JWT tokens from login
- SSO - OAuth, OpenID, SAML, LDAP
Query Parameters
Directus supports powerful query parameters for all collection endpoints:Filtering
Filtering
Filter items using comparison operators:Available operators:
_eq, _neq, _lt, _lte, _gt, _gte, _in, _nin, _null, _nnull, _contains, _ncontains, _starts_with, _ends_with, _between, _nbetweenSorting
Sorting
Sort results by one or more fields:Prefix with
- for descending order.Limiting & Pagination
Limiting & Pagination
Control the number of items returned:
Field Selection
Field Selection
Request specific fields:
Search
Search
Full-text search across fields:
Aggregation
Aggregation
Get aggregate values:Available functions:
count, countDistinct, sum, sumDistinct, avg, avgDistinct, min, maxRate Limiting
API requests are rate-limited to prevent abuse. Default limits:- 100 requests per second per IP
- 1000 requests per minute per IP
Error Responses
Errors return appropriate HTTP status codes with a JSON error object:- 400 - Bad Request (invalid syntax)
- 401 - Unauthorized (authentication required)
- 403 - Forbidden (insufficient permissions)
- 404 - Not Found
- 422 - Unprocessable Entity (validation errors)
- 500 - Internal Server Error
CORS
CORS can be configured via environment variables:Next Steps
Authentication
Learn about authentication methods
Items
Work with collection items
Files
Manage files and assets
Users
Manage users and authentication