Upload file
POST
Swagger notice: Swagger 2.0 doesn't support file upload with a content-type different than application/x-www-form-urlencoded.
CoderSessionTokenheader
Coder-Session-Token<token>Content-Type*stringContent-Type must be application/x-tar or application/zip
Default
"application/x-tar"application/x-www-form-urlencoded- body
file*unknownFile to be uploaded. If using tar format, file must conform to ustar (pax may cause problems).
Returns existing file if duplicate
application/json- response
hash?stringFormat
uuidThe samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.
curl -X POST \ "$CODER_URL/api/v2/files" \ -H "Coder-Session-Token: $CODER_SESSION_TOKEN" \ -H "Content-Type: {Content-Type}" \ --data-binary "@{file}"Example Response
{ "hash": "19686d84-b10d-4f90-b18e-84fd3fa038fd"}