| title | Files |
|---|
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/files \
-H 'Accept: application/json' \
-H 'Content-Type: application/x-tar' \
-H 'Coder-Session-Token: API_KEY'POST /api/v2/files
Body parameter
file: string
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Content-Type |
header | string | true | Content-Type must be application/x-tar or application/zip |
body |
body | object | true | |
» file |
body | binary | true | File to be uploaded. If using tar format, file must conform to ustar (pax may cause problems). |
200 Response
{
"hash": "19686d84-b10d-4f90-b18e-84fd3fa038fd"
}| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Returns existing file if duplicate | codersdk.UploadResponse |
| 201 | Created | Returns newly created file | codersdk.UploadResponse |
| 413 | Payload Too Large | Request Entity Too Large | codersdk.Response |
To perform this operation, you must be authenticated. Learn more.
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/files/{fileID} \
-H 'Coder-Session-Token: API_KEY'GET /api/v2/files/{fileID}
| Name | In | Type | Required | Description |
|---|---|---|---|---|
fileID |
path | string(uuid) | true | File ID |
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK |
To perform this operation, you must be authenticated. Learn more.