# Bookmarks

## List bookmarks

`GET /bookmarks`

```json
{
  "tags": [
    "Bookmarks"
  ],
  "summary": "List bookmarks",
  "responses": {
    "200": {
      "description": "Every bookmark, across folders.",
      "content": {
        "application/json": {
          "schema": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Bookmark"
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    }
  }
}
```

## Create or update a bookmark

`POST /bookmarks`

```json
{
  "tags": [
    "Bookmarks"
  ],
  "summary": "Create or update a bookmark",
  "description": "With `id`, updates the bookmark; without `id`, creates it.\n\nA bookmark assigned to a folder appears in the bookmarks bar of every profile in that folder, inside **ShardX**. `folder: \"\"` applies to every profile. Only this managed folder is changed.\n\nThe update is applied at the next profile launch; a running profile does not see it.",
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/BookmarkRequest"
        }
      }
    }
  },
  "responses": {
    "200": {
      "description": "The saved bookmark.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Bookmark"
          }
        }
      }
    },
    "400": {
      "description": "`url` is required.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    }
  }
}
```

## Delete a bookmark

`DELETE /bookmarks/{id}`

```json
{
  "tags": [
    "Bookmarks"
  ],
  "summary": "Delete a bookmark",
  "description": "It leaves its profiles on their next launch.",
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "Deleted.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "deleted": {
                "type": "boolean",
                "example": true
              },
              "id": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    }
  }
}
```
