Create a data model field
Create a new data model field in the service account's workspace.
/api/json/v1/data_model_fields
Access and behavior
- Required scope
- api_write
- Authentication
- Bearer token
- Idempotency
- supported
- Operation ID
- createDataModelField
Request headers
| Header | Presence | Description |
|---|---|---|
| Authorization | Required | Short-lived service-account bearer token. |
| Accept | Required | JSON:API response media type. |
| Idempotency-Key | Optional | Makes an unsafe request replay-safe for the configured retention window (24 hours by default). Reusing a key with different request parameters returns 409. |
| Content-Type | Required | Request document media type. |
Parameters
include
query · Optional
string
Relationship paths to include in the response
fields
query · Optional
object
Limits the response fields to only those listed for each type
Request body
application/vnd.api+json
Schema: object
· Required
constraints
Optional
object | null
Forward-compatible map of UI-captured constraints (e.g. max_length, min, max, regex, past_only, future_only). Not yet enforced server-side.
data_model_id
Required
string
Data model id accepted by this operation.
description
Optional
string | null
Optional human-readable description of the field's purpose
is_primary_key
Optional
boolean | null
If true, this field identifies the business entity for grouping/aggregating Facts
is_required
Optional
boolean | null
Is required accepted by this operation.
name
Required
string
Field name, e.g. "email_address". Must start with a lowercase letter; lowercase letters, numbers, and underscores only.
type
Optional
enum: string | integer | boolean | datetime | float | map | null
Data type for validation
{
"data": {
"attributes": {
"constraints": "<constraints>",
"data_model_id": "00000000-0000-4000-8000-000000000001",
"description": "<description>",
"is_primary_key": false,
"is_required": false,
"name": "Example",
"type": 1
},
"type": "resource"
}
}
Success response
- Media type
- application/vnd.api+json
- Schema
- object
Errors and retries
Keep x-request-id
from failed responses. Retry only rows marked retryable, and obey
Retry-After
when present.
| Status | Code | Recovery | Meaning |
|---|---|---|---|
| 401 | unauthorized | Do not retry unchanged | A valid bearer token is required. |
| 403 | forbidden | Do not retry unchanged | The service account lacks the required scope or object access. |
| 429 | rate_limited | Retry after guidance | The request exceeded its rate window; wait for Retry-After. |
| 409 | idempotency_key_reused | Do not retry unchanged | The key was previously used for a different request. |
| 422 | invalid_request | Do not retry unchanged | The request document failed resource validation. |