# SimplePublicObjectInputForCreate does not exist, probably wrong documentation?

**URL:** <https://community.hubspot.com/t/simplepublicobjectinputforcreate-does-not-exist-probably-wrong-documentation/77601>\
**Category:** APIs & Integrations\
**Tags:** python\
**Created:** [March 21, 2023, 7:03am UTC](https://community.hubspot.com/t/simplepublicobjectinputforcreate-does-not-exist-probably-wrong-documentation/77601 "2023-03-21T07:03:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![KKang5](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kkang5/32/198082_2.png) [@KKang5](https://community.hubspot.com/u/KKang5)\
**Post date:** [March 21, 2023, 7:03am UTC](https://community.hubspot.com/t/simplepublicobjectinputforcreate-does-not-exist-probably-wrong-documentation/77601/1 "2023-03-21T07:03:49Z")

</div>

Here is the code example I found in in [Accounts Dashboard | HubSpot](https://developers.hubspot.com/docs/api/crm/tickets), the Create section:

```lia-code-sample
import hubspot
from pprint import pprint
from hubspot.crm.tickets import SimplePublicObjectInputForCreate, ApiException

client = hubspot.Client.create(access_token="YOUR_ACCESS_TOKEN")

properties = {
 "hs_pipeline": "support_pipeline",
 "hs_pipeline_stage": "open",
 "hs_ticket_priority": "HIGH",
 "hubspot_owner_id": "910901",
 "subject": "troubleshoot report"
}
simple_public_object_input_for_create = SimplePublicObjectInputForCreate(properties=properties, associations=[{"to":{"id":"101"},"types":[{"associationCategory":"HUBSPOT_DEFINED","associationTypeId":2}]}])
try:
 api_response = client.crm.tickets.basic_api.create(simple_public_object_input_for_create=simple_public_object_input_for_create)
 pprint(api_response)
except ApiException as e:
 print("Exception when calling basic_api->create: %s\n" % e)

```

When I do the same thing in my IDE (PyCharm), I got

`Cannot find reference 'SimplePublicObjectInputForCreate' in ' __init__.py' `

So I tried to find this class in source code: [hubspot-api-python/hubspot/crm/tickets/models at master · HubSpot/hubspot-api-python · GitHub](https://github.com/HubSpot/hubspot-api-python/tree/master/hubspot/crm/tickets/models) , but no luck.  
Is the documentation wrong or outdated? thanks

---

<div class="post-metadata">

**Author:** ![himanshurauthan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/himanshurauthan/32/53076_2.png) [@himanshurauthan](https://community.hubspot.com/u/himanshurauthan)\
**Post date:** [March 21, 2023, 8:52am UTC](https://community.hubspot.com/t/simplepublicobjectinputforcreate-does-not-exist-probably-wrong-documentation/77601/2 "2023-03-21T08:52:10Z")

</div>

Hello @KKang5

It appears that the **‘SimplePublicObjectInputForCreate’** class is no longer available in the current version of the HubSpot API Python client library. The documentation you are referring to might be outdated or incorrect.

Instead, you can use the **‘PublicTicketCreateRequest’** class for creating new tickets.  
Here’s an example

```lia-code-sample
import hubspot
from pprint import pprint
from hubspot.crm.tickets import PublicTicketCreateRequest, ApiException

client = hubspot.Client.create(access_token="YOUR_ACCESS_TOKEN")

ticket_properties = {
 "subject": "troubleshoot report",
 "content": "Please help me troubleshoot this issue.",
 "hs_pipeline": "support_pipeline",
 "hs_pipeline_stage": "open",
 "hs_ticket_priority": "HIGH",
 "hubspot_owner_id": "910901"
}
ticket_create_request = PublicTicketCreateRequest(**ticket_properties)

try:
 api_response = client.crm.tickets.basic_api.create(ticket_create_request)
 pprint(api_response)
except ApiException as e:
 print("Exception when calling basic_api->create: %s\n" % e)

```

You can find more information about the **‘PublicTicketCreateRequest’** class and its properties in the official HubSpot API documentation:  
[Accounts Dashboard | HubSpot](https://developers.hubspot.com/docs/api/crm/tickets).  
Thanks & Regards  
Himanshu Rauthan

---

<div class="post-metadata">

**Author:** ![KKang5](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kkang5/32/198082_2.png) [@KKang5](https://community.hubspot.com/u/KKang5)\
**Post date:** [March 22, 2023, 2:33am UTC](https://community.hubspot.com/t/simplepublicobjectinputforcreate-does-not-exist-probably-wrong-documentation/77601/3 "2023-03-22T02:33:17Z")

</div>

@himanshurauthan There is no **PublicTicketCreateRequest** in the codebase, nor the docs.  
You can see there is no import in [https://github.com/HubSpot/hubspot-api-python/blob/master/hubspot/crm/tickets/\_\_init\_\_.py](https://github.com/HubSpot/hubspot-api-python/blob/master/hubspot/crm/tickets/ __init__.py)  
I would also like to know if the offical docs are outdated, if yes someone please update them

---

<div class="post-metadata">

**Author:** ![NicolasDu](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@NicolasDu](https://community.hubspot.com/u/NicolasDu)\
**Post date:** [March 22, 2023, 4:30pm UTC](https://community.hubspot.com/t/simplepublicobjectinputforcreate-does-not-exist-probably-wrong-documentation/77601/4 "2023-03-22T16:30:37Z")

</div>

Hello ! Same issue for contact creation, on this doc page : [Accounts Dashboard | HubSpot](https://developers.hubspot.com/docs/api/crm/contacts)

\> SimplePublicObjectInputForCreate not found

And by the way for your previous answer about tickets object :

 ![NicolasDu_0-1679503482769.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/3X/2/b/2bc529ab967ec3d5cfff73583d3be11cab9ffeba.jpeg)

---

<div class="post-metadata">

**Author:** ![ryan](https://avatars.discourse-cdn.com/v4/letter/r/a8b319/32.png) [@ryan](https://community.hubspot.com/u/ryan)\
**Post date:** [March 30, 2023, 9:32pm UTC](https://community.hubspot.com/t/simplepublicobjectinputforcreate-does-not-exist-probably-wrong-documentation/77601/5 "2023-03-30T21:32:09Z")

</div>

**Figured out you have to keep off _ForCreate 🙄_**  
Do you have the library for the PHP version?

\<?php  
// Starting November 30, 2022, API keys will be sunset as an authentication method. Learn more about this change: [Upcoming: API Key Sunset](https://developers.hubspot.com/changelog/upcoming-api-key-sunset) and how to migrate an API key integration: [Developer platform - HubSpot docs](https://developers.hubspot.com/docs/api/migrate-an-api-key-integration-to-a-private-app) to use a private app instead.  
use HubSpot\Factory;  
use HubSpot\Client\Crm\Contacts\ApiException;  
use HubSpot\Client\Crm\Contacts\Model\BatchInputSimplePublicObjectInputForCreate;  
use HubSpot\Client\Crm\Contacts\Model\SimplePublicObjectInputForCreate;

$client = Factory::createWithAccessToken(‘YOUR\_ACCESS\_TOKEN’);

$properties1 = [  
‘company’ =\> ‘Biglytics’,  
‘email’ =\> ‘bcooper@biglytics.net’,  
‘firstname’ =\> ‘Bryan’,  
‘lastname’ =\> ‘Cooper’,  
‘phone’ =\> ‘(877) 929-0687’,  
‘website’ =\> ‘[biglytics.net](http://biglytics.net)’  
];  
$simplePublicObjectInputForCreate1 = new SimplePublicObjectInputForCreate([  
‘properties’ =\> $properties1  
]);  
$batchInputSimplePublicObjectInputForCreate = new BatchInputSimplePublicObjectInputForCreate([  
‘inputs’ =\> [$simplePublicObjectInputForCreate1],  
]);  
try {  
$apiResponse = $client-\>crm()-\>contacts()-\>batchApi()-\>create($batchInputSimplePublicObjectInputForCreate);  
var\_dump($apiResponse);  
} catch (ApiException $e) {  
echo "Exception when calling batch\_api-\>create: ", $e-\>getMessage();  
}  
[CRM API | Contacts (hubspot.com)](https://developers.hubspot.com/docs/api/crm/contacts)

---

<div class="post-metadata">

**Author:** ![KKang5](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kkang5/32/198082_2.png) [@KKang5](https://community.hubspot.com/u/KKang5)\
**Post date:** [April 3, 2023, 1:32am UTC](https://community.hubspot.com/t/simplepublicobjectinputforcreate-does-not-exist-probably-wrong-documentation/77601/6 "2023-04-03T01:32:40Z")

</div>

[@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074) sorry for ping you in, but is there any solution for this? or at least update the documentation

---

<div class="post-metadata">

**Author:** ![NicolasDu](https://avatars.discourse-cdn.com/v4/letter/n/6bbea6/32.png) [@NicolasDu](https://community.hubspot.com/u/NicolasDu)\
**Post date:** [April 3, 2023, 8:00am UTC](https://community.hubspot.com/t/simplepublicobjectinputforcreate-does-not-exist-probably-wrong-documentation/77601/7 "2023-04-03T08:00:43Z")

</div>

@KKang5 I had the support, for them the documentation is up to date (lol).

But they gave me a working solution, use “SimplePublicObjectInput” instead of "

SimplePublicObjectInputForCreate"

Best regards
