System Information
- Strapi Version:
- Operating System:
- Database:
- Node Version:
- NPM Version:
- Yarn Version:
Environment
• Strapi Version: 5.8
• Database: PostgreSQL
• OS: macOS 23.4.0
Issue (only after migration to 5)
When creating a booking via the REST API with related entities (units, users), we get:
“Document with id [X], locale ‘null’ not found”
Despite:
Related entities existing in the database
Locale explicitly set (locale = ‘en’)
Locale included in the request
Repro Steps
1. Enable localization in Strapi 5
2. Ensure related entities have locale = ‘en’
3. Send a booking creation request via API
Example Request
curl -X POST ‘https://your-strapi-url/api/bookings’
-H ‘Content-Type: application/json’
-H ‘Authorization: Bearer [token]’
-d ‘{
“data”: {
“locale”: “en”,
“startDate”: “2025-01-30”,
“endDate”: “2025-01-31”,
“units”: { “connect”: [“unit_id”] },
“users_permissions_user”: { “connect”: [“user_id”] }
}
}’
What We’ve Tried
• Different relation formats (IDs, Objects)
• Verified locale settings in DB
• Explicitly adding locale in request
Error Response
{
“error”: {
“status”: 400,
“message”: “Document with id "[ID]", locale "null" not found”
}
}
Questions
1. Is this a known issue with relations in Strapi 5?
2. Are there undocumented locale-handling rules?
3. Any workarounds or fixes?
Impact: API-based booking creation fails, forcing manual input via the admin panel. Any insights appreciated!