Here is an update:
when I use this body
[
{
"type": "select",
"name": "Testing courses name",
"enums": [
{
"value": "Abc",
"sort": 1
},
{
"value": "Bcd",
"sort": 2
},
{
"value": "Cde",
"sort": 3
}
]
}
]
with this method URL
/v4/leads/custom_fields
I got a succesfull response, but it creates new custom field, not update
when I try to use code in body, like this
[
{
"type": "select",
"name": "Testing courses name",
"code": "2981521",
"enums": [
{
"value": "Abc",
"sort": 1
},
{
"value": "Bcd",
"sort": 2
},
{
"value": "Cde",
"sort": 3
}
]
}
]
I got an error
{
"validation-errors": [
{
"request_id": "0",
"errors": [
{
"code": "NotSupportedChoice",
"path": "code",
"detail": "The value you selected is not a valid choice."
}
]
}
],
"title": "Bad Request",
"type": "https://httpstatus.es/400",
"status": 400,
"detail": "Request validation failed"
}
but with an ID in URL like this
/v4/leads/custom_fields/2981521
I get an error
{
"validation-errors": [
{
"request_id": "0",
"errors": [
{
"code": "FieldNotExpected",
"path": "0",
"detail": "This field was not expected."
}
]
}
],
"title": "Bad Request",
"type": "https://httpstatus.es/400",
"status": 400,
"detail": "Request validation failed"
}
I dont know what to do, because I need to update custom field, not to create new.