# ink.branchline.createBookmark

> Published by [branchline.ink](https://lexicon.garden/identity/did:plc:brvu7akhdvsqcomb67pafw25)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:brvu7akhdvsqcomb67pafw25/ink.branchline.createBookmark)
- [Documentation](https://lexicon.garden/lexicon/did:plc:brvu7akhdvsqcomb67pafw25/ink.branchline.createBookmark/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:brvu7akhdvsqcomb67pafw25/ink.branchline.createBookmark/examples)

## Definitions

### `ink.branchline.createBookmark`

**Type**: `procedure`

Bookmark a bud. The caller must be signed in. If the caller already has a bookmark in the same story whose subject is an ancestor or descendant of the new subject, the existing record is rewritten in place (putRecord) so the bookmark list stays one-per-thread. Otherwise a new ink.branchline.bookmark record is created in the caller's PDS and mirrored into the local read cache.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `subjectUri` | `string` (at-uri) | Yes | AT-URI of the ink.branchline.bud record to bookmark. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `cid` | `string` (cid) | Yes |  |
| `uri` | `string` (at-uri) | Yes |  |

#### Errors

- **Unauthorized**: The caller is not signed in.
- **SubjectNotFound**: The subject bud does not exist in the AppView.
- **DuplicateBookmark**: The caller already has a bookmark on this exact subject.

## Raw Schema

```json
{
  "id": "ink.branchline.createBookmark",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "subjectUri"
          ],
          "properties": {
            "subjectUri": {
              "type": "string",
              "format": "at-uri",
              "description": "AT-URI of the ink.branchline.bud record to bookmark."
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "Unauthorized",
          "description": "The caller is not signed in."
        },
        {
          "name": "SubjectNotFound",
          "description": "The subject bud does not exist in the AppView."
        },
        {
          "name": "DuplicateBookmark",
          "description": "The caller already has a bookmark on this exact subject."
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "uri",
            "cid"
          ],
          "properties": {
            "cid": {
              "type": "string",
              "format": "cid"
            },
            "uri": {
              "type": "string",
              "format": "at-uri"
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Bookmark a bud. The caller must be signed in. If the caller already has a bookmark in the same story whose subject is an ancestor or descendant of the new subject, the existing record is rewritten in place (putRecord) so the bookmark list stays one-per-thread. Otherwise a new ink.branchline.bookmark record is created in the caller's PDS and mirrored into the local read cache."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
