Api
Content Strings
API reference for content string endpoints.
Content Strings API
Content strings are key-value pairs for translatable text content.
List Content Strings
Fetch all content strings for a locale.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
locale | string | No | Locale code (defaults to workspace default) |
key | string | No | Fetch a specific key |
keys | string | No | Comma-separated list of keys |
Examples
Fetch all French content:
Response:
Fetch a single key:
Response:
Fetch multiple specific keys:
Response:
Preview Content
Fetch content strings including unpublished drafts. Useful for preview mode.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
locale | string | No | Locale code |
page | string | No | Page slug to filter content by |
Example
Response:
Best Practices
Caching
Content strings are static and cache well. Use ISR (Incremental Static Regeneration) or CDN caching:
Key Naming Conventions
Use dot notation for organizing keys:
Examples:
hero.titlehero.subtitlenav.homenav.aboutfooter.copyrightform.email.placeholderform.email.error
Fallback Values
Always provide fallback values in your code:
Or use the SDK's built-in fallback: