For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
SupportDeveloper ForumLogin
  • Overview
    • Introduction
    • Getting Started
    • Integration Example (PSA)
    • Authentication
    • Error Handling
    • Pagination
    • Filtering
    • Ordering
    • Rate Limits
    • Permissions
    • Webhooks
    • MCP Server
    • Versioning
    • Changelog
    • Support
  • API v1 Reference
    • Projects Overview
    • Tasks Overview
    • Time Tracking Overview
    • Documents Overview
    • Search Overview
    • Companies Overview
    • Users Overview
    • Files & Images Overview
    • Custom Fields Overview
    • Workload & Planning Overview
    • Project Templates Overview
    • Workflows Overview
    • Login & Access Overview
    • API Management Overview
LogoLogo
SupportDeveloper ForumLogin
On this page
  • Upload a file to a task
  • Upload a profile image
API v1 Reference

Files & Images

Was this page helpful?
Edit this page
Previous

Returns the content of the file with the specified id.

Next
Built with

awork allows you to upload files and images to tasks, projects, comments and many other entities.

Upload a file to a task

Uploading a file takes three steps.

  1. Generate upload URL
  2. Upload the file
  3. Link it with an entity such as a task
Generate Upload URL
1curl -X POST https://api.awork.com/api/v1/files/generateUploadURL \
2 -H 'Content-Type: application/json'

The response will look like this:

1{
2 "uploadUrl": "https://upload.awork.com/...",
3 "uploadId": "123e4567-e89b-12d3-a456-426614174000"
4}

Then use the returned uploadUrl to upload the file:

Upload File
1curl -X PUT https://upload.awork.com/... \
2 -H 'Content-Type: image/png' \
3 -H 'x-ms-blob-type: BlockBlob' \
4 --data-binary @/path/to/file.png

Once that is done, link the uploaded file with a task:

Link File with Task
1curl -X POST https://api.awork.com/api/v1/tasks/123e4567-e89b-12d3-a456-426614174000/files/byUploadId \
2 -H 'Content-Type: application/json' \
3 -d '{
4 "uploadId": "123e4567-e89b-12d3-a456-426614174000",
5 "fileName": "file.png"
6 }'

Upload a profile image

Several entities in awork support profile images. This is how you can upload an image for a project profile icon:

Request
1curl -X POST https://api.awork.com/api/v1/files/images/projects/123e4567-e89b-12d3-a456-426614174000 \
2 -H 'Content-Type: multipart/form-data' \
3 -F 'File=@/path/to/file.png'

See more on working with files and images in the Help Center.