Update Look
This endpoint updates look data, including description, tag positions and item associations.
Method: PATCH
Path: /resources/looks/<id>
Permissions
Section titled “Permissions”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)
Examples
Section titled “Examples”Update Description
Section titled “Update Description”$ 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", . . . . . . }Add Three Items
Section titled “Add Three Items”$ 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" . . . }, ] }Remove Second Item
Section titled “Remove Second Item”$ 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" . . . }, ] }Update Tag Position
Section titled “Update Tag Position”$ 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" }, }Remove All Items
Section titled “Remove All Items”$ 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": [] . . . }