Main menu

Modify a single asset

PATCH https://localise.biz/api/assets/{id}.json 

Modifies the properties of an asset in the currently authenticated project and returns the full, modified object.

To modify tags, see the tagging endpoints. To modify plural forms, see the plural endpoints

URI parameters

id

Asset ID

string required
key

API key - required if not sent in Authorization header

string optional

Request body

The PATCH request body must contain (object) Partial asset data to update.

This must be a JSON-encoded string in the following form:

{
    "id": "", // Unique asset identifier
    "type": "text", // Broad content type to set
    "context": "", // Optional context descriptor
    "notes": "", // Optional notes for translators
    "printf": "", // String formatting style
    "aliases": { /* Hash of additional asset identifiers to set */ },
} 

Loco's official SDK binds the request body to the "data" parameter. Check the documentation for other libraries.

Request headers

Authorization

API key sent as "Loco <key>" or "Basic <encoded>". See Authentication.

string required if not in query

Response

A single JSON-encoded Asset object, which takes the following form:

{
    "id": "", // Unique asset identifier
    "type": "text", // Content type for translations
    "context": "", // Optional context descriptor
    "notes": "", // Optional notes for translators
    "printf": "", // String formatting style
    "modified": "", // Time last modified in UTC
    "plurals": 0, // Number of associated plural forms
    "tags": [ /* Array of terms asset is tagged with */ ],
    "aliases": { /* Hash of additional asset identifiers, e.g */ },
    "progress": {
        "translated": 0, // Number of locales for which a translation exists (including those flagged)
        "untranslated": 0, // Number of locales that do not yet have a translation of this asset
        "flagged": 0, // Number of locales whose translations are flagged as requiring attention
    }
}  

Try it

Open in test console »


« /api/assets