All Collections
APSIS One API
Guides & Best practice
Update a Profile with the APSIS One API
Update a Profile with the APSIS One API
Rikke Søndergaard avatar
Written by Rikke Søndergaard
Updated over a week ago

How to Update a Profile

After learning how to create a Profile, updating a Profile will be much easier. The process is almost the same.

Per region host names

APSIS One API is provided under different hostnames depending on your region. For EU use https://api.apsis.one/, for APAC call https://api-apac.apsis.one/.

So, let's say we want to fix the spelling mistake we made in the First Name Attribute:

curl --request PATCH \
--url https://api.apsis.one/v2/audience/keyspaces/keyspace_discriminator/profiles/profile_key/sections/section_discriminator/attributes \
--header 'accept: application/problem+json' \
--header 'content-type: application/merge-patch+json' \
--data '
{
"com.apsis1.attributes.email": "john.doe@example.com",
"com.apsis1.attributes.mobile": 46287917256,
"com.apsis1.attributes.firstname": "John",
"com.apsis1.attributes.lastname": "Doe",
"com.apsis1.attributes.vip": true,
"com.apsis1.attributes.address": {
"street": "871 Calm Road",
"city": "Somwherewille",
"postCode": 16213
},
"com.apsis1.attributes.obsolete": null
}

Updating a Profile with multiple Attributes is just as simple as with only one Attribute.

Update the name for the Profile and set a value for the Last Name Attribute at the same time in a single call.

import requests

url = "https://api.apsis.one/v2/audience/keyspaces/keyspace_discriminator/profiles/profile_key/sections/section_discriminator/attributes"

payload = "{\"com.apsis1.attributes.email\":\"john.doe@example.com\",\"com.apsis1.attributes.mobile\":46287917256,\"com.apsis1.attributes.firstname\":\"John\",\"com.apsis1.attributes.lastname\":\"Doe\",\"com.apsis1.attributes.vip\":true,\"com.apsis1.attributes.address\":{\"street\":\"871 Calm Road\",\"city\":\"Somwherewille\",\"postCode\":16213},\"com.apsis1.attributes.obsolete\":null}"
headers = {
"accept": "application/problem+json",
"content-type": "application/merge-patch+json"
}

response = requests.patch(url, data=payload, headers=headers)

print(response.text)


Deleting attributes

This endpoint supports removing attribute values from a Profile. To do this, provide null as attribute value in the request body.

Deleting values for the attributes that are also profile keys is not allowed.


What's Next?

Did this answer your question?