Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
84fd528e
Commit
84fd528e
authored
Nov 13, 2020
by
Łukasz Korbasiewicz
Committed by
Marcin Sedlak-Jakubowski
Nov 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docs: Add example to upload a project avatar via API
parent
88cf7733
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
doc/api/projects.md
doc/api/projects.md
+32
-0
No files found.
doc/api/projects.md
View file @
84fd528e
...
...
@@ -1927,6 +1927,38 @@ The returned `url` is relative to the project path. The returned `full_path` is
the absolute path to the file. In Markdown contexts, the link is expanded when
the format in
`markdown`
is used.
## Upload a project avatar
Uploads an avatar to the specified project.
```
plaintext
PUT /projects/:id
```
| Attribute | Type | Required | Description |
|-----------|----------------|------------------------|-------------|
|
`avatar`
| string |
**{check-circle}**
Yes | The file to be uploaded. |
|
`id`
| integer/string |
**{check-circle}**
Yes | The ID or
[
URL-encoded path of the project
](
README.md#namespaced-path-encoding
)
. |
To upload an avatar from your file system, use the
`--form`
argument. This causes
cURL to post data using the header
`Content-Type: multipart/form-data`
. The
`file=`
parameter must point to an image file on your file system and be
preceded by
`@`
. For example:
Example request:
```
shell
curl
--request
PUT
--header
"PRIVATE-TOKEN: <your_access_token>"
--form
"avatar=@dk.png"
"https://gitlab.example.com/api/v4/projects/5"
```
Returned object:
```
json
{
"avatar_url"
:
"https://gitlab.example.com/uploads/-/system/project/avatar/2/dk.png"
}
```
## Share project with group
Allow to share project with group.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment