> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/api-reference/software-delivery-agent-apis/code-repository/upload.md).

# Upload

## POST /repos/{repo\_identifier}/uploads

> Repo artifact upload

```json
{"openapi":"3.0.0","info":{"title":"API Specification","version":"1.111.0"},"servers":[{"url":"gateway/code/api/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"scheme":"bearer","type":"http"}},"schemas":{"UploadResult":{"properties":{"file_path":{"type":"string"}},"type":"object"},"UsererrorError":{"properties":{"message":{"type":"string"},"values":{"additionalProperties":{},"type":"object"}},"type":"object"}}},"paths":{"/repos/{repo_identifier}/uploads":{"post":{"operationId":"repoArtifactUpload","parameters":[{"description":"Account Identifier for the Entity.","in":"query","name":"accountIdentifier","required":true,"schema":{"type":"string"}},{"description":"Organization Identifier for the Entity.","in":"query","name":"orgIdentifier","required":false,"schema":{"type":"string"}},{"description":"Project Identifier for the Entity.","in":"query","name":"projectIdentifier","required":false,"schema":{"type":"string"}},{"in":"path","name":"repo_identifier","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/octet-stream":{"schema":{}}},"description":"Binary file to upload","required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadResult"}}},"description":"Created"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsererrorError"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsererrorError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsererrorError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsererrorError"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsererrorError"}}},"description":"Internal Server Error"}},"summary":"Repo artifact upload","tags":["upload"]}}}}
```

## GET /repos/{repo\_identifier}/uploads/{file\_ref}

> Repo artifact download

```json
{"openapi":"3.0.0","info":{"title":"API Specification","version":"1.111.0"},"servers":[{"url":"gateway/code/api/v1"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"scheme":"bearer","type":"http"}},"schemas":{"UsererrorError":{"properties":{"message":{"type":"string"},"values":{"additionalProperties":{},"type":"object"}},"type":"object"}}},"paths":{"/repos/{repo_identifier}/uploads/{file_ref}":{"get":{"operationId":"repoArtifactDownload","parameters":[{"description":"Account Identifier for the Entity.","in":"query","name":"accountIdentifier","required":true,"schema":{"type":"string"}},{"description":"Organization Identifier for the Entity.","in":"query","name":"orgIdentifier","required":false,"schema":{"type":"string"}},{"description":"Project Identifier for the Entity.","in":"query","name":"projectIdentifier","required":false,"schema":{"type":"string"}},{"in":"path","name":"repo_identifier","required":true,"schema":{"type":"string"}},{"in":"path","name":"file_ref","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"307":{"description":"Temporary Redirect"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsererrorError"}}},"description":"Bad Request"},"401":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsererrorError"}}},"description":"Unauthorized"},"403":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsererrorError"}}},"description":"Forbidden"},"404":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsererrorError"}}},"description":"Not Found"},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsererrorError"}}},"description":"Internal Server Error"}},"summary":"Repo artifact download","tags":["upload"]}}}}
```
