Sample - Asana API
POST/portfolios/{portfolio_gid}/addCustomFieldSetting

Add a custom field to a portfolio

Adds a custom field setting to a portfolio. Supply custom_field and optionally mark the field as important or position it relative to another custom field setting. A successful response returns the created custom field setting.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

1 body field

Custom field setting details wrapped in a data object. custom_field is required; provide at most one of insert_before and insert_after.

dataobjectoptional

6 status codes
200Returns the created custom field setting in the `data` object.
dataobjectoptional
400Returned when `custom_field` is missing, a parameter is malformed, or both `insert_before` and `insert_after` are provided.
errorsarray<object>optional
401Returned when the request does not include a valid authentication token.
errorsarray<object>optional
403Returned when the authenticated user does not have access to the portfolio or the required `portfolios:write` scope.
errorsarray<object>optional
404Returned when the portfolio or referenced custom field setting does not exist, or the method and path do not identify a known action.
errorsarray<object>optional
500Returned when the API encounters a server-side failure.
errorsarray<object>optional

Error handling

A 400 is returned when custom_field is missing, the request is malformed, or both insert_before and insert_after are supplied. A 401 indicates that no valid authentication token was provided, while a 403 indicates that the authenticated user lacks access to the portfolio or the required portfolios:write scope. A 404 indicates that the portfolio or referenced setting does not exist, and a 500 indicates a server-side failure.