Update an Object
Update an object given its objectType
and objectId
.
PUT /v2/objects/:objectType/:objectId
Request
Path Params
objectType string
The objectType
of the object to update.
objectId string
The objectId
of the object to update.
- cURL
- CLI
- Go
- Java
- Node.js
- PHP
- Python
- Ruby
curl "https://api.warrant.dev/v2/objects/user/d6ed6474-784e-407e-a1ea-42a91d4c52b9" \
-X PUT \
-H "Authorization: ApiKey YOUR_KEY" \
--data-raw \
'{
"meta": {
"email": "updated@email.com"
}
}'
warrant object update user:d6ed6474-784e-407e-a1ea-42a91d4c52b9 '{"email": "updated@email.com"}'
updatedUser, err := object.Update(
"user",
"d6ed6474-784e-407e-a1ea-42a91d4c52b9",
&warrant.ObjectParams{
Meta: map[string]interface{}{
"email": "updated@email.com",
},
},
)
Map<String, Object> meta = new HashMap<String, Object>();
meta.put("email", "updated@email.com");
WarrantObject updatedUser = client.updateObject("user", "d6ed6474-784e-407e-a1ea-42a91d4c52b9", meta);
const updatedUser = await warrantClient.Object.update({
object: {
objectType: "user",
objectId: "d6ed6474-784e-407e-a1ea-42a91d4c52b9",
},
meta: {
email: "updated@email.com",
},
});
$updated_user = $warrant->updateObject(
"user",
"d6ed6474-784e-407e-a1ea-42a91d4c52b9",
["email" => "updated@email.com"]
);
user = warrant.Object.get("user", "d6ed6474-784e-407e-a1ea-42a91d4c52b9")
user.update({"email": "updated@email.com"})
updated_user = Warrant::Object.update("user", "d6ed6474-784e-407e-a1ea-42a91d4c52b9", { email: "updated@email.com" })
Response
Body
objectType string
The type of the object (e.g. user, tenant, role, permission, etc).
objectId string
Customer defined string identifier for this object. Can only contain alphanumeric chars and/or '-', '_', '|', '@'. If not provided, Warrant will create a univerally unique identifier (UUID) for the object and return it. If allowing Warrant to generate an id, store the id in your application so you can provide it for authorization requests on that object.
meta object
A JSON object containing additional information about this object (e.g. role name/description, user email/name, etc.) to be persisted to Warrant.
{
"objectType": "user",
"objectId": "d6ed6474-784e-407e-a1ea-42a91d4c52b9",
"meta": {
"email": "updated@email.com"
}
}