Skip to navigation

Create publication field <Badge intent="info" minimal outlined>OAuth Scope: publication_fields:write</Badge>

Currently in beta

This feature is currently in beta and the API is subject to change.

Define a new publication field for the workspace. The field is created active, and every publication in the workspace can immediately set a value for it.

A json field must set value_source to fetched, an endpoint_url, and the response_keys it declares. Every other kind must be static and carry no endpoint_url. All kinds except json and rss_feed_url require a default_value.

Requires an API key with access to every publication in the workspace.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
displaystringRequired
The human readable label for the field.
kindenumRequired
The type of value the field holds.
namestringOptional

The merge tag key for the field, unique within the workspace. Derived from display when omitted. Normalized to start with a letter and contain only lowercase letters, numbers and underscores, so Support Email is stored as support_email. A date or number field also claims its format variants, so launch_date_mdy is rejected with NAME_CLASHES while a date field named launch_date exists, and the other way around.

value_sourceenumOptional

Where the value for each publication comes from. Defaults to static.

Allowed values:
default_valuestringOptional

The value used for publications that have not set one of their own. Required for every kind except json and rss_feed_url.

endpoint_urlstringOptional

The URL the value is retrieved from. Required when value_source is fetched and rejected otherwise. May contain merge tags that resolve per publication.

response_keyslist of objectsOptional

The keys declared within the fetched JSON response body. Required when kind is json and rejected otherwise. A number or date key also claims its format variants, so a key temp_round2 is rejected with RESPONSE_KEYS_CLASHES beside a number key named temp.

Response

Created
dataobject

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error
500
Internal Server Error