# tools.kryphocron.feed.updatePostPrivate

> Change the audience of an existing postPrivate record in the writer's own repository. Only audienceList changes; the URI stays the same and the record CID changes. Replies are refused, since a reply's audience is its thread's.

- Kind: procedure
- Authority: feed.kryphocron.tools
- Lexicon: 1
- Published by [lexicons.kryphocron.tools](https://lexicon.garden/identity/did:plc:femlcrrqw5ja23dlsqc6qtgy), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:femlcrrqw5ja23dlsqc6qtgy/tools.kryphocron.feed.updatePostPrivate)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:femlcrrqw5ja23dlsqc6qtgy/tools.kryphocron.feed.updatePostPrivate/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:femlcrrqw5ja23dlsqc6qtgy/tools.kryphocron.feed.updatePostPrivate/analytics)

## Procedure (`tools.kryphocron.feed.updatePostPrivate`)

Type: procedure · POST

### Input (application/json)

- `audienceList` (string · at-uri, required): AT-URI of one of the writer's own policy.audience records.
- `repo` (string · did, required): DID of the writer's repository. Must be the authenticated account.
- `rkey` (string · record-key, required): Record key of the post to update.
  - Constraints: maxLength: 512
- `swapRecord` (string · cid): Compare and swap with the post's current record CID.

### Output (application/json)

- `cid` (string · cid, required): CID of the updated record.
- `uri` (string · at-uri, required)

### Errors

- `InvalidRequest`: The post does not exist or is a reply, or audienceList does not name an existing audience record of the writer's.
- `Forbidden`: The caller may not write to this repository, or the host does not allow this account private-tier writes.
- `UnsupportedNamespace`: The host does not have the private tier enabled.
- `InvalidSwap`: swapRecord did not match the post's current record CID.

## Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Change the audience of an existing postPrivate record in the writer's own repository. Only audienceList changes; the URI stays the same and the record CID changes. Replies are refused, since a reply's audience is its thread's.",
      "errors": [
        {
          "description": "The post does not exist or is a reply, or audienceList does not name an existing audience record of the writer's.",
          "name": "InvalidRequest"
        },
        {
          "description": "The caller may not write to this repository, or the host does not allow this account private-tier writes.",
          "name": "Forbidden"
        },
        {
          "description": "The host does not have the private tier enabled.",
          "name": "UnsupportedNamespace"
        },
        {
          "description": "swapRecord did not match the post's current record CID.",
          "name": "InvalidSwap"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "audienceList": {
              "description": "AT-URI of one of the writer's own policy.audience records.",
              "format": "at-uri",
              "type": "string"
            },
            "repo": {
              "description": "DID of the writer's repository. Must be the authenticated account.",
              "format": "did",
              "type": "string"
            },
            "rkey": {
              "description": "Record key of the post to update.",
              "format": "record-key",
              "maxLength": 512,
              "type": "string"
            },
            "swapRecord": {
              "description": "Compare and swap with the post's current record CID.",
              "format": "cid",
              "type": "string"
            }
          },
          "required": [
            "repo",
            "rkey",
            "audienceList"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "cid": {
              "description": "CID of the updated record.",
              "format": "cid",
              "type": "string"
            },
            "uri": {
              "format": "at-uri",
              "type": "string"
            }
          },
          "required": [
            "uri",
            "cid"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "tools.kryphocron.feed.updatePostPrivate",
  "lexicon": 1
}
```
