Created company via API does not semm to create anything

#1

Dear all, after spending 20 minutes looking for how to create a company through the web ui unsuccessfully, I gave up and tried using the API. I’m making this call:

curl https://api.intercom.io/companies
-X POST
-H ‘Authorization:Bearer ’
-H ‘Accept: application/json’
-H ‘Content-Type:application/json’ -d ’
{
“name”: “My Company”,
“company_id”: “XXXX”
}’
I’m getting this result:
{“type”:“company”,“company_id”:“XXXX”,“app_id”:“XXXX”,“name”:“My Company”,“created_at”:1535445937,“updated_at”:1535445937,“monthly_spend”:0,“session_count”:0,“user_count”:0,“tags”:{“type”:“tag.list”,“tags”:[]},“segments”:{“type”:“segment.list”,“segments”:[]},“plan”:{},“custom_attributes”:{“creation_source”:“api”}}

I imagine the company is created… but i can’t seem to find it no where on the platform. So I decided to try to get it via an API call. so I used (with the same Bearer token):
curl https://api.intercom.io/companies
-H ‘Authorization:Bearer XXX’
-H ‘Accept:application/json’
I’m getting a list with the companies currently in the system (2 of them) but can’t find anywhere my newly created company…
What am I doing wrong?

0 Likes

#2

Hey there Alexandre!

Companies only show up in the UI when a User has been associated with them - if no User is part of a Company, it won’t show up. If you try associating it with a User it should then show up in the Platform!

0 Likes

#3

Hey leviathan898,
thanks a lot for your help. I’m still a bit concerned here as I did not try to access the company through the UI, I created it through the API and thenI tried to get a list of companies using the REST API :(. It is also not super user frendly to have a POST on a resource that is successful followed by a GET on the same ressource which does not return that resource. For me this is kind of crazy and not very logical :frowning:.
I’ll try to attach to attach a company with the same name to a user to see what goes out of that.
thanks for your help.
Alex.

0 Likes

#4

Companies without Users will also not be returned if listed from the API! :nerd_face: You can see this if you check out our docs on the REST API: https://developers.intercom.com/intercom-api-reference/reference#list-companies.

0 Likes

#5

It is also not super user frendly to have a POST on a resource that is successful followed by a GET on the same ressource which does not return that resource.

Hey @AlexandreRoba, I’m part of the platform team :wave:

Would you be able to clarify what you would expect as a response after creating a company? How would ideal look like? thanks!

0 Likes