Create deal with API error

API alway return “You do not have permissions to do this.” when I try to create deal even my token is from admin user. I copied token from setting page and use it for list deal/person it worked but when I try to create deal is alway return “You do not have permissions to do this.”

Are you testing this directly from the API Reference page?

When I try from API Reference is work bout when I try from my code is doesn’t work

Can you share your code (minus the token) and I can see if something seems eschew?

let options = {
method: ‘POST’,
uri: ‘https://api.pipedrive.com/v1/deals?api_token=[token]’,
body: {
title: person.data[0].name,
stage_id: “26”,
status: “open”,
user_id: person.data[0].id
},
json: true
}

Hey @thangman22, the problem is regarding the field user_id, looks like you are sending the person_id instead of the ID of the Pipedrive user. Let me know if this is not the case.

2 Likes

thank you so much. diego

1 Like