provider Project avatars POST
/rest/api/3/project/{projectIdOrKey}/avatar2 @utdk/jira
/rest/api/3/project/{projectIdOrKey}/avatar2 Load project avatar
Loads an avatar for a project.
Specify the avatar's local file location in the body of the request. Also, include the following headers:
* `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special Headers](#special-request-headers).
* `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG.
For example:
`curl --request POST `
`--user email@example.com:<api_token> `
`--header 'X-Atlassian-Token: no-check' `
`--header 'Content-Type: image/< image_type>' `
`--data-binary "<@/path/to/file/with/your/avatar>" `
`--url 'https://your-domain.atlassian.net/rest/api/3/project/{projectIdOrKey}/avatar2'`
The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of the image. The length of the square's sides is set to the smaller of the height or width of the image.
The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size.
After creating the avatar use [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to set it as the project's displayed avatar.
**[Permissions](#permissions) required:** *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg).
- projectIdOrKey path required
- The ID or (case-sensitive) key of the project.
- string
- x query
- The X coordinate of the top-left corner of the crop region.
- integer
- y query
- The Y coordinate of the top-left corner of the crop region.
- integer
- size query
- The length of each side of the crop region.
- integer
Try it
Authentication
Configure credentials for The Jira Cloud platform REST API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.
Saved automatically to browser storage.
Code snippet
Updates live as you fill in the form above.
TypeScript
import jira from '@utdk/jira';
await jira.createprojectavatar({
"x": 0,
"y": 0,
"size": 0
})