# How to get UTM vars into Record via API call?

**URL:** <https://integration.keap.com/t/how-to-get-utm-vars-into-record-via-api-call/92712>\
**Category:** API Q&A\
**Tags:** api, utm\
**Created:** [May 11, 2024, 6:50pm UTC](https://integration.keap.com/t/how-to-get-utm-vars-into-record-via-api-call/92712 "2024-05-11T18:50:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christian\_Zagarskas](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@Christian\_Zagarskas](https://integration.keap.com/u/Christian_Zagarskas)\
**Post date:** [May 11, 2024, 6:50pm UTC](https://integration.keap.com/t/how-to-get-utm-vars-into-record-via-api-call/92712/1 "2024-05-11T18:50:50Z")

</div>

Once we submit data from our custom forms the UTM vars are being rejected.

the process looks like this:  
We use the APi key to send data from a custom form into:

- A: email
- B: our local database
- C: Keap of course

We use PUT via createOrUpdateContactUsingPUT  
[https://developer.infusionsoft.com/docs/rest/#tag/Contact/operation/createOrUpdateContactUsingPUT](https://developer.infusionsoft.com/docs/rest/#tag/Contact/operation/createOrUpdateContactUsingPUT)

Then we catch the **contactId** for the use and run this  
[https://developer.infusionsoft.com/docs/rest/#tag/Contact/operation/insertUTMsUsingPOST](https://developer.infusionsoft.com/docs/rest/#tag/Contact/operation/insertUTMsUsingPOST)

However… insertUTMsUsingPOST  
Always fails to update the UTM vars.

The output “says” it works.  
the code returned is 200, along with all of the following:

- [utmSource] =\> test01source
- [utmMedium] =\> test01medium
- [utmTerm] =\> test01term
- [utmCampaign] =\> test01campaign
- [utmContent] =\> test01content

However… **That data never gets inserted into the user record**.

We use the following call:  
[https://api.infusionsoft.com/crm/rest/v1/contacts/{contactId}/utm](https://api.infusionsoft.com/crm/rest/v1/contacts/%7BcontactId%7D/utm)  
We have tried using all of the following for keapSourceId

- -1
- 0
- 115 (our default form ID)
- null
- empty

How do we get the UTM vars into **createOrUpdateContactUsingPUT** or **insertUTMsUsingPOST**?
