Put Object MetadataAdmin Scope

Note: Ensure you have installed the required package to use this SDK method.

You can use the putMeta() SDK method to add meta details for a required object stored in a bucket in Stratus. The objectIns, object reference used in the following code snippet is the component instance.

The meta details will be passed as JSON key value pairs. For example, {“meta_key” : “meta_value”}

Note:
  • Using the following method to pass new meta details without adding the existent details will delete the existing details and only put the new details. To avoid this, pass the new meta details along with the existing meta details.

  • You can use alphanumeric, underscores, or whitespace characters, as well as hyphens, to write your metadata. No other special character is allowed other than the once mentioned.

  • You can fetch the metadata of an object using the HEAD request method. In the response, the metadata will be listed in the key ‘x-user-meta’.

  • The maximum size limit of characters allowed for the overall metadata is 2047 characters. The character count used to determine the size limit also includes the colon “:” special character used to define the key value pair.

copy
const objectMeta = {
 "key1": "value1" ,
 "key2": "value2" 
};
const objMeta = await objectIns.putMeta(objectMeta);
console.log(objMeta);

Example of Expected Response

copy
{
    "message": "Metadata added successfully"
}

Last Updated 2026-07-02 14:51:41 +0530 IST