List Custom Fields

Read the custom fields in a workspace with type filtering and sorting via the customFields query.


Use the customFields query to read the custom fields defined in a workspace, optionally filtered by field type and sorted. Custom fields are CustomField objects scoped to a single workspace (a Project in the API). The result is a CustomFieldPagination page of items plus pageInfo.

The workspace is resolved from the filter.projectId argument, or — when that is omitted — from the blue-workspace-id request header. Only fields visible to the calling user’s project role are returned: if the user has a custom role with restricted field access, fields hidden from that role are excluded from items.

POST https://api.blue.app/graphql
blue-token-id: YOUR_TOKEN_ID
blue-token-secret: YOUR_TOKEN_SECRET
blue-org-id: YOUR_ORG_ID
blue-workspace-id: project_123

Company and project headers accept an ID or a slug. Header names are case-insensitive. See Authentication for the full header reference.

Request

The smallest call that works. With the blue-workspace-id header set, filter is optional; passing filter.projectId overrides the header.

query ListCustomFields {
  customFields(filter: { projectId: "project_123" }) {
    items {
      id
      uid
      name
      type
      position
    }
    pageInfo {
      totalItems
      hasNextPage
    }
  }
}

Parameters

The customFields query takes these arguments:

ArgumentTypeRequiredDescription
filterCustomFieldFilterInputNoScope the result by workspace and field type.
sortCustomFieldSortNoA single sort key. Defaults to position_ASC.
skipIntNoNumber of fields to skip for offset pagination. Defaults to 0.
takeIntNoNumber of fields to return. Defaults to 500.

CustomFieldFilterInput

FieldTypeRequiredDescription
projectIdStringNoWorkspace ID or slug to read fields from. Falls back to the blue-workspace-id header when omitted.
types[CustomFieldType!]NoReturn only fields of these types.

CustomFieldSort

A single enum value (not a list on this query).

ValueDescription
position_ASCBy workspace position, ascending (default — matches the order shown in the app).
position_DESCBy workspace position, descending.
name_ASCBy name, A–Z.
name_DESCBy name, Z–A.
createdAt_ASCOldest first.
createdAt_DESCNewest first.

CustomFieldType

The type discriminates how a field stores and renders its value. Each value also drives which type-specific fields are populated on the returned CustomField (for example currency on CURRENCY, customFieldOptions on the SELECT_* types).

ValueDescription
TEXT_SINGLESingle-line text.
TEXT_MULTIMulti-line text.
SELECT_SINGLESingle-select dropdown (one option).
SELECT_MULTIMulti-select dropdown (many options).
CHECKBOXBoolean checkbox.
RATINGStar rating.
PHONEPhone number.
NUMBERNumeric value.
CURRENCYMonetary amount in a fixed currency.
PERCENTPercentage value.
EMAILEmail address.
URLWeb URL, optionally rendered as a button.
UNIQUE_IDAuto-generated identifier with an optional prefix.
LOCATIONGeographic point (latitude/longitude).
FILEFile attachments.
COUNTRYOne or more country codes.
DATEDate or date range.
FORMULAValue computed from other fields.
REFERENCELinks to records in another workspace.
LOOKUPPulls a value from a referenced record.
TIME_DURATIONElapsed time between two events.
BUTTONActionable button.
CURRENCY_CONVERSIONAmount converted between currencies.
ASSIGNEEOne or more assigned users.
REFERENCED_BYReverse side of a REFERENCE field (records that point at this one).
ROLLUPAggregate (sum, count, …) over referenced records.

Response

{
  "data": {
    "customFields": {
      "items": [
        {
          "id": "clm4n8qwx000008l0g4oxdqn7",
          "uid": "cf_qZ1r8",
          "name": "Stage",
          "type": "SELECT_SINGLE",
          "position": 1
        },
        {
          "id": "clm4n8r2p000108l0d3k1f9aa",
          "uid": "cf_7Hb2k",
          "name": "Deal Size",
          "type": "CURRENCY",
          "position": 2
        }
      ],
      "pageInfo": {
        "totalItems": 2,
        "hasNextPage": false
      }
    }
  }
}

CustomFieldPagination

FieldTypeDescription
items[CustomField!]!The page of custom fields.
pageInfoPageInfo!Pagination metadata.
totalCountIntDeprecated — use pageInfo.totalItems.

CustomField

The fields below cover the common cases. CustomField exposes many more type-specific outputs (see Field-type outputs).

