Skip to main content
Solved

Problem when trying to clear out field using "Create or Update Profile API" method

  • February 25, 2025
  • 1 reply
  • 7 views

 Hi,

 

I’m using this method https://developers.klaviyo.com/en/v2024-06-15/reference/create_or_update_profile and I’m having a problem when passing null to a field. It does not clear it out as stated in the documentation.

I also tried the latest stable version v2025-01-05, but the results are the same.

 

Here’s an example of Request and Response.

Request:

{
  "RequestMethod": "POST",
  "RequestUrl": "https://a.klaviyo.com/api/profile-import/",
  "RequestBody": {
    "data": {
      "type": "profile",
      "attributes": { "properties": {}, "organization": null },
      "id": "01JMZ3P5VQQ7778PT1CWMEDB0K"
    }
  }
}

Response:

{
  "ResponseStatusCode": 200,
  "ResponseHeaders": {
  },
  "ResponseBody": {
    "data": {
      "type": "profile",
      "id": "01JMZ3P5VQQ7778PT1CWMEDB0K",
      "attributes": {
        "email": "aaaaa@example.net",
        "phone_number": null,
        "external_id": null,
        "anonymous_id": null,
        "first_name": null,
        "last_name": null,
        "organization": "test organization",
        "locale": null,
        "title": null,
        "image": null,
        "created": "2025-02-25T17:50:15+00:00",
        "updated": "2025-02-25T19:16:10+00:00",
        "last_event_date": null,
        "location": {
          "address1": null,
          "city": null,
          "address2": null,
          "longitude": null,
          "country": null,
          "latitude": null,
          "region": null,
          "zip": null,
          "timezone": null,
          "ip": null
        },
        "properties": {}
      },
      "relationships": {
        "lists": {
          "links": {
            "self": "https://a.klaviyo.com/api/profiles/01JMZ3P5VQQ7778PT1CWMEDB0K/relationships/lists/",
            "related": "https://a.klaviyo.com/api/profiles/01JMZ3P5VQQ7778PT1CWMEDB0K/lists/"
          }
        },
        "segments": {
          "links": {
            "self": "https://a.klaviyo.com/api/profiles/01JMZ3P5VQQ7778PT1CWMEDB0K/relationships/segments/",
            "related": "https://a.klaviyo.com/api/profiles/01JMZ3P5VQQ7778PT1CWMEDB0K/segments/"
          }
        },
        "conversation": {
          "links": {
            "self": "https://a.klaviyo.com/api/profiles/01JMZ3P5VQQ7778PT1CWMEDB0K/relationships/conversation/",
            "related": "https://a.klaviyo.com/api/profiles/01JMZ3P5VQQ7778PT1CWMEDB0K/conversation/"
          }
        }
      },
      "links": {
        "self": "https://a.klaviyo.com/api/profiles/01JMZ3P5VQQ7778PT1CWMEDB0K/"
      }
    },
    "links": {
      "self": "https://a.klaviyo.com/api/profile-import/"
    }
  }
}

 

Best answer by Byrne C

Hi ​@other1467,

Thanks for the question! You structured your API call correctly, but your organization isn’t being unset due to a known bug our engineers are working to fix. Currently, the value null won’t successfully unset a property in this endpoint. You can work around this by using the Update Profile PATCH request instead, which is not experiencing this bug. Let me know if I can answer any additional questions!

-Byrne

View original
Did this topic or the replies in the thread help you find an answer to your question?

1 reply

Byrne C
Community Manager
Forum|alt.badge.img+14
  • Community Manager
  • 103 replies
  • Answer
  • February 27, 2025

Hi ​@other1467,

Thanks for the question! You structured your API call correctly, but your organization isn’t being unset due to a known bug our engineers are working to fix. Currently, the value null won’t successfully unset a property in this endpoint. You can work around this by using the Update Profile PATCH request instead, which is not experiencing this bug. Let me know if I can answer any additional questions!

-Byrne