Skip to content

Update Look

This endpoint updates look data, including description, tag positions and item associations.

Method: PATCH
Path: /resources/looks/<id>

Request must originate from the owner of the look (or an admin user) and include an Authorization header with a valid Bearer token.

  • description : string
    • the text description of the look
  • items : string[]
    • item ids to associate with the look, replacing any existing items
  • tags: {itemId: string; positionX: number; positionY: number}[]
    • array of item ids and desired tag positions (value between 0 and 1)
Terminal window
$ curl -X "PATCH" "/resources/looks/<lookId>" \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{"description": "Check out my amazing outfit!"}' \
| jq .
{
"id": "<cuid>",
"ownerId": "<cuid>",
"description": "Check out my amazing outfit!",
"createdAt": "2024-08-27 01:27:34.269996+00",
"updatedAt": "2024-08-27 01:27:34.269996+00",
. . .
. . .
}
Terminal window
$ curl -X "PATCH" "/resources/looks/<lookId>" \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"items": [
"m1nnqcjmwlisivitu4o6yabi",
"g7vq4azel6sup0i1ntilylgk",
"ije88a7jclrriwsnapulj06j" ]}' \
| jq .
{
"id": "<cuid>",
"ownerId": "<cuid>",
"description": "Check out my amazing outfit!",
"items": [
{
"id": "m1nnqcjmwlisivitu4o6yabi"
. . .
},
{
"id": "g7vq4azel6sup0i1ntilylgk"
. . .
},
{
"id": "ije88a7jclrriwsnapulj06j"
. . .
},
]
}
Terminal window
$ curl -X "PATCH" "/resources/looks/<lookId>" \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"items": [
"m1nnqcjmwlisivitu4o6yabi",
"ije88a7jclrriwsnapulj06j"
]}' \
| jq .
{
"id": "<cuid>",
"ownerId": "<cuid>",
"description": "Check out my amazing outfit!",
"items": [
{
"id": "m1nnqcjmwlisivitu4o6yabi"
. . .
},
{
"id": "ije88a7jclrriwsnapulj06j"
. . .
},
]
}
Terminal window
$ curl -X "PATCH" "/resources/looks/<lookId>" \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"tags": [{"itemId":"m1nnqcjmwlisivitu4o6yabi",
"positionX": 0.41, "positionY": 0.61}] }' \
| jq .
{
"id": "<cuid>",
"ownerId": "<cuid>",
"description": "Check out my amazing outfit!",
. . .
"tags": [
{
"positionX": 0.41,
"positionY": 0.61,
"itemId": "m1nnqcjmwlisivitu4o6yabi"
},
}
Terminal window
$ curl -X "PATCH" "/resources/looks/<lookId>" \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json; charset=utf-8' \
-d $'{
"items": []}' \
| jq .
{
"id": "<cuid>",
"ownerId": "<cuid>",
"description": "Check out my amazing outfit!",
"items": []
. . .
}