Error while adding a new note

Hello, I’m trying to add a note after creating a deal, but I encounter a forbidden error. I attempted to make the request via Postman using the same token, body, and everything is correct. I am using the PipeDrive library:
const apiNote = await new pipedrive.NotesApi(defaultClient);
const optsNote = pipedrive.AddNoteRequest.constructFromObject({
content: ‘’,
deal_id: deal,
pinned_to_deal_flag: 1,
user_id: job.commercial_pipe_id,
console.log(‘deal le deal’, deal, optsNote)
await apiNote.addNote(optsNote).then(
(data : any) => {
console.log('API Note successfully. Returned data: ', data);
(error: any) => {
console.error(‘API call error => addNote’, error);
Has someone experienced the same problem or can anyone identify what I did wrong?

Hello @BETZCorentin , welcome to the community!

I see that the deal_id is set in your code like this:

deal_id: deal,

Where this deal variable comes from? Is it just the deal id, or a whole deal object?

Hello @Edmilson_Souza Thank you for your response!
The variable comes from the previous call to create a deal. Here are all the parameters:
here is all the param :
AddNoteRequest {
content: ‘url’,
deal_id: 2645,
pinned_to_deal_flag: 1,
user_id: 13181122

The content seems to be empty in the code:
content: ‘’,
But it’s required in the request.

no, the content is an url not null so I’m sure it’s not empty