Locales
Read supported BCP 47 locale tags and use them across localized content.
Cli Blog uses a curated catalog of Internet Engineering Task Force (IETF) BCP 47 locale tags. Read the catalog before accepting a locale in your integration, then store the canonical tag with each localized post, category, or tag.
Choose a surface
The locale catalog is available without authentication. Compare all Cli Blog tools.
| Action | HTTP API | Node SDK | CLI | Description |
|---|---|---|---|---|
| List | GET /v1/locales | blog.locales.list() | cli-blog locales list | Return every supported locale tag and display label |
Use the REST API
Call the resource from any technology that can send HTTP requests. Use a public key for allowed delivery reads and a private key for content changes.
GET https://api.cli-blog.com/v1/localesChoose an API keyUse the CLI
Use the CLI for local work, continuous integration, and JSON automation. Configure a narrowly scoped key before running content-changing commands.
cli-blog locales list --jsonRead the CLI guideUse the Node SDK
Use the Node SDK in Node.js 20+ servers, scripts, continuous integration, and trusted agent environments. Its methods map to the same resource actions.
await blog.locales.list()Read the Node SDK guideUse the agent skill
Give the agent the Cli Blog skill and a result-focused instruction. The skill helps it choose the API, CLI, or SDK and keeps publishing behind an approval gate.
List supported locales, then confirm whether es-MX is available before creating translated content.Install the agent skillList supported locales
Call the API directly without an x-api-key header:
curl "https://api.cli-blog.com/v1/locales"The HTTP response wraps the catalog in a list object:
{
"object": "list",
"data": [
{
"tag": "en-US",
"name": "English (United States)",
"language": "English",
"region": "United States"
},
{
"tag": "es-MX",
"name": "Spanish (Mexico)",
"language": "Spanish",
"region": "Mexico"
}
]
}The SDK returns the data array directly:
import { CliBlog } from "@cli-blog/node";
const blog = new CliBlog({
apiKey: process.env.CLI_BLOG_PUBLIC_API_KEY!,
apiUrl: "https://api.cli-blog.com",
});
const locales = await blog.locales.list();
const supportsSpanishMexico = locales.some(({ tag }) => tag === "es-MX");The SDK client requires a key at construction even though this route does not authenticate the request. The CLI also uses its configured client:
cli-blog locales list --jsonUse locale tags in content
Set locale on posts, categories, and tags. Omit it only when the organization's primary locale is the intended value.
Cli Blog does not fall back between locales in V1. A request for es-MX does not return en-US content when the Spanish variant is missing.
await blog.posts.create({
title: "Cómo publicamos notas de lanzamiento",
locale: "es-MX",
translation_of_id: "post_2f51de",
body_markdown: "## Un flujo repetible\n\nRedacta, revisa y publica.",
});Use translation_of_id when adding a localized post, category, or tag to an existing translation group. See Posts, Categories, and Tags.
Locale fields
| Field | Description |
|---|---|
tag | Canonical BCP 47 value used by content routes |
name | Human-readable locale name |
language | Language display name |
region | Region display name |
Common errors
| Status or symptom | Cause | Resolution |
|---|---|---|
400 on a content request | locale is outside the supported catalog | Select a tag returned by GET /v1/locales |
404 for a localized slug | That slug has no variant in the requested locale | Request the correct locale or create the translation |
| Empty localized list | No visible content exists in that locale | Publish content for the selected locale |
Complete API operation
The operation reference lists the full response schema and opens the unauthenticated request runner through Try it.
Returns the curated BCP 47 locale catalog supported by organization settings and localized content APIs.
Response Body
application/json
curl -X GET "https://example.com/v1/locales"{ "object": "list", "data": [ { "tag": "string", "name": "string", "language": "string", "region": "string" } ]}