Unable to update values of custom fields using task put endpoint

Hello All,
I am currenlty trying to update values of custom fields using Task’s PUT endpoint.
I checked various posts related to this and got below Body JSON format-
“data”: {
“gid”: “”,
“custom_fields”: {
“”: <new value: int, “string”, “enum”>

In this case I am getting error: 403: Access Denied.

If I try to update this custom field record using Asana interface, I able to update the value which means I should have access to the update.

Also I tried to use key “custom_field” instead of “custom_fields” in this case I get 200: Ok response. but the value of the field does not updated.

Can you please help me with correct way to get this done?

Thanks ,
Praneet Rane

1 Like

Hi @Praneet_Rane and welcome to the forum,

A couple of things:

  • Remove the gid parameter from your message body; it goes in the URL only, not in the body.
  • Not 100% sure but I believe even for a number custom field, the value has to be sent as a string, so try that.
  • There’s really no need to block out gid values when posting in the forum; without a valid auth token for your workspace, someone else having your gids is useless for them.

Hi @Phil_Seeman ,
Thanks for your response and suggestion regarding gid!
I tried removing gid parameter and sent custom field value as string but this still not work.

Praneet Rane

Hmmm, I’m not sure what’s going on. Can you post again your latest full request and the resulting response in Postman?

If I use “custom_field” instead of “custom_fields” I get response as 200 but the record is not updating.

Note that, I can update this value using Asana interface.

How are you doing your Authorization?

Hi @Phil_Seeman , Using API Key.

What type, though? OAuth or Personal Access Token?

Also: where are you getting the gids from for your 3 custom fields in the request?