/server/specs/openapi returns 404 on Directus 11.16.0

Hey guys!

I could really use your help, I am at my wits ent (and at my AI’s wits end, too).

I am unable to get the OpenAPI working.

Environment:

  • Directus Version: 11.16.0 (Dockerized)

  • Database: MySQL 8.4.8 (LTS)

  • Deployment: Docker Compose, Nginx Reverse Proxy (SSL via Certbot)

  • Node Version: (Inside container) 20.x/22.x (Standard Directus image)

The Issue: The OpenAPI specification endpoint (/server/specs/openapi and /server/specs/openapi.json) returns a 404 ROUTE_NOT_FOUND error. This persists even after confirming that all required environment variables are set and the database schema is healthy.

Confirmed Working:

  • GET /server/info and GET /server/health return 200 OK.

  • Standard data endpoints (e.g., GET /items/partners) return 200 OK with data.

  • Directus Admin App is fully functional.

  • The database connection is stable.

Troubleshooting Steps Taken:

  1. Environment Variables: Verified that API_SPEC_ENABLED="true" and PUBLIC_URL="https://api.rebernik.cz" are correctly passed to the container.

  2. Permissions: * Tested both with API_SPEC_ROLE="public" and without it (Admin only).

    • Confirmed that the Public role has “Read” permissions for all application collections and relevant system collections (Collections, Fields, Permissions, Policies).
  3. Database Health: * Initial WARN logs indicated a collation mismatch between system tables (utf8mb4_unicode_ci) and application tables (utf8mb4_0900_ai_ci).

    • Action taken: Manually converted all application tables to utf8mb4_unicode_ci to match Directus internal defaults.

    • Result: The startup warnings disappeared (INFO: Extensions loaded is clean), but the 404 error on /server/specs/openapi persists.

  4. Reverse Proxy: * Confirmed Nginx is passing headers correctly.

    • Tested direct internal requests (bypassing Nginx) with the same 404 result.
  5. Cache/Refresh: Attempted hard reloads and container restarts after each config change.

Observed Behavior: Even with no startup errors or warnings, the Directus internal router does not seem to register the /server/specs route. It acts as if the OpenAPI module is either disabled or failing silently during initialization.

Any ideas on what I should try next? :face_holding_back_tears:

Thank you,
Alena

Hey @digimagician, sorry to hear you were having issues but thank you for updating us with what was wrong once you’d gotten it working.

In the end, it was a different endpoint where the specs were: /server/specs/oas So now it is working