# social.colibri.beta.bridge.replaceAvatar

> Published by [colibri.social](https://lexicon.garden/identity/did:plc:mprdjqjluoswa7awzggaggj3)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.bridge.replaceAvatar)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.bridge.replaceAvatar/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.bridge.replaceAvatar/examples)

## Definitions

### `social.colibri.beta.bridge.replaceAvatar`

**Type**: `procedure`

Swaps the avatar on every message and thread attributed to one remote author of this registration, so the previous avatar blob is no longer referenced.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `avatar` | `blob` | No | The new avatar, uploaded with uploadBlob. Leave it out to remove the avatar. |
| `community` | `string` (did) | Yes | The community the registration belongs to. |
| `registration` | `string` (tid) | Yes | Record key of the registration. |
| `remoteId` | `string` | Yes | The author's id on the other service, as attributed on their records. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `updated` | `integer` | Yes | How many records now carry the new avatar. |

#### Errors

- **AuthRequired**: The request is missing, malformed, or unverifiable service auth.
- **CommunityNotFound**: No community exists at the given DID.
- **RegistrationNotFound**: The community has no bridge registration with that id.
- **Forbidden**: The caller is not the bridge this registration belongs to.
- **CredentialsUnavailable**: The AppView cannot act as the community because its stored credentials are missing or unusable.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Swaps the avatar on every message and thread attributed to one remote author of this registration, so the previous avatar blob is no longer referenced.",
      "errors": [
        {
          "description": "The request is missing, malformed, or unverifiable service auth.",
          "name": "AuthRequired"
        },
        {
          "description": "No community exists at the given DID.",
          "name": "CommunityNotFound"
        },
        {
          "description": "The community has no bridge registration with that id.",
          "name": "RegistrationNotFound"
        },
        {
          "description": "The caller is not the bridge this registration belongs to.",
          "name": "Forbidden"
        },
        {
          "description": "The AppView cannot act as the community because its stored credentials are missing or unusable.",
          "name": "CredentialsUnavailable"
        }
      ],
      "input": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "avatar": {
              "accept": [
                "image/png",
                "image/jpeg",
                "image/gif",
                "image/webp"
              ],
              "description": "The new avatar, uploaded with uploadBlob. Leave it out to remove the avatar.",
              "maxSize": 1000000,
              "type": "blob"
            },
            "community": {
              "description": "The community the registration belongs to.",
              "format": "did",
              "type": "string"
            },
            "registration": {
              "description": "Record key of the registration.",
              "format": "tid",
              "type": "string"
            },
            "remoteId": {
              "description": "The author's id on the other service, as attributed on their records.",
              "maxLength": 256,
              "type": "string"
            }
          },
          "required": [
            "community",
            "registration",
            "remoteId"
          ],
          "type": "object"
        }
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "updated": {
              "description": "How many records now carry the new avatar.",
              "minimum": 0,
              "type": "integer"
            }
          },
          "required": [
            "updated"
          ],
          "type": "object"
        }
      },
      "type": "procedure"
    }
  },
  "id": "social.colibri.beta.bridge.replaceAvatar",
  "lexicon": 1
}
```
