Can't create deal using Deals API




I'm using R to create deals through the Deals API. Here's a basic example of what I'm sending (Ignore R syntax, I've broken it out to make it easier to follow):

  "properties": [
      "value": "Testing",
      "name": "dealname"
      "value": "appointmentscheduled",
      "name": "dealstage"

I get a 200 response but don't see anything in Deals when I open Hubspot. My APP has Basic OAuth functionality and Contacts checked (I couldn't find a section that specifically was for Deals, so I'm assuming Contacts is correct). As an aside, I'm able to edit contacts with this API key so I know it connects.

Thanks for your help!


Hi @Alexandre_Leduc,

Happy to help. The endpoint should return JSON-formatted data for the newly-created deal:

  "portalId": 62515,
  "dealId": 123456,
  "isDeleted": false,
  "associations": {
    "associatedVids": [

Could you share examples of those responses? Please be sure to include your Hub ID (portalId) as well.


Hi Isaac,

Is the return necessary to create the deal? I just focused on the POST and I've just been looking to HubSpot for the deal created within the actual Deals screen. My portal ID is 4669976


Hi @Alexandre_Leduc,

No, you'll only get a return if a deal is created. With the dealId, I should be able to locate the record or at least find out what happened to it.


Hi Isaac, I don't actually seem to be getting any response text..just a status 200? I tested my other script where I update contact info and it's also not returning any response though?


Hi @Alexandre_Leduc,

Are you including the content-type header? I wonder if you're erroneously getting a 200 response due to this behavior:


Thanks Isaac! That was exactly my problem. For anyone else using R, here's the correct syntax to get this to work:
POST(paste("",apikey,sep=""),body = body_json, content_type('application/json'))
-Note: Body_json is my JSON output that I included above