# social.colibri.beta.emoji.upload

> 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.emoji.upload)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.emoji.upload/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mprdjqjluoswa7awzggaggj3/social.colibri.beta.emoji.upload/examples)

## Definitions

### `social.colibri.beta.emoji.upload`

**Type**: `procedure`

Adds a custom emoji to a community. The bytes are uploaded to the community's own repo and the AppView writes the provider's record there with the community's credentials.

#### Input

**Encoding**: `image/*`

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `emoji` | `ref` → `social.colibri.beta.emoji.defs#emojiView` | Yes | The emoji as stored. |

#### Errors

- **AuthRequired**: The request is missing, malformed, or unverifiable service auth.
- **Forbidden**: The caller lacks the community.manage permission.
- **CommunityNotFound**: No community exists at the given DID.
- **InvalidName**: The name is not 2 to 32 characters of lowercase letters, digits and underscores.
- **NameTaken**: The community already has an emoji with this name.
- **PackNotFound**: No pack of this community exists at the given URI.
- **UnsupportedProvider**: The emoji provider is unknown, or it does not support the requested operation.
- **UnsupportedImage**: The bytes are not an image type the provider accepts.
- **ImageTooLarge**: The image exceeds the provider's size limit.
- **CredentialsUnavailable**: The AppView cannot act as the community because its stored credentials are missing or unusable.
- **UpstreamFailure**: A PDS call the AppView depends on failed.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Adds a custom emoji to a community. The bytes are uploaded to the community's own repo and the AppView writes the provider's record there with the community's credentials.",
      "errors": [
        {
          "description": "The request is missing, malformed, or unverifiable service auth.",
          "name": "AuthRequired"
        },
        {
          "description": "The caller lacks the community.manage permission.",
          "name": "Forbidden"
        },
        {
          "description": "No community exists at the given DID.",
          "name": "CommunityNotFound"
        },
        {
          "description": "The name is not 2 to 32 characters of lowercase letters, digits and underscores.",
          "name": "InvalidName"
        },
        {
          "description": "The community already has an emoji with this name.",
          "name": "NameTaken"
        },
        {
          "description": "No pack of this community exists at the given URI.",
          "name": "PackNotFound"
        },
        {
          "description": "The emoji provider is unknown, or it does not support the requested operation.",
          "name": "UnsupportedProvider"
        },
        {
          "description": "The bytes are not an image type the provider accepts.",
          "name": "UnsupportedImage"
        },
        {
          "description": "The image exceeds the provider's size limit.",
          "name": "ImageTooLarge"
        },
        {
          "description": "The AppView cannot act as the community because its stored credentials are missing or unusable.",
          "name": "CredentialsUnavailable"
        },
        {
          "description": "A PDS call the AppView depends on failed.",
          "name": "UpstreamFailure"
        }
      ],
      "input": {
        "description": "The raw image bytes. The provider sets the size limit and the accepted types, which is 128000 bytes of image/png, image/webp or image/gif for blue.moji. The content type is sniffed rather than trusted.",
        "encoding": "image/*"
      },
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "emoji": {
              "description": "The emoji as stored.",
              "ref": "social.colibri.beta.emoji.defs#emojiView",
              "type": "ref"
            }
          },
          "required": [
            "emoji"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "community": {
            "description": "The community that owns the emoji.",
            "format": "did",
            "type": "string"
          },
          "name": {
            "description": "The emoji's name without colons. Lowercase letters, digits and underscores.",
            "maxLength": 32,
            "minLength": 2,
            "type": "string"
          },
          "pack": {
            "description": "A pack of the community to add the emoji to.",
            "format": "at-uri",
            "type": "string"
          },
          "provider": {
            "description": "The emoji provider that writes the records. Defaults to the AppView's default provider.",
            "knownValues": [
              "blue.moji"
            ],
            "type": "string"
          }
        },
        "required": [
          "community",
          "name"
        ],
        "type": "params"
      },
      "type": "procedure"
    }
  },
  "id": "social.colibri.beta.emoji.upload",
  "lexicon": 1
}
```
