Introduction
How-to guides
Endpoint reference
- Core endpoints
- Objects
- Attributes
- Records
- Lists
- Entries
- Workspace members
- Notes
- Tasks
- Threads
- Comments
- Webhooks
- Meta
- Standard objects
- OAuth 2.0
Create an attribute
Creates a new attribute on either an object or a list.
To create an attribute on an object, you must also have the object_configuration:read-write
scope.
To create an attribute on a list, you must also have the list_configuration:read-write
scope.
curl --request POST \
--url https://api.attio.com/v2/{target}/{identifier}/attributes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"data": {
"title": "Your Attribute",
"description": "Lorem ipsum",
"api_slug": "my-attribute",
"type": "text",
"is_required": true,
"is_unique": true,
"is_multiselect": true,
"default_value": {
"type": "static",
"template": [
{
"value": 5
}
]
},
"config": {
"currency": {
"default_currency_code": "USD",
"display_type": "symbol"
},
"record_reference": {
"allowed_objects": [
"people"
]
}
}
}
}'
{
"data": {
"id": {
"workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
"object_id": "97052eb9-e65e-443f-a297-f2d9a4a7f795",
"attribute_id": "41252299-f8c7-4b5e-99c9-4ff8321d2f96"
},
"title": "Rating",
"description": "Rating of the record out of 5",
"api_slug": "Rating",
"type": "rating",
"is_system_attribute": false,
"is_writable": true,
"is_required": false,
"is_unique": false,
"is_multiselect": false,
"is_default_value_enabled": false,
"is_archived": false,
"default_value": null,
"relationship": null,
"created_at": "2021-11-21T13:22:49.061Z",
"config": {
"currency": {
"default_currency_code": null,
"display_type": null
},
"record_reference": {
"allowed_object_ids": null
}
}
}
}
Authorizations
This API uses OAuth 2.0 with the authorization code grant flow.
Path Parameters
Whether the attribute is to be created on an object or a list.
objects
, lists
"lists"
A UUID or slug to identify the object or list the attribute belongs to.
"97052eb9-e65e-443f-a297-f2d9a4a7f795"
Body
The name of the attribute. The title will be visible across Attio's UI.
"Your Attribute"
A text description for the attribute.
"Lorem ipsum"
A unique, human-readable slug to access the attribute through URLs and API calls. Formatted in snake case.
"my-attribute"
The type of the attribute. This value affects the possible config
values. Attributes of type "status" are not supported on objects.
text
, number
, checkbox
, currency
, date
, timestamp
, rating
, status
, select
, record-reference
, actor-reference
, location
, domain
, email-address
, phone-number
"text"
When is_required
is true
, new records/entries must have a value for this attribute. If false
, values may be null
. This value does not affect existing data and you do not need to backfill null
values if changing is_required
from false
to true
.
true
Whether or not new values for this attribute must be unique. Uniqueness restrictions are only applied to new data and do not apply retroactively to previously created data.
true
Whether or not this attribute can have multiple values. Multiselect is only available on some value types.
true
Configuration available for attributes of type "currency".
The ISO4217 code representing the currency that values for this attribute should be stored in.
AUD
, BRL
, BEL
, CAD
, CNY
, COP
, CZK
, DKK
, EUR
, HKD
, ISK
, INR
, ILS
, JPY
, KRW
, MYR
, MXN
, NTD
, NZD
, NOK
, PEN
, PHP
, PLN
, GBP
, SGD
, ZAR
, SEK
, CHF
, AED
, USD
"USD"
How the currency should be displayed across the app. "code" will display the ISO currency code e.g. "USD", "name" will display the localized currency name e.g. "British pound", "narrowSymbol" will display "$1" instead of "US$1" and "symbol" will display a localized currency symbol such as "$".
code
, name
, narrowSymbol
, symbol
"symbol"
Configuration available for attributes of type "record-reference".
A list of slugs or UUIDs to indicate which objects records are allowed to belong to. Leave empty to to allow records from all object types.
The default value for this attribute. Static values are used to directly populate values using their contents. Dynamic values are used to lookup data at the point of creation. For example, you could use a dynamic value to insert a value for the currently logged in user. Which default values are available is dependent on the type of the attribute. Default values are not currently supported on people or company objects.
dynamic
"dynamic"
For actor reference attributes, you may pass a dynamic value of "current-user"
. When creating new records or entries, this will cause the actor reference value to be populated with either the workspace member or API token that created the record/entry.
current-user
"current-user"
{
"type": "static",
"template": [{ "value": 5 }]
}
Response
Success
A UUID representing the workspace this attribute belongs to.
"14beef7a-99f7-4534-a87e-70b564330a4c"
A UUID to identify the object or list that this attribute belongs to
"97052eb9-e65e-443f-a297-f2d9a4a7f795"
A UUID to identify this attribute.
"41252299-f8c7-4b5e-99c9-4ff8321d2f96"
A title for the attribute, to be displayed across the app.
"Rating"
A text description of the attribute.
"A rating attribute"
A unique slug for the attribute for use in API responses and URLs. Formatted in snake case.
"my-rating"
The type of the attribute.
text
, number
, checkbox
, currency
, date
, timestamp
, rating
, status
, select
, record-reference
, actor-reference
, location
, domain
, email-address
, phone-number
, interaction
, personal-name
"text"
true
if this is an Attio system-defined attribute, false
if defined by a user or non-Attio system.
true
Whether or not this attribute can be written to. Can only be false when is_system_attribute
is true
(user-defined attributes are always writeable). If false
, this usually means the attribute is enriched by Attio.
true
When is_required
is true
, new records/entries must have a value for this attribute. If false
, values may be null
. This value does not affect existing data and you do not need to backfill null
values if changing is_required
from false
to true
.
true
Whether or not new values for this attribute must be unique. Uniqueness restrictions are only applied to new data and do not apply retroactively to previously created data.
true
Whether or not this attribute can have multiple values. Multiselect is only available on some value types.
true
Whether this attribute has a default value enabled. Must be true
when is_required
is true
.
true
Whether this attribute has been archived. Archived attributes are hidden from most UI, but can be restored either over the API or in workspace settings. See the guide on archiving and deletingfor more information.
false
The default value for this attribute. Static values are used to directly populate values using their contents. Dynamic values are used to lookup data at the point of creation. For example, you could use a dynamic value to insert a value for the currently logged in user. Which default values are available is dependent on the type of the attribute.
dynamic
"dynamic"
For actor reference attributes, you may pass a dynamic value of "current-user"
. When creating new records or entries, this will cause the actor reference value to be populated with either the workspace member or API token that created the record/entry.
current-user
"current-user"
If this attribute is related to another attribute, this is an object that includes an id
property that identifies the other attribute. null
means no relationship exists. See the help center for more details about relationship attributes.
A UUID representing the workspace this attribute belongs to.
"14beef7a-99f7-4534-a87e-70b564330a4c"
A UUID to identify the object or list that this attribute belongs to
"97052eb9-e65e-443f-a297-f2d9a4a7f795"
A UUID to identify this attribute.
"41252299-f8c7-4b5e-99c9-4ff8321d2f96"
When this attribute was created.
"2022-11-21T13:22:49.061281000Z"
Additional, type-dependent configuration for the attribute.
Configuration available for attributes of type "currency".
The ISO4217 code representing the currency that values for this attribute should be stored in.
AUD
, BRL
, BEL
, CAD
, CNY
, COP
, CZK
, DKK
, EUR
, HKD
, ISK
, INR
, ILS
, JPY
, KRW
, MYR
, MXN
, NTD
, NZD
, NOK
, PEN
, PHP
, PLN
, GBP
, SGD
, ZAR
, SEK
, CHF
, AED
, USD
"USD"
How the currency should be displayed across the app. "code" will display the ISO currency code e.g. "USD", "name" will display the localized currency name e.g. "British pound", "narrowSymbol" will display "$1" instead of "US$1" and "symbol" will display a localized currency symbol such as "$".
code
, name
, narrowSymbol
, symbol
"code"
Configuration available for attributes of type "record-reference".
A list of UUIDs to indicate which objects records are allowed to belong to. Leave empty to to allow records from all object types.
{
"id": {
"workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
"object_id": "97052eb9-e65e-443f-a297-f2d9a4a7f795",
"attribute_id": "41252299-f8c7-4b5e-99c9-4ff8321d2f96"
},
"title": "Rating",
"description": "Rating of the record out of 5",
"api_slug": "Rating",
"type": "rating",
"is_system_attribute": false,
"is_writable": true,
"is_required": false,
"is_unique": false,
"is_multiselect": false,
"is_default_value_enabled": false,
"is_archived": false,
"default_value": null,
"relationship": null,
"created_at": "2021-11-21T13:22:49.061Z",
"config": {
"currency": {
"default_currency_code": null,
"display_type": null
},
"record_reference": { "allowed_object_ids": null }
}
}
Was this page helpful?
curl --request POST \
--url https://api.attio.com/v2/{target}/{identifier}/attributes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"data": {
"title": "Your Attribute",
"description": "Lorem ipsum",
"api_slug": "my-attribute",
"type": "text",
"is_required": true,
"is_unique": true,
"is_multiselect": true,
"default_value": {
"type": "static",
"template": [
{
"value": 5
}
]
},
"config": {
"currency": {
"default_currency_code": "USD",
"display_type": "symbol"
},
"record_reference": {
"allowed_objects": [
"people"
]
}
}
}
}'
{
"data": {
"id": {
"workspace_id": "14beef7a-99f7-4534-a87e-70b564330a4c",
"object_id": "97052eb9-e65e-443f-a297-f2d9a4a7f795",
"attribute_id": "41252299-f8c7-4b5e-99c9-4ff8321d2f96"
},
"title": "Rating",
"description": "Rating of the record out of 5",
"api_slug": "Rating",
"type": "rating",
"is_system_attribute": false,
"is_writable": true,
"is_required": false,
"is_unique": false,
"is_multiselect": false,
"is_default_value_enabled": false,
"is_archived": false,
"default_value": null,
"relationship": null,
"created_at": "2021-11-21T13:22:49.061Z",
"config": {
"currency": {
"default_currency_code": null,
"display_type": null
},
"record_reference": {
"allowed_object_ids": null
}
}
}
}