APIs & Integrations

JoffreyG
Member

HTTP/1.1 405 Method Not Allowed

Hi,

I'm using API for remove a contact from company.
When I try this, I have an error : HTTP/1.1 405 Method Not Allowed. But my request is 'DELETE'...

Client error: DELETE https://api.hubapi.com/companies/v2/companies/******/contacts/?hapikey=hapiKey resulted in a 405 Method Not Allowed response

0 Upvotes
1 Reply 1
robertainslie
HubSpot Employee
HubSpot Employee

HTTP/1.1 405 Method Not Allowed

Hi @JoffreyG

Assuming that redacted URL that you included in your query has asterisks (*) whereever you are placing an ID, it looks like you might be missing the contact ID that you want to remove. The endpoint takes 2 IDs - the company ID and the Contact ID.

So, an example URL would look like: https://api.hubapi.com/companies/v2/companies/39238082/contacts/270146?hapikey=demo

The first ID is the company ID and the second is the contact id. Also, be sure that you're including a content-type: application/json in your request headers.