In this section, we’re going to Update a contact.person Object in your Data Store. Refer to the relevant documentation for the Objects for more information about the fields contained within the Object.
To Update an Object, we need to use the PUT HTTP method to send data to the Objects action API end-point, along with the condition that is used to decide which Object(s) should be updated. In this example, we’re going to update the Object that we created and read in the previous sections.
| Parameter | Description |
|---|---|
| object | The Object that you want to create – e.g., contacts.person |
| dataFields | A JSON collection containing just the field values you want to update. Refer to the documentation for the specific Object for information on the fields that are available, their data types and which ones are mandatory. |
| whereConditions | A JSON array containing a list of fields and values to match to determine which Object(s) should be updated. In our example, we just use the unique identifier uuid for the Object we created earlier. |
Request:POST: https://api.spacetagcloud.net/objects/v1/action
Headers:x-spacetag-app-uuid: 0b8d10be-87 ...
x-api-key: bca011a6-9375-11 ...
Content-Type: application/json
Body:
{
"object": "contacts.person",
"dataFields": {
"status": "Archived"
},
"whereConditions": [
{ "field": "uuid", "value": "423dcc76-652f-41fc-afa3-fbf7536067b2" }
]
}
Using Postman #
In Postman it would look like this, based on the set-up in the previous sections.

If the request is successful then the API will respond with a 200 OK status and the following data:

The request will tell you how many Objects were matched and how many were changed. If the Object field already contained the new value then it won’t be changed, which is why there is a distinction.
If you Get the Object again using the previous example in this section, you’ll see its data has now changed. In this example, the status field is an Enumerated List Type, which means it can only one of the values in the pre-defined list, which is why it is all lower-case, even though we capitalised the “A” in the update request.

Using Curl #
This is an example of how you would update an Object using a command-line utility such as Curl.
curl -X PUT -H "x-spacetag-app-uuid: 0b8d10be-87 ..." -H "x-api-key: bca011a6-9375-11 ..." -H "Content-Type: application/json" -d '{"object": "contacts.person", "dataFields": {"status": "Archived"}, "whereConditions": [ { "field": "uuid", "value": "423dcc76-652f-41fc-afa3-fbf7536067b2" }]}' https://api.spacetagcloud.net/objects/v1/action
