Update custom attribute in Account
curl --request PATCH \
--url https://app.yampi.ai/api/v1/accounts/{account_id}/custom_attribute_definitions/{id} \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"attribute_display_name": "Custom Attribute",
"attribute_display_type": 0,
"attribute_description": "This is a custom attribute",
"attribute_key": "custom_attribute",
"attribute_values": [
"value1",
"value2"
],
"attribute_model": 0,
"regex_pattern": "^[a-zA-Z0-9]+$",
"regex_cue": "Please enter a valid value"
}
'const options = {
method: 'PATCH',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
attribute_display_name: 'Custom Attribute',
attribute_display_type: 0,
attribute_description: 'This is a custom attribute',
attribute_key: 'custom_attribute',
attribute_values: ['value1', 'value2'],
attribute_model: 0,
regex_pattern: '^[a-zA-Z0-9]+$',
regex_cue: 'Please enter a valid value'
})
};
fetch('https://app.yampi.ai/api/v1/accounts/{account_id}/custom_attribute_definitions/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.yampi.ai/api/v1/accounts/{account_id}/custom_attribute_definitions/{id}"
payload = {
"attribute_display_name": "Custom Attribute",
"attribute_display_type": 0,
"attribute_description": "This is a custom attribute",
"attribute_key": "custom_attribute",
"attribute_values": ["value1", "value2"],
"attribute_model": 0,
"regex_pattern": "^[a-zA-Z0-9]+$",
"regex_cue": "Please enter a valid value"
}
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": 123,
"attribute_display_name": "<string>",
"attribute_display_type": "<string>",
"attribute_description": "<string>",
"attribute_key": "<string>",
"regex_pattern": "<string>",
"regex_cue": "<string>",
"attribute_values": "<string>",
"attribute_model": "<string>",
"default_value": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}Custom Attributes
Update custom attribute in Account
Update a custom attribute in account
PATCH
/
api
/
v1
/
accounts
/
{account_id}
/
custom_attribute_definitions
/
{id}
Update custom attribute in Account
curl --request PATCH \
--url https://app.yampi.ai/api/v1/accounts/{account_id}/custom_attribute_definitions/{id} \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"attribute_display_name": "Custom Attribute",
"attribute_display_type": 0,
"attribute_description": "This is a custom attribute",
"attribute_key": "custom_attribute",
"attribute_values": [
"value1",
"value2"
],
"attribute_model": 0,
"regex_pattern": "^[a-zA-Z0-9]+$",
"regex_cue": "Please enter a valid value"
}
'const options = {
method: 'PATCH',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
attribute_display_name: 'Custom Attribute',
attribute_display_type: 0,
attribute_description: 'This is a custom attribute',
attribute_key: 'custom_attribute',
attribute_values: ['value1', 'value2'],
attribute_model: 0,
regex_pattern: '^[a-zA-Z0-9]+$',
regex_cue: 'Please enter a valid value'
})
};
fetch('https://app.yampi.ai/api/v1/accounts/{account_id}/custom_attribute_definitions/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.yampi.ai/api/v1/accounts/{account_id}/custom_attribute_definitions/{id}"
payload = {
"attribute_display_name": "Custom Attribute",
"attribute_display_type": 0,
"attribute_description": "This is a custom attribute",
"attribute_key": "custom_attribute",
"attribute_values": ["value1", "value2"],
"attribute_model": 0,
"regex_pattern": "^[a-zA-Z0-9]+$",
"regex_cue": "Please enter a valid value"
}
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"id": 123,
"attribute_display_name": "<string>",
"attribute_display_type": "<string>",
"attribute_description": "<string>",
"attribute_key": "<string>",
"regex_pattern": "<string>",
"regex_cue": "<string>",
"attribute_values": "<string>",
"attribute_model": "<string>",
"default_value": "<string>",
"created_at": "<string>",
"updated_at": "<string>"
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}Authorizations
Path Parameters
Body
application/json
Response
Success