Skip to content

List the fields defined on an object.

GET
/v1/metadata/{moduleKey}/objects/{objectKey}/fields
curl --request GET \
--url 'https://example.com/v1/metadata/example/objects/example/fields?moduleKey=null&objectKey=null' \
--header 'Authorization: Bearer <token>'
moduleKey
required
string

Module key.

objectKey
required
string

Object key.

moduleKey

Filter fields by module key.

string

Filter fields by module key.

objectKey

Filter fields by object key (requires module_key).

string

Filter fields by object key (requires module_key).

Media typeapplication/json
Array<object>

Row from metadata.field.

pub(crate), not pub(super): named directly in crate::routes::metadata::mod::read_router’s .response::<200, ...>() OpenAPI response documentation (#814), which sits outside handlers.

object
description

Optional description.

string | null
fieldKey
required

Field identifier within the object.

string
fieldKind
required

Field kind: "scalar", "formula", "lookup", or "rollup".

string
fieldType

Scalar type for scalar/formula/rollup fields.

string | null
formula

Formula expression for formula fields.

string | null
guidance
Any of:

Audience-structured usage guidance for an object or field.

Set on an object definition or on any authorable field kind. Both keys are independently optional, so an author can supply only the one that applies.

Distinct from description: description says what the object or field is; guidance says how to use it. Synthesized fields (managed lookups, RelatedRecords inverses, junction objects) carry no Guidance of their own — the owning relationship’s description is their meaning.

object
authoring

Prose addressed to whoever writes records: conventions, units, when to use this object or field versus another. Absent by default.

string | null
querying

Prose addressed to whoever queries records: what filters and aggregates mean, pitfalls to avoid. Absent by default.

string | null
indexed
required

Whether the field is indexed.

boolean
label
required

Human-readable label.

string
lookupTarget

Lookup target for lookup fields.

string | null
moduleKey
required

Module that owns the parent object.

string
objectKey
required

Object that owns this field.

string
required
required

Whether the field is required (NOT NULL).

boolean
rollupFunction

Rollup aggregate function for rollup fields.

string | null
uniqueConstraint
required

Whether the field has a unique constraint.

boolean
Examplegenerated
[
{
"description": "example",
"fieldKey": "example",
"fieldKind": "example",
"fieldType": "example",
"formula": "example",
"guidance": {
"authoring": "example",
"querying": "example"
},
"indexed": true,
"label": "example",
"lookupTarget": "example",
"moduleKey": "example",
"objectKey": "example",
"required": true,
"rollupFunction": "example",
"uniqueConstraint": true
}
]

Structured error envelope (SPEC-DATA-0006): {"errors": [{"domain", "scope", "target", "code", "message"}, ...]}. domain (added #950 D9) names the subsystem that produced the entry (data, metadata, apply, git, auth, iam, hfx, or api for a transport-level failure with no domain error behind it) and is always present.

Media typeapplication/json

The top-level response body. Wraps a non-empty list of [ErrorEntry].

object
errors
required

The error entries making up the envelope. Always non-empty.

Array<object>

One entry in the error envelope.

Carries a [Domain] naming the subsystem that produced it, an anchoring [ErrorScope], an optional target that disambiguates within the scope, a stable SCREAMING_SNAKE_CASE code, and a human-readable English message. See SPEC-DATA-0006 for the full envelope contract.

object
code
required

Machine-readable, stable, SCREAMING_SNAKE_CASE identifier.

string
domain
required

Which subsystem produced this entry. Always serialized.

One of:

data::error::DataError – record CRUD, validation, queries.

string
Allowed value: data
location
Any of:

HFX source location for an HFX_PARSE entry.

Emitted as the extra location field on the entry JSON when present. The line/column are 1-based. The frame is the offending source line extracted verbatim from the input.

object
column
required

1-based column within the line, measured in UTF-16 code units of the prefix so browser-side editors can consume it directly.

integer format: uint32
frame

The offending source line text, when available.

string | null
line
required

1-based line number within the source text.

integer format: uint32
message
required

Server-authored English message. Not part of the API contract; may change across releases without notice.

string
rule

The key of the validation rule that failed, when the code is RULE_FAILED. None for all other codes. Skipped during serialization when absent so it does not appear on unrelated entries (same pattern as location).

string | null
scope
required

Anchoring category. Drives client-side rendering.

One of:

Attached to a specific request field. target is the field key.

string
Allowed value: field
target

Field key for field scope, record id for record scope, null otherwise. Always serialized, even when null.

string | null
Example
{
"errors": [
{
"domain": "data",
"scope": "field"
}
]
}