Add user's metafields
const url = 'https://acme.mykreezalid.com/api/v1/users/1/metafields';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"namespace":"erp","title":"warehouse_code","value":"WH-42"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://acme.mykreezalid.com/api/v1/users/1/metafields \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "namespace": "erp", "title": "warehouse_code", "value": "WH-42" }'Adds one metafield, or several when you send an array of them. A metafield with the same namespace and title as an existing one of this user replaces its value. The metafield may also be wrapped in a metafield key.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”User’s unique identifier
Request Bodyrequired
Section titled “Request Bodyrequired”A custom value you attach to a resource, identified by its namespace and title.
object
Group the metafield belongs to
Name of the metafield, unique within its namespace
Value of the metafield. Usually a string; it can be returned as a number or a JSON value depending on how the metafield was defined.
A custom value you attach to a resource, identified by its namespace and title.
object
Group the metafield belongs to
Name of the metafield, unique within its namespace
Value of the metafield. Usually a string; it can be returned as a number or a JSON value depending on how the metafield was defined.
Example
{ "namespace": "erp", "title": "warehouse_code", "value": "WH-42"}Responses
Section titled “Responses”The saved metafields: under metafield (a list of one) when you sent one metafield, under metafields when you sent an array
object
A custom value you attach to a resource, identified by its namespace and title.
object
Group the metafield belongs to
Name of the metafield, unique within its namespace
Value of the metafield. Usually a string; it can be returned as a number or a JSON value depending on how the metafield was defined.
A custom value you attach to a resource, identified by its namespace and title.
object
Group the metafield belongs to
Name of the metafield, unique within its namespace
Value of the metafield. Usually a string; it can be returned as a number or a JSON value depending on how the metafield was defined.
Example
{ "metafield": [ { "namespace": "erp", "title": "warehouse_code", "value": "WH-42" } ], "metafields": [ { "namespace": "erp", "title": "warehouse_code", "value": "WH-42" } ]}No user has this identifier.
The body is not a metafield or a list of metafields, or namespace, title or value is missing or empty.