---
ai:
  exclude: true
search:
  tags:
    - user
    - POST
seo:
  description: >-
    Creates temporary avatar using multipart.… Reference for the POST
    /api/2/user/avatar/temporary endpoint in the Jira Software Data Center REST
    API Reference.
sidebar:
  label: Store temporary avatar using multipart
  badge: POST
title: Store temporary avatar using multipart
type: openapi-operation
---
Creates temporary avatar using multipart. The response is sent back as JSON stored in a textarea. This is because the client uses remote iframing to submit avatars using multipart. So we must send them a valid HTML page back from which the client parses the JSON from.
Creating a temporary avatar is part of a 3-step process in uploading a new avatar for a user: upload, crop, confirm. This endpoint allows you to use a multipart upload instead of sending the image directly as the request body.
You *must* use "avatar" as the name of the upload parameter:
curl -c cookiejar.txt -X POST -u admin:admin -H "X-Atlassian-Token: no-check" \
  -F "avatar=@mynewavatar.png;type=image/png" \
  'http://localhost:8090/jira/rest/api/2/user/avatar/temporary?username=admin'

`POST /api/2/user/avatar/temporary`

**Request body** (`multipart/form-data`, required)

The file data

**Responses**

- `201` — Returns temporary avatar cropping instructions embeded in HTML page. Error messages will also be embeded in the page.
- `401` — Returned if the user is not authenticated.
- `403` — Returned if the currently authenticated user does not have permission to store the avatar or XSRF token is invalid.
- `404` — Returned if user does NOT exist
- `500` — Returned if an error occurs while converting temporary avatar to real avatar

Response example, 201:

```json
{
  "cropperOffsetX": 50,
  "cropperOffsetY": 50,
  "cropperWidth": 120,
  "needsCropping": true,
  "url": "http://example.com/jira/secure/temporaryavatar?cropped=true"
}
```
