# API - Logging Call Activity for a Contact

**URL:** <https://community.hubspot.com/t/api-logging-call-activity-for-a-contact/50730>\
**Category:** APIs & Integrations\
**Tags:** python, contacts, starter\
**Created:** [February 2, 2022, 4:03am UTC](https://community.hubspot.com/t/api-logging-call-activity-for-a-contact/50730 "2022-02-02T04:03:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SM6](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sm6/32/48165_2.png) [@SM6](https://community.hubspot.com/u/SM6)\
**Post date:** [February 2, 2022, 4:03am UTC](https://community.hubspot.com/t/api-logging-call-activity-for-a-contact/50730/1 "2022-02-02T04:03:24Z")

</div>

Hello,

I am trying to use the HubSpot API to create a new call activity log for an existing contact. This is the code that I am using:

```lia-code-sample
import requests

url = "https://api.hubapi.com/crm/v3/objects/calls"
id = 'XXXXXXXXXX'
HAPI_KEY = 'XXXXXXXXXX'
querystring = {"hapikey": HAPI_KEY}

payload = "{\"properties\":{\"hs_timestamp\":\"2021-03-17T01:32:44.872Z\",\"hs_call_title\":\"Discovery call\",\"hubspot_owner_id\":" + id + ",\"hs_call_body\":\" Decision maker out, will call back tomorrow\",\"hs_call_duration\":\"3800\",\"hs_call_from_number\":\"(857) 829 5489\",\"hs_call_to_number\":\"(509) 999 9999\",\"hs_call_recording_url\":\"https://api.twilio.com/2010-04-01/Accounts/AC890b8e6fbe0d989bb9158e26046a8dde/Recordings/RE3079ac919116b2d22\",\"hs_call_status\":\"COMPLETED\"}}"
headers = {
 'accept': "application/json",
 'content-type': "application/json"
 }

response = requests.request("POST", url, data=payload, headers=headers, params=querystring)

print(response.text)

```

‘response’ has the value ‘\<Response [200]\>’ and what is printed out is:

`{"id":"XXXXXXXX","properties":{"hs_all_owner_ids":"XXXXXXXX","hs_body_preview":"Decision maker out, will call back tomorrow","hs_body_preview_html":"<html>\n <head></head>\n <body>\n Decision maker out, will call back tomorrow\n </body>\n</html>","hs_body_preview_is_truncated":"false","hs_call_body":" Decision maker out, will call back tomorrow","hs_call_duration":"3800","hs_call_from_number":"(857) 829 5489","hs_call_recording_url":"https://api.twilio.com/2010-04-01/Accounts/AC890b8e6fbe0d989bb9158e26046a8dde/Recordings/RE3079ac919116b2d22","hs_call_status":"COMPLETED","hs_call_title":"Discovery call","hs_call_to_number":"(509) 999 9999","hs_createdate":"2022-01-29T03:10:49.927Z","hs_lastmodifieddate":"2022-01-29T03:10:49.927Z","hs_object_id":"XXXXXXXXX","hs_timestamp":"2021-03-17T01:32:44.872Z","hubspot_owner_assigneddate":"2022-01-29T03:10:49.927Z","hubspot_owner_id":"XXXXXXXXX"},"createdAt":"2022-01-29T03:10:49.927Z","updatedAt":"2022-01-29T03:10:49.927Z","archived":false}`

However, when I check the contact on HubSpot, I do not see the call log. Does anyone know why this is happening and how to correctly create a call log? Thank you in advance!

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [February 3, 2022, 2:46pm UTC](https://community.hubspot.com/t/api-logging-call-activity-for-a-contact/50730/2 "2022-02-03T14:46:42Z")

</div>

@SM6

Once you create the engagement, you will need to associate it with the record.

**PUT** ```/crm/v3/objects/calls/{callId}/associations/{toObjectType}/{toObjectId}/{associationType}`
