$ cli-blog docs

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.

ActionHTTP APINode SDKCLIDescription
ListGET /v1/localesblog.locales.list()cli-blog locales listReturn 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/locales
Choose an API key

Use 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 --json
Read the CLI guide

Use 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 guide

Use 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 skill

List 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 --json

Use 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

FieldDescription
tagCanonical BCP 47 value used by content routes
nameHuman-readable locale name
languageLanguage display name
regionRegion display name

Common errors

Status or symptomCauseResolution
400 on a content requestlocale is outside the supported catalogSelect a tag returned by GET /v1/locales
404 for a localized slugThat slug has no variant in the requested localeRequest the correct locale or create the translation
Empty localized listNo visible content exists in that localePublish 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.

Key type: No API key

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"    }  ]}

On this page