> For the complete documentation index, see [llms.txt](https://2sign-co-il.gitbook.io/2sign.co.il-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://2sign-co-il.gitbook.io/2sign.co.il-docs/tasks/upload-file.md).

# Upload File

You can either upload a new document or use an existing template when creating a task.

If you want to use a custom document, you must first upload the file using this API. The response will return a `PdfGuid` (and `TaskGuid` if relevant), which should then be passed to the task creation API in order to create the signature task with the uploaded file.

This API uploads the document and returns the GUID that will later be used in the task creation APIs for signing.

Header

```
Content-Type:multipart/form-data
Authorization:'Bearer token_value_from_login'
```

Request Body Example

```
{
    "Name":"fileUpload",
    "FileName":{"name":"doc-sign.pdf","mime":"application\/pdf","postname":"FileName"}
}
```

## POST /api/V2/BaseTasks/UploadFileForTask

> UploadFileForTask

```json
{"openapi":"3.1.1","info":{"title":"Customer API","version":"1.0.0"},"servers":[{"url":"/"}],"paths":{"/api/V2/BaseTasks/UploadFileForTask":{"post":{"tags":["BaseTasks"],"summary":"UploadFileForTask","operationId":"UploadFileForTask_POST","responses":{"200":{"description":"Success (Custom Example)","content":{"application/json":{"schema":{"type":"string"}}}},"400":{"description":"Bad Request"},"500":{"description":"Internal Server Error"}}}}}}
```
