> For the complete documentation index, see [llms.txt](https://navixy.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://navixy.com/docs/navixy-api/user-api/resources/field-service/employee/avatar.md).

# Employee avatar

The icon shown for an employee, assigned from the built-in set or uploaded.

An employee's avatar is the icon shown for them in the interface. It cannot be set through `employee/update`: use `avatar/assign` to pick one of the built-in icons, or `avatar/upload` to supply an image.

An uploaded avatar is served from `/employee/avatars/`, for example `https://api.eu.navixy.com/v2/static/employee/avatars/abcdef123456789.png`. The upload returns `avatar_file_name`, which [`employee/list`](/docs/navixy-api/user-api/resources/field-service/employee.md#post-employee-list) also returns.

The upload is a multipart request rather than JSON, with the image in a part named `file`, and its MIME type must be one of `image/jpeg`, `image/pjpeg`, `image/png`, `image/gif`, or `image/webp`.

## API actions

API base path: `/employee/avatar`.

***

*Required sub-user rights:* `employee_update`.

## Assign employee icon

> Assign an icon from the standard icon set to an employee.\
> \
> Set \`icon\_id\` to null to use an uploaded avatar instead of an icon.\
> \
> Also accepts GET with the same parameters as query-string values.\
> \
> Requires the \`employee\_update\` right.

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"tags":[{"name":"Employees","description":"Employees and drivers, their avatars, spreadsheet import, and the departments they belong to. All resources under the /employee/ and /department/ paths."}],"servers":[{"url":"https://api.eu.navixy.com/v2","description":"Navixy production server on European platform"},{"url":"https://api.us.navixy.com/v2","description":"Navixy production server on American platform"},{"url":"https://api.me.navixy.com/v2","description":"Navixy production server on Middle East platform"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","description":"Either a user session hash or an API key, with the \"NVX \" prefix, for example \"NVX 22eac1c27af4be7b9d04da2ce1af111b\". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.","name":"Authorization","in":"header"}},"responses":{"OK":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"`true` if request finished successfully.","readOnly":true}}}}}},"ResponseError":{"description":"Error response object","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Always false."},"status":{"type":"object","description":"Error status. Present only when an error occurred.","properties":{"code":{"type":"integer","description":"An error code in this API, not an HTTP code."},"description":{"type":"string","description":"An error description."}}},"errors":{"type":"array","description":"Per-parameter detail, returned with validation failures such as error code 7. A parameter name here may be an internal field name rather than the documented parameter name.","items":{"type":"object","properties":{"parameter":{"type":"string","description":"Name of the parameter that failed validation."},"error":{"type":"string","description":"What was wrong with it."}}}}}}}}}}},"paths":{"/employee/avatar/assign":{"post":{"tags":["Employees"],"summary":"Assign employee icon","description":"Assign an icon from the standard icon set to an employee.\n\nSet `icon_id` to null to use an uploaded avatar instead of an icon.\n\nAlso accepts GET with the same parameters as query-string values.\n\nRequires the `employee_update` right.","operationId":"employeeAvatarAssign","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"employee_id":{"type":"integer","description":"ID of the employee.","minimum":1},"icon_id":{"type":["integer","null"],"description":"Optional. ID of the icon. Null means use the uploaded avatar instead."}},"required":["employee_id"]}}}},"responses":{"200":{"description":"Icon assigned","$ref":"#/components/responses/OK"},"400":{"description":"Bad request. The response body carries the API-level error code in `status.code`. Validation failures also include an `errors` array naming each offending parameter.","$ref":"#/components/responses/ResponseError"},"default":{"$ref":"#/components/responses/ResponseError"}}}}}}
```

#### Errors

These errors come in addition to the [general error codes](/docs/navixy-api/general/errors.md#error-codes):

* 201 - Not found in the database - when employee/driver with `employee_id` not found.

***

Uploaded avatars become available from /employee/avatars/ e.g. `https://api.eu.navixy.com/v2/static/employee/avatars/abcdef123456789.png`.

**avatar\_file\_name** returned in response and will be returned from [/employee/list](/docs/navixy-api/user-api/resources/field-service/employee.md#post-employee-list).

**MUST** be a POST multipart request (multipart/form-data), with one of the parts being an image file upload (with the name `file`).

File part **mime** type must be one of:

* `image/jpeg`
* `image/pjpeg`
* `image/png`
* `image/gif`
* `image/webp`

*Required sub-user rights:* `employee_update`.

## Upload employee avatar

> Upload an avatar image for an employee.\
> \
> \*\*This is a multipart request\*\*, not JSON: \`multipart/form-data\` with the image in a part named \`file\`.\
> \
> The returned name is what \`employee/list\` reports as \`avatar\_file\_name\`.\
> \
> If \`redirect\_target\` is passed, the response is a redirect to that URL with \`response=\<urlencoded response json>\` appended.\
> \
> Requires the \`employee\_update\` right.

```json
{"openapi":"3.1.0","info":{"title":"Navixy Platform API","version":"1.0.0"},"tags":[{"name":"Employees","description":"Employees and drivers, their avatars, spreadsheet import, and the departments they belong to. All resources under the /employee/ and /department/ paths."}],"servers":[{"url":"https://api.eu.navixy.com/v2","description":"Navixy production server on European platform"},{"url":"https://api.us.navixy.com/v2","description":"Navixy production server on American platform"},{"url":"https://api.me.navixy.com/v2","description":"Navixy production server on Middle East platform"}],"security":[{"api_key":[]}],"components":{"securitySchemes":{"api_key":{"type":"apiKey","description":"Either a user session hash or an API key, with the \"NVX \" prefix, for example \"NVX 22eac1c27af4be7b9d04da2ce1af111b\". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.","name":"Authorization","in":"header"}},"responses":{"ResponseError":{"description":"Error response object","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"Always false."},"status":{"type":"object","description":"Error status. Present only when an error occurred.","properties":{"code":{"type":"integer","description":"An error code in this API, not an HTTP code."},"description":{"type":"string","description":"An error description."}}},"errors":{"type":"array","description":"Per-parameter detail, returned with validation failures such as error code 7. A parameter name here may be an internal field name rather than the documented parameter name.","items":{"type":"object","properties":{"parameter":{"type":"string","description":"Name of the parameter that failed validation."},"error":{"type":"string","description":"What was wrong with it."}}}}}}}}}}},"paths":{"/employee/avatar/upload":{"post":{"tags":["Employees"],"summary":"Upload employee avatar","description":"Upload an avatar image for an employee.\n\n**This is a multipart request**, not JSON: `multipart/form-data` with the image in a part named `file`.\n\nThe returned name is what `employee/list` reports as `avatar_file_name`.\n\nIf `redirect_target` is passed, the response is a redirect to that URL with `response=<urlencoded response json>` appended.\n\nRequires the `employee_update` right.","operationId":"employeeAvatarUpload","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"employee_id":{"type":"integer","description":"ID of the employee."},"file":{"type":"string","description":"The image file.","format":"binary"},"redirect_target":{"type":"string","description":"Optional. URL to redirect to after the upload."}},"required":["employee_id","file"]}}}},"responses":{"200":{"description":"The stored avatar","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"`true` if request finished successfully.","readOnly":true},"value":{"type":"string","description":"Avatar file name."}}}}}},"400":{"description":"Bad request. The response body carries the API-level error code in `status.code`. Validation failures also include an `errors` array naming each offending parameter.","$ref":"#/components/responses/ResponseError"},"402":{"description":"Error 233: the file part is missing. Error 234: the file has an unexpected MIME type. Error 254: the file could not be saved.","$ref":"#/components/responses/ResponseError"},"default":{"$ref":"#/components/responses/ResponseError"}}}}}}
```

#### Errors

These errors come in addition to the [general error codes](/docs/navixy-api/general/errors.md#error-codes):

* 201 - Not found in the database - when employee/driver with `employee_id` not found.
* 233 - No data file - if `file` part not passed.
* 234 - Invalid data format - if passed `file` with unexpected `mime` type.
* 254 - Cannot save file - on some file system errors.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://navixy.com/docs/navixy-api/user-api/resources/field-service/employee/avatar.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