FieldTypeDescription
idID!Unique identifier.
uidString!Short human-readable identifier.
nameString!Display name.
typeCustomFieldType!The field type.
positionFloat!Order within the workspace.
descriptionStringOptional help text.
minFloatMinimum (NUMBER, RATING, PERCENT).
maxFloatMaximum (NUMBER, RATING, PERCENT).
currencyStringCurrency code (CURRENCY).
prefixStringPrefix for generated IDs (UNIQUE_ID).
isDueDateBooleanWhether a DATE field marks the record’s due date.
formulaJSONFormula configuration (FORMULA).
customFieldOptions[CustomFieldOption!]Selectable options (SELECT_*, BUTTON).
viewableBooleanWhether the calling user can see this field’s values.
editableBooleanWhether the calling user can edit this field’s values.
workspaceUserRoleProjectUserRoleThe role context used to resolve viewable/editable.
createdAtDateTime!When the field was created.
updatedAtDateTime!When the field was last changed.
metadataJSONDeprecated — no longer in use.

Field-type outputs

When you fetch fields in the context of a specific record, these populate with that record’s value. They are otherwise null.

FieldTypeDescription
textStringText value (TEXT_*, EMAIL, URL, PHONE).
numberFloatNumeric value (NUMBER, CURRENCY, PERCENT, RATING).
checkedBooleanCheckbox state (CHECKBOX).
selectedOptionCustomFieldOptionChosen option (SELECT_SINGLE).
selectedOptions[CustomFieldOption!]Chosen options (SELECT_MULTI).
selectedTodos[Todo!]Linked records (REFERENCE).
files[File!]Attached files (FILE).
latitude / longitudeFloatCoordinates (LOCATION).
startDate / endDateDateTimeDate range (DATE).
timezoneStringTimezone (DATE).
regionCodeStringRegion (PHONE).
countryCodes[String!]Country codes (COUNTRY).
referenceMultipleBooleanWhether a REFERENCE field allows multiple records.
customFieldLookupOptionCustomFieldLookupOptionLookup configuration (LOOKUP).
rollupValueNumeric / rollupValueDate / rollupValueTextString / DateTime / StringComputed rollup value (ROLLUP); exactly one is populated per record.
valueJSONThe record’s value as a type-agnostic JSON blob.

CustomFieldOption

Selectable options on SELECT_* and BUTTON fields. Commonly selected fields:

FieldTypeDescription
idID!Unique identifier.
titleString!Display label.
colorString!Hex color.
positionFloat!Order within the field.

The type also exposes buttonType, buttonConfirmText, currencyConversionFrom, currencyConversionTo, createdAt, and updatedAt for button and currency-conversion fields.

PageInfo

FieldTypeDescription
totalItemsIntTotal fields matching the filter.
totalPagesIntTotal pages at the current take.
pageIntCurrent page number.
perPageIntPage size (take).
hasNextPageBoolean!Whether more pages follow.
hasPreviousPageBoolean!Whether earlier pages exist.
startCursorStringDeprecated — use offset pagination (skip/take).
endCursorStringDeprecated — use offset pagination (skip/take).

Full example

Filter by type, page with skip/take, and select the options for select fields plus access flags.

query ListSelectFields {
  customFields(
    filter: { projectId: "project_123", types: [SELECT_SINGLE, SELECT_MULTI] }
    sort: name_ASC
    skip: 0
    take: 50
  ) {
    items {
      id
      uid
      name
      type
      position
      description
      viewable
      editable
      customFieldOptions {
        id
        title
        color
        position
      }
    }
    pageInfo {
      totalItems
      totalPages
      page
      hasNextPage
      hasPreviousPage
    }
  }
}

To read fields across multiple workspaces, or to search fields by name, use the nested customFieldQueries.customFields query instead. It takes a CustomFieldsFilterInput where companyIds is required and projectIds is an optional plural list, adds a search argument, accepts sort as a list ([CustomFieldSort!]), supports a distinct argument, and defaults take to 20.

query SearchCustomFields {
  customFieldQueries {
    customFields(
      filter: { companyIds: ["company_123"], projectIds: ["project_123"], search: "amount" }
      sort: [name_ASC]
      take: 20
    ) {
      items {
        id
        name
        type
      }
      pageInfo {
        totalItems
        hasNextPage
      }
    }
  }
}

Errors

CodeWhen
PROJECT_NOT_FOUNDNo workspace matches the resolved ID/slug, or the calling user is not a member of it.
UNAUTHENTICATEDThe request is missing or has invalid token headers.

Permissions

Any project member can list a workspace’s custom fields. Field-level visibility is enforced by the caller’s project role: a field is included only when it is visible to that role. The returned viewable and editable flags report whether the caller can see and edit each field’s values, and workspaceUserRole exposes the role used to resolve them.