Перейти к содержимому

Update Collection

PATCH
/v1/collections/{collection_id}
curl --request PATCH \
--url https://api.cloud.agentums.ru/v1/collections/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "icon": "example", "is_hidden": true, "name": "example", "name_mode": "example", "parent_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "theme_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'

Переименовать папку, перевесить её в другую (parent_id) или в другую тему.

parent_id и theme_id меняются только если поле явно передано — в том числе значением null (вынести в корень / убрать из темы). Не передали поле — оно осталось как было; это разные вещи, и обнулить их случайным неполным телом нельзя.

Папку нельзя сделать потомком самой себя или своего потомка — сервер откажет.

collection_id
required
Collection Id
string format: uuid
Media typeapplication/json
CollectionUpdate
object
icon
Any of:
string
<= 32 characters
is_hidden
Any of:
boolean
name
Any of:
string
>= 1 characters <= 200 characters
name_mode
Any of:
string
<= 16 characters
parent_id
Any of:
string format: uuid
theme_id
Any of:
string format: uuid
Examplegenerated
{
"icon": "example",
"is_hidden": true,
"name": "example",
"name_mode": "example",
"parent_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"theme_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

Successful Response

Media typeapplication/json
CollectionOut
object
created_at
required
Created At
string format: date-time
has_note
Has Note
boolean
icon
Icon
string
""
id
required
Id
string format: uuid
is_hidden
Is Hidden
boolean
name
required
Name
string
name_mode
Any of:
string
object_count
Object Count
integer
0
parent_id
Any of:
string format: uuid
theme_id
Any of:
string format: uuid
Example
{
"has_note": false,
"icon": "",
"is_hidden": false,
"object_count": 0
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}