Skip to content

"Company already exists" error when calling companies.createOrUpdate #461

@jpike88

Description

@jpike88

My code:

const intercom = new IntercomClient({
			environment: IntercomEnvironment.AuProduction,
			token: 'MY_TOKEN_HERE',
			version: '2.11',
		});


const company: Company = await intercom.companies.createOrUpdate({
			company_id: user.businessID,
			name: user.businessName,
			remote_created_at: dateCreated,
			custom_attributes: {
				'something_here': 'a_value',
			},
		});


It usually works. But sometimes, I somehow got this error on production:

{
  "type": "error.list",
  "request_id": "00095et5a4vo8m2t8kbg",
  "errors": [
    {
      "code": "unique_company_constraint",
      "message": "Company already exists."
    }
  ]
}

This shouldn't be possible when calling the API, the REST method is not doing what it says it should be doing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions