Unable to send the Original Source data using API

Hello,
I’m using this Api (https://api.hubapi.com/crm/v3/objects/contacts) to send the contacts data but i want to send the Original Source column data too i contacted the support and they said you have to send the ‘hutk’ value using this

$hubspotutk = isset($_COOKIE[‘hubspotutk’]) ? $_COOKIE[‘hubspotutk’] : ‘’;
but i’m getting this error
Error: Property values were not valid: [{“isValid”:false,“message”:“Property \“hutk\” does not exist”,“error”:“PROPERTY_DOESNT_EXIST”,“name”:“hutk”,“localizedErrorMessage”:“Property \“hutk\” does not exist”,“portalId”:20127715}]

Hey, @RMuzammil l :waving_hand: Thanks for the interesting question. If you received a solution from support, and it’s not working, I’d suggest reopening your ticket and asking the specialist who helped you to clarify how your request should be structured. The error you shared is telling us that `htuk` is not a default Contact property.

Can you share a simplified request example?
I ran a “really simple test” example using the Contact API to update a record’s Original source value successfully via the Contact API PATCH endpoint.

curl --request PATCH \
 --url https://api.hubapi.com/crm/v3/objects/contacts/1901 \
 --header 'authorization: Bearer YOUR_ACCESS_TOKEN' \
 --header 'content-type: application/json' \
 --data '{
 "properties": {
 "hs_analytics_source": "PAID_SEARCH"
 }
}'

Response

HTTP 200

{
 "id": "1901",
 "properties": {
 "createdate": "2023-11-16T20:26:57.570Z",
 "hs_all_accessible_team_ids": "12073943",
 "hs_all_owner_ids": "198670650",
 "hs_all_team_ids": "12073943",
 "hs_analytics_source": "PAID_SEARCH",
 ...
 },
 "createdAt": "2023-11-16T20:26:57.570Z",
 "updatedAt": "2024-01-24T23:11:50.353Z",
 "archived": false
}

One thing that is not mentioned in your original post is if you’re trying to do this when creating a net-new contact or if you are updating (like in my example).

Thanks for the additional information! — Jaycee