Skip to main content
Directus provides a comprehensive REST API that instantly layers on top of any SQL database. The API follows RESTful principles and returns JSON responses.

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 a data 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
See the Authentication page for details.

Query Parameters

Directus supports powerful query parameters for all collection endpoints:
Filter items using comparison operators:
Available operators: _eq, _neq, _lt, _lte, _gt, _gte, _in, _nin, _null, _nnull, _contains, _ncontains, _starts_with, _ends_with, _between, _nbetween
Sort results by one or more fields:
Prefix with - for descending order.
Control the number of items returned:
Request specific fields:
Full-text search across fields:
Get aggregate values:
Available functions: count, countDistinct, sum, sumDistinct, avg, avgDistinct, min, max

Rate Limiting

API requests are rate-limited to prevent abuse. Default limits:
  • 100 requests per second per IP
  • 1000 requests per minute per IP
Rate limit headers are included in responses:

Error Responses

Errors return appropriate HTTP status codes with a JSON error object:
Common status codes:
  • 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