Locales

Authentication: JWT | API Key

Locales enable multilingual content management in FoxNose. Each environment can define multiple locales (subject to your plan’s locale quota) and exactly one default locale that represents the base language for content. For a comprehensive overview of localization concepts, see the Localization Guide.

Path Parameters

  • Name
    :env
    Type
    string
    Description

    Unique identifier of the environment

  • Name
    :code
    Type
    string
    Description

    Unique code of the locale (e.g., "en", "fr", "en_US")


Locale Object

  • Name
    name
    Type
    string
    Description

    Display name of the locale for easier identification in interfaces.

  • Name
    code
    Type
    string
    Description

    Unique locale identifier used throughout the API. Examples: "en", "en_US", "fr", "es".

  • Name
    environment
    Type
    string
    Description

    The environment identifier this locale belongs to.

  • Name
    is_default
    Type
    bool
    Description

    Whether this locale is the default for the environment. Only one locale can be set as default per environment.

  • Name
    created_at
    Type
    datetime
    Description

    Timestamp when the locale was created.


POSTapi.foxnose.net/v1/:env/locales/

Create Locale

Creates a new locale in the specified environment. Each locale must have a unique code within the environment, and the total number of locales cannot exceed the limit set by your plan.

Success Response: 201 Created

Attributes

  • Name
    name
    Type
    string
    Required
    required
    Description

    Locale display name

    • Minimum length: 1
    • Maximum length: 100
  • Name
    code
    Type
    string
    Required
    required
    Description

    Locale code

    • Minimum length: 1, maximum length: 50
    • Letters only or letters separated by underscores (for example en or en_US)
    • Must be unique within the environment
  • Name
    is_default
    Type
    bool
    Default
    default:false
    Description

    Set as default locale for the environment

Errors

  • Name
    401 Unauthorized
    Description

    Authentication credentials are missing or invalid.

    • authentication_failed - authentication credentials were not provided or are invalid
  • Name
    403 Forbidden
    Description

    Insufficient permissions to create locales.

    • permission_denied - insufficient permissions to perform this action
  • Name
    404 Not Found
    Description

    The specified environment could not be found.

    • environment_not_found - the specified environment does not exist
  • Name
    422 Unprocessable Content
    Description

    Validation or business logic error. Specific codes:

    • validation_error - validation errors in request data
    • locale_already_exists - a locale with the same code already exists in this environment
    • too_many_locales - the environment already has the maximum number of locales allowed by your plan

Request

POST
/v1/:env/locales/
curl https://api.foxnose.net/v1/7c9h4pwu/locales/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiI..." \
-H "Content-Type: application/json" \
-d '{
    "name": "Français",
    "code": "fr",
    "is_default": false
}'

Response

{
    "name": "Français",
    "code": "fr",
    "environment": "7c9h4pwu",
    "created_at": "2024-09-29T03:49:07.859748-05:00",
    "is_default": false
}

GETapi.foxnose.net/v1/:env/locales/

List All Locales

Retrieves all locales within the specified environment. The response is not paginated.

Success Response: 200 OK

Errors

  • Name
    401 Unauthorized
    Description

    Authentication credentials are missing or invalid.

    • authentication_failed - authentication credentials were not provided or are invalid
  • Name
    403 Forbidden
    Description

    Insufficient permissions to view locales.

    • permission_denied - insufficient permissions to perform this action
  • Name
    404 Not Found
    Description

    The specified environment could not be found.

    • environment_not_found - the specified environment does not exist

Request

GET
/v1/:env/locales/
curl https://api.foxnose.net/v1/7c9h4pwu/locales/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiI..." \
-H "Content-Type: application/json"

Response

[
    {
        "name": "English",
        "code": "en_US",
        "environment": "7c9h4pwu",
        "created_at": "2024-08-02T15:10:47.867952-05:00",
        "is_default": true
    },
    {
        "name": "Français",
        "code": "fr",
        "environment": "7c9h4pwu",
        "created_at": "2024-09-29T03:49:07.859748-05:00",
        "is_default": false
    }
]

GETapi.foxnose.net/v1/:env/locales/:code/

Retrieve Locale

Retrieves details of a specific locale by its code.

Success Response: 200 OK

Errors

  • Name
    401 Unauthorized
    Description

    Authentication credentials are missing or invalid.

    • authentication_failed - authentication credentials were not provided or are invalid
  • Name
    403 Forbidden
    Description

    Insufficient permissions to view this locale.

    • permission_denied - insufficient permissions to perform this action
  • Name
    404 Not Found
    Description

    The specified resource could not be found. Specific codes:

    • environment_not_found - the specified environment does not exist
    • locale_not_found - the specified locale does not exist

Request

GET
/v1/:env/locales/:code/
curl https://api.foxnose.net/v1/7c9h4pwu/locales/fr/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiI..." \
-H "Content-Type: application/json"

Response

{
    "name": "Français",
    "code": "fr",
    "environment": "7c9h4pwu",
    "created_at": "2024-09-29T03:49:07.859748-05:00",
    "is_default": false
}

PUTapi.foxnose.net/v1/:env/locales/:code/

Update Locale

Updates the attributes of a specific locale.

Success Response: 200 OK

Attributes

  • Name
    name
    Type
    string
    Description

    Locale display name (same constraints as creation)

  • Name
    code
    Type
    string
    Description

    Locale code (same constraints as creation). Changing the code updates references to this locale in future requests.

  • Name
    is_default
    Type
    bool
    Description

    Set to true to make this locale the default for the environment. When set, the previous default locale becomes non-default automatically.

Errors

  • Name
    401 Unauthorized
    Description

    Authentication credentials are missing or invalid.

    • authentication_failed - authentication credentials were not provided or are invalid
  • Name
    403 Forbidden
    Description

    Insufficient permissions to modify this locale.

    • permission_denied - insufficient permissions to perform this action
  • Name
    404 Not Found
    Description

    The specified resource could not be found. Specific codes:

    • environment_not_found - the specified environment does not exist
    • locale_not_found - the specified locale does not exist
  • Name
    422 Unprocessable Content
    Description

    Validation or business logic error. Specific codes:

    • validation_error - validation errors in request data
    • locale_already_exists - locale with the same code already exists in this environment

Request

PUT
/v1/:env/locales/:code/
curl -X PUT https://api.foxnose.net/v1/7c9h4pwu/locales/fr/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiI..." \
-H "Content-Type: application/json" \
-d '{
    "name": "French",
    "code": "fr",
    "is_default": false
}'

Response

{
    "name": "French",
    "code": "fr",
    "environment": "7c9h4pwu",
    "created_at": "2024-09-29T03:49:07.859748-05:00",
    "is_default": false
}

DELETEapi.foxnose.net/v1/:env/locales/:code/

Delete Locale

Permanently deletes a locale from the environment.

Success Response: 204 No Content

Errors

  • Name
    401 Unauthorized
    Description

    Authentication credentials are missing or invalid.

    • authentication_failed - authentication credentials were not provided or are invalid
  • Name
    403 Forbidden
    Description

    Insufficient permissions to delete this locale.

    • permission_denied - insufficient permissions to perform this action
  • Name
    404 Not Found
    Description

    The specified resource could not be found. Specific codes:

    • environment_not_found - the specified environment does not exist
    • locale_not_found - the specified locale does not exist
  • Name
    422 Unprocessable Content
    Description

    Business logic error. Specific codes:

    • default_locale_cannot_be_deleted - the default locale cannot be deleted. Switch the default locale before deleting.

Request

DELETE
/v1/:env/locales/:code/
curl -X DELETE https://api.foxnose.net/v1/7c9h4pwu/locales/fr/ \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiI..." \
-H "Content-Type: application/json"

Was this page helpful?