---
agentTools:
  projectIndex: https://elai.readme.io/llms.txt
---

# Update avatar

Use this method to set your custom avatar name and id, and to upload your video avatar's footage

> 📘 How to create your footage?
>
> Use our recomendations and instructions with best practices described [here](https://drive.google.com/file/d/1W9rA_KDGVZYywUCbdNVn0JHU6hVKb2kV)

## Request Examples

```json Selfie avatar
{
	"name": "Selfie avatar",
	"code": "my_custom_id",
	"url": "https://drive.google.com/file/d/1W9rA_KDGVZYywUCbdNVn0JHU6hVKb2kV/edit"
}
```
```json Studio avatar
{
	"name": "Studio avatar",
	"code": "my_custom_id",
	"url": "https://drive.google.com/file/d/1W9rA_KDGVZYywUCbdNVn0JHU6hVKb2kV/edit"
}
```
```json Mascot avatar
{
	"name": "Mascot avatar",
	"code": "my_custom_id",
	"images": [
    {
      "name": "my_photo.png",
      "data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGsAAABsCAYAAABtuky0AAAA4WlD..."
    },
    {
      "name": "my_photo2.png",
      "data": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGsAAABsCAYAAABtuky0AAAA4WlD..."
    }
  ]
}
```

# OpenAPI definition

````json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Elai Public API",
    "version": "1.0",
    "description": "Every endpoint below is served under `https://apis.elai.io/api/v1`.\n\n## Authentication\n\nSend your workspace API token as a bearer token on every request:\n\n```\nAuthorization: Bearer <your-api-token>\n```\n\nGenerate and rotate the token in the Elai web app under **Settings → API**, or through\n`POST /generateToken`. The token is scoped to one **workspace** and authenticates as that\nworkspace's admin user — it is not tied to an individual person, and it carries admin rights\ninside that workspace.\n\nA request with a missing, unknown or revoked token gets a bare `401` with no response body.\n\n> **Organizations on the Unlimited plan cannot use the API.** Their requests are rejected with the\n> same bare `401` as an invalid token, with nothing to distinguish the two. If a valid, freshly\n> generated token returns `401` on every endpoint, check the plan first.\n\n## Errors\n\nFailures carry a JSON body of the shape `{ \"message\": \"...\" }`. Validation failures on the newer\nendpoints may add an `errors` array naming the offending fields. `401` is the exception: it has no\nbody at all.\n\nBoth render endpoints are **fire-and-forget** — they queue work and return immediately, so a\n`200` means \"accepted\", not \"rendered\". Render failures surface only through the `video_error`\nwebhook, never as an HTTP error on the call that started the render.\n\n## Scope\n\nThis reference is generated from the running code rather than maintained by hand, so it cannot\nquietly fall behind the API it describes. It documents 96 operations across the\n`/api/v1` surface.\n\nEndpoints are grouped by subject in the sidebar. If something you need is missing, or an endpoint\ndoes not behave as described here, tell us.\n\n---\n\n_Generated from `chore/web-4760/api-v1-reference-build` at `5289745d` on 2026-09-04._"
  },
  "servers": [
    {
      "url": "https://apis.elai.io/api/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "bearer",
        "x-default": "SECRET_KEY"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/avatars/{id}": {
      "patch": {
        "summary": "Update avatar",
        "description": "Use this method to set your custom avatar name and id, and to upload your video avatar's footage",
        "operationId": "update-avatar",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Avatar '_id'. You should get this prop after fetching avatar list. For example '64ba634100bc80a3d3eb9674'",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Avatar's name"
                  },
                  "code": {
                    "type": "string",
                    "description": "Custom code for avatar. If skipped avatar code will be generated from name, e.g. Avatar Name → avatar_name"
                  },
                  "url": {
                    "type": "string",
                    "description": "Studio and selfie types of avatars only. Link to a folder with your footage, for example at Google Drive. Don't forget to share it with avatars@elai.io."
                  },
                  "images": {
                    "type": "array",
                    "description": "Mascot avatar only. Array of files. Only images accepted.",
                    "items": {
                      "properties": {
                        "name": {
                          "type": "string",
                          "description": "Original image name with extension"
                        },
                        "data": {
                          "type": "string",
                          "description": "Data buffer in base64 format"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "id": {
                    "type": "string",
                    "deprecated": true,
                    "description": "Deprecated alias of `code`, still accepted. Use `code` instead."
                  },
                  "colorCorrection": {
                    "type": "string",
                    "description": "Studio and selfie avatars only. Colour-correction hint stored with the footage."
                  }
                }
              },
              "examples": {
                "Selfie": {
                  "value": {
                    "name": "Selfie avatar",
                    "id": "my_custom_id",
                    "url": "https://drive.google.com/file/d/1W9rA_KDGVZYywUCbdNVn0JHU6hVKb2kV/edit"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {}
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": {}
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "javascript",
              "code": "const formaData = {\n  url: 'https://drive.google.com/file/d/1W9rA_KDGVZYywUCbdNVn0JHU6hVKb2kV',\n  name: 'My Avatar',\n  colorCorrection: true\n}\nconst avatarId='64d0b16d314107e8c5c29c52'\nconst data = new FormData()\nfileList.forEach((file) => data.append('images', file))\ndata.append('url', formData.url)\ndata.append('name', formData.name)\ndata.append('colorCorrection', formData.colorCorrection)\nconst result = await axios({\n  method: 'PATCH',\n  url: `https://apis.elai.io/api/v1/avatars/${avatarId}`,\n  headers: {\n    \"Authorization\": \"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6ImFjY2VzcyIsInR5cGUiOiJhY2Nlc3MifQ.eyJ1c2VySWQiOjEsImFjY291bnRJZCI6MSwiaWF0IjoxNTExMzMwMzg5LCJleHAiOjE1MTM5MjIzODksImF1ZCI6Imh0dHBzOi8veW91cmRvbWFpbi5jb20iLCJpc3MiOiJmZWF0aGVycyIsInN1YiI6ImFub255bW91cyJ9.HWk7qJ0uK6SEi8qSeeB6-TGslDlZOTpG51U6kVi8nYc\"\n  },\n  data,\n})\nreturn result",
              "name": "Javascript"
            }
          ],
          "samples-languages": [
            "javascript"
          ]
        },
        "tags": [
          "Avatars"
        ]
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "tags": [
    {
      "name": "Avatars",
      "description": "The avatar catalog, and submitting footage for a custom avatar."
    }
  ],
  "_id": {
    "buffer": {
      "0": 106,
      "1": 154,
      "2": 229,
      "3": 101,
      "4": 201,
      "5": 178,
      "6": 243,
      "7": 252,
      "8": 223,
      "9": 58,
      "10": 69,
      "11": 151
    }
  }
}
````