---
title: "Create Published Attribute"
method: POST
path: "/published-attributes"
tags: ["Published Attributes"]
---

# Create Published Attribute

`POST /published-attributes`

## Request body

- object
  - `published_attribute_token` string — An Alloy system generated unique ID for the published attribute.
  - `published_attribute_name` string, required — The name of the published attribute. - If the published attribute is an input attribute in a workflow, this name will serve as the selector in the Evaluation payload. - When creating transactions via the Events API (`transaction` events), you can include published attribute values directly in the event data payload using this name as the field name.
  - `data_type` 'integer' | 'decimal' | 'string' | 'boolean' | 'date' | 'timestamp', required — The data type of the published attribute.
  - `default_value` union, required — A default value is assigned to the published attribute for each object of the `object_type`. If the published attribute is being used as an input attribute, then this value will be used if there is no value provided in the evaluation payload.
    - string
    - number
    - boolean
  - `default_value_note` string, nullable — A description of the default value.
  - `contains_pii` boolean, required — This is set to true when the published attribute contains PII. If it's true this field will be stored encrypted. Unable to be changed once set.
  - `object_type` 'entity' | 'transaction', required — The object type to which this published attribute applies. - `entity`: Published attribute values are associated with entities and require either `entity_token` or `external_entity_id` - `transaction`: Published attribute values are associated with transactions and require a `transaction_token`
  - `value_expires_in` integer, nullable — The number of seconds that this published attribute's values will persist for.
  - `jq_filter` string, nullable — A way to transform JSON using the jq cli tool.
  - `description` string, nullable — A description of the published attribute.

## Response `201`

Published Attribute Object.

- object
  - `published_attribute_token` string — An Alloy system generated unique ID for the published attribute.
  - `message` string — A message indicating that the published attribute was created.

## Other responses

- `400` — There was a validation error when creating the published attribute.

---

[API](https://skmtc.dev/alloy/apis/alloy-api.md) · [All operations](https://skmtc.dev/alloy/apis/alloy-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/alloy/alloy-api/revisions/405799de4d2a/schema)
