# API create custom field in a project and not on workspace level

**URL:** <https://forum.asana.com/t/api-create-custom-field-in-a-project-and-not-on-workspace-level/134871>\
**Category:** API & Developers\
**Created:** [6 September 2021 13:14 UTC](https://forum.asana.com/t/api-create-custom-field-in-a-project-and-not-on-workspace-level/134871 "2021-09-06T13:14:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PJ\_Muller](https://luna1.co/8d76cd.png) [@PJ\_Muller](https://forum.asana.com/u/PJ_Muller)\
**Post date:** [6 September 2021 13:14 UTC](https://forum.asana.com/t/api-create-custom-field-in-a-project-and-not-on-workspace-level/134871/1 "2021-09-06T13:14:36Z")

</div>

Hi there,

I’m doing the [create a custom field](https://developers.asana.com/docs/create-a-custom-field) API call with this payload

```auto
{
  "data": {
    "enum_options": [
      {
        "resource_type": "enum_option",
        "color": "green",
        "enabled": true,
        "name": "Option 1"
      },
      {
        "resource_type": "enum_option",
        "color": "red",
        "enabled": true,
        "name": "Option 2"
      }
    ],
    "is_global_to_workspace": false,
    "name": "custom field 1",
    "resource_subtype": "enum",
    "workspace": "123123123"
  }
}

```

I’m getting

> You may not create a custom field with `is_global_to_workspace` set to `false` unless it has a custom field setting on it

Probably like others I’m confused between the difference of a “custom field” and a “custom field setting”.

Do I need to include the body once more under the “custom\_field\_settings” attribute? Or do I need to call [add a custom field to a project](https://developers.asana.com/docs/add-a-custom-field-to-a-project) directly without creating the field first? (and if so, with which body as this last call assumes that I pass a field ID)

Greetings,  
PJ

---

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [6 September 2021 14:16 UTC](https://forum.asana.com/t/api-create-custom-field-in-a-project-and-not-on-workspace-level/134871/2 "2021-09-06T14:16:27Z")

</div>

> [@PJ\_Muller](#):
>
> Or do I need to call [add a custom field to a project](https://developers.asana.com/docs/add-a-custom-field-to-a-project) directly without creating the field first?

I haven’t tried it myself but I think this ⬆ is the answer for how to create a project-specific custom field, based on this forum post:

> [@Updated Custom Fields](https://forum.asana.com/t/updated-custom-fields/55153/4):
>
> Hey @Phil_Seeman, The /workspaces/{id}/custom\_fields endpoint will not return project specific ones. I was wrong earlier. The is\_global\_to\_workspace is read only. It looks like you create project specific ones with /projects/:id/addCustomFieldSetting.

---

<div class="post-metadata">

**Author:** ![PJ\_Muller](https://luna1.co/8d76cd.png) [@PJ\_Muller](https://forum.asana.com/u/PJ_Muller)\
**Post date:** [6 September 2021 14:43 UTC](https://forum.asana.com/t/api-create-custom-field-in-a-project-and-not-on-workspace-level/134871/3 "2021-09-06T14:43:20Z")

</div>

Hi Phil,

#success!

for others wanting an explicit working example

```auto
curl --location --request POST 'https://app.asana.com/api/1.0/projects/123123/addCustomFieldSetting?opt_pretty=<boolean>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer xxxxxxxxxxxxx' \
--data-raw '{
    "data": {
        "custom_field": {
            "name": "hello",
            "resource_subtype": "text"
        },
    "is_important": true
    }
}'

```

---

<div class="post-metadata">

**Author:** ![Phil\_Seeman](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/phil_seeman/32/81525_2.png) [@Phil\_Seeman](https://forum.asana.com/u/Phil_Seeman)\
**Post date:** [6 September 2021 14:45 UTC](https://forum.asana.com/t/api-create-custom-field-in-a-project-and-not-on-workspace-level/134871/4 "2021-09-06T14:45:13Z")

</div>

Excellent! And thanks for posting that working code!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/asana/user_avatar/forum.asana.com/system/32/276370_2.png) [@system](https://forum.asana.com/u/system)\
**Post date:** [30 May 2025 19:03 UTC](https://forum.asana.com/t/api-create-custom-field-in-a-project-and-not-on-workspace-level/134871/5 "2025-05-30T19:03:38Z")

</div>

Closed on 30 May 2025 19:03 UTC


