Parallèle Docs
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.

GET /api/public/content

Query Parameters

ParameterTypeRequiredDescription
localestringNoLocale code (defaults to workspace default)
keystringNoFetch a specific key
keysstringNoComma-separated list of keys

Examples

Fetch all French content:

curl "https://parallele.ai/api/public/content?locale=fr" \
  -H "x-api-key: prl_xxx"

Response:

{
  "locale": "fr",
  "content": {
    "hero.title": "Bienvenue",
    "hero.subtitle": "Construisez plus vite",
    "cta.button": "Commencer",
    "footer.copyright": "© 2025 Mon Site"
  },
  "count": 4
}

Fetch a single key:

curl "https://parallele.ai/api/public/content?locale=en&key=hero.title" \
  -H "x-api-key: prl_xxx"

Response:

{
  "key": "hero.title",
  "value": "Welcome",
  "locale": "en"
}

Fetch multiple specific keys:

curl "https://parallele.ai/api/public/content?locale=en&keys=hero.title,hero.subtitle,cta.button" \
  -H "x-api-key: prl_xxx"

Response:

{
  "locale": "en",
  "content": {
    "hero.title": "Welcome",
    "hero.subtitle": "Build faster",
    "cta.button": "Get Started"
  },
  "count": 3
}

Preview Content

Fetch content strings including unpublished drafts. Useful for preview mode.

GET /api/public/content/preview

Query Parameters

ParameterTypeRequiredDescription
localestringNoLocale code
pagestringNoPage slug to filter content by

Example

curl "https://parallele.ai/api/public/content/preview?locale=fr&page=home" \
  -H "x-api-key: prl_xxx"

Response:

{
  "locale": "fr",
  "page": "home",
  "content": {
    "hero.title": "Nouveau titre (brouillon)",
    "hero.subtitle": "Sous-titre en cours de modification"
  },
  "count": 2
}

Best Practices

Caching

Content strings are static and cache well. Use ISR (Incremental Static Regeneration) or CDN caching:

// Next.js App Router
export const revalidate = 60; // Revalidate every 60 seconds
 
export default async function Page() {
  const content = await parallele.getContent("en");
  // ...
}

Key Naming Conventions

Use dot notation for organizing keys:

section.element.variant

Examples:

  • hero.title
  • hero.subtitle
  • nav.home
  • nav.about
  • footer.copyright
  • form.email.placeholder
  • form.email.error

Fallback Values

Always provide fallback values in your code:

const title = content["hero.title"] || "Default Title";

Or use the SDK's built-in fallback:

const title = parallele.getString("hero.title", { fallback: "Default Title" });

On this page