How to add an existing field to a project

This is a sort of follow-up question from

What about the new API?

I can't find an endpoint to add an existing custom field to a project.

It seems that is the endpoint to be used, but without a specific example, it's kind of shooting blindly to guess what's the right way to do it and with a high risk of messing our projects while testing.

1 comment
Comment actions Permalink
Official comment

Hi Andrea,

I'm sorry for the delayed response here.

To attach an existing field to a project, you need to:

1) Get the ID of your project from the list of projects:

GET https://<base-url>api/admin/projects?fields=id,name

2) Get the ID of your custom field from the list of custom fields:

GET https://<base-url>/api/admin/projects/<project-id>/customFields?fields=field(name,id)

3) Attach the field to the project:

POST https://<base-url>/api/admin/projects/<project-id>/customFields?fields=field(name,id)

"field": {
"name": "My State",
"id": "46-12",
"$type": "CustomField"
"$type": "StateProjectCustomField"

Please sign in to leave a comment.