# API POST Or PUT?

**URL:** <https://community.hubspot.com/t/api-post-or-put/17548>\
**Category:** APIs & Integrations\
**Tags:** developer-tools, object\
**Created:** [December 4, 2019, 10:00am UTC](https://community.hubspot.com/t/api-post-or-put/17548 "2019-12-04T10:00:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![grantduke](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grantduke/32/29572_2.png) [@grantduke](https://community.hubspot.com/u/grantduke)\
**Post date:** [December 4, 2019, 10:00am UTC](https://community.hubspot.com/t/api-post-or-put/17548/1 "2019-12-04T10:00:08Z")

</div>

Hi!

With reference to [https://developers.hubspot.com/docs/methods/deals/update\_deal](https://developers.hubspot.com/docs/methods/deals/update_deal)

The above page instruction say to use “PUT” but when using PostMan and “Put” I get the following:

405 Method Not Allowed

If I change the method to “POST” I get 200 OK with an export of data on what has been changed, but yet, I don’t see these changes within the HubSpot portal.

So not sure what I’m missing here

---

<div class="post-metadata">

**Author:** ![jackcoldrick](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jackcoldrick/32/5119_2.png) [@jackcoldrick](https://community.hubspot.com/u/jackcoldrick)\
**Post date:** [December 4, 2019, 10:22am UTC](https://community.hubspot.com/t/api-post-or-put/17548/2 "2019-12-04T10:22:41Z")

</div>

Hi @grantduke,

I am unable to reproduce that. When using PUT I get a 200 OK response and the deal is updated as per the documentation. If I try to do a POST I get a 405 METHOD NOT ALLOWED. Are you also encoding the body in JSON? See my postman examples below:

**PUT REQUEST: 200**

 ![put.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/3/8/38dca1f3ee20847d393822d8380bafb001e6d0d7.png)

**POST REQUEST: 405**

 ![post.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/9/1/91c62cd6bb446f336154d8553fcf74fa06353190.png)

Regards,

Jack

---

<div class="post-metadata">

**Author:** ![grantduke](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grantduke/32/29572_2.png) [@grantduke](https://community.hubspot.com/u/grantduke)\
**Post date:** [December 4, 2019, 10:43am UTC](https://community.hubspot.com/t/api-post-or-put/17548/3 "2019-12-04T10:43:34Z")

</div>

Hi Jack

As you can see below. I get 405 when using PUT

 ![API Push.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/3X/6/5/6521428d01a115afd2044cf2be794618a46c7224.jpeg)

---

<div class="post-metadata">

**Author:** ![jackcoldrick](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jackcoldrick/32/5119_2.png) [@jackcoldrick](https://community.hubspot.com/u/jackcoldrick)\
**Post date:** [December 4, 2019, 10:56am UTC](https://community.hubspot.com/t/api-post-or-put/17548/4 "2019-12-04T10:56:26Z")

</div>

Hi @grantduke,

You have a typo in your request URL. You are doing the following, notice you have an extra “?” before the deal ID.

[https://api.hubapi.com/deals/v1/deal/](https://api.hubapi.com/deals/v1/deal/)

**?**

1242828230?hapikey={{apikey}}

Whereas it should be:

[https://api.hubapi.com/deals/v1/deal/1242828230?hapikey={{apikey}](https://api.hubapi.com/deals/v1/deal/1242828230?hapikey=%7B%7Bapikey%7D)}

Notice I’ve removed the extra “?” you have before the deal ID. This will ensure the PUT works successfuly.

Regards,

Jack
