> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs-unsw-v6.advance-uac.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs-unsw-v6.advance-uac.com/_mcp/server.

# Get an upload URL for a supporting document

POST https://institution/applications/{id}/documents
Content-Type: application/json

Get a AWS S3 pre-signed URL to upload document/file directly for an application.

The response will contain the `id` of the document, presigned `uploadUrl`.

To upload the file, send PUT request (with the content of the file) to the `uploadUrl`. Ensure to add the header `Content-Type` with the same value of `contentType` of the body of the original request.

Reference: https://docs-unsw-v6.advance-uac.com/unsw-advance-institution-api/institution/applications/id/documents/get-an-upload-url-for-a-supporting-document

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /institution/applications/{id}/documents:
    post:
      operationId: Get an upload URL for a supporting document
      summary: Get an upload URL for a supporting document
      description: >-
        Get a AWS S3 pre-signed URL to upload document/file directly for an
        application.


        The response will contain the `id` of the document, presigned
        `uploadUrl`.


        To upload the file, send PUT request (with the content of the file) to
        the `uploadUrl`. Ensure to add the header `Content-Type` with the same
        value of `contentType` of the body of the original request.
      tags:
        - documents
      parameters:
        - name: id
          in: path
          description: '(Required) '
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/institution_applications_{id}_documents_Get
                  an upload URL for a supporting document_Response_200
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                filename:
                  type: string
                contentType:
                  type: string
              required:
                - filename
                - contentType
servers:
  - url: https:/
    description: https://{baseurl}
components:
  schemas:
    InstitutionApplicationsIdDocumentsPostResponsesContentApplicationJsonSchemaRequiredHeaders:
      type: object
      properties:
        host:
          type: string
        content-type:
          type: string
      required:
        - host
        - content-type
      title: >-
        InstitutionApplicationsIdDocumentsPostResponsesContentApplicationJsonSchemaRequiredHeaders
    institution_applications_{id}_documents_Get an upload URL for a supporting document_Response_200:
      type: object
      properties:
        id:
          type: string
          format: uuid
        uploadUrl:
          type: string
        requiredHeaders:
          $ref: >-
            #/components/schemas/InstitutionApplicationsIdDocumentsPostResponsesContentApplicationJsonSchemaRequiredHeaders
      required:
        - id
        - uploadUrl
        - requiredHeaders
      title: >-
        institution_applications_{id}_documents_Get an upload URL for a
        supporting document_Response_200
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## Examples



**Request**

```json
{
  "filename": "transcript.pdf",
  "contentType": "application/pdf"
}
```

**Response**

```json
{
  "id": "354aa882-7aeb-4ac8-b95f-aef18d7170bd",
  "uploadUrl": "S3_presigned_URL",
  "requiredHeaders": {
    "host": "S3_host_URL",
    "content-type": "application/pdf"
  }
}
```

**SDK Code**

```python institution_applications_{id}_documents_Get an upload URL for a supporting document_example
import requests

url = "https://https/institution/applications/e3945297-8a7c-4ac8-9cf4-52d4a3f67086/documents"

payload = {
    "filename": "transcript.pdf",
    "contentType": "application/pdf"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript institution_applications_{id}_documents_Get an upload URL for a supporting document_example
const url = 'https://https/institution/applications/e3945297-8a7c-4ac8-9cf4-52d4a3f67086/documents';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"filename":"transcript.pdf","contentType":"application/pdf"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go institution_applications_{id}_documents_Get an upload URL for a supporting document_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://https/institution/applications/e3945297-8a7c-4ac8-9cf4-52d4a3f67086/documents"

	payload := strings.NewReader("{\n  \"filename\": \"transcript.pdf\",\n  \"contentType\": \"application/pdf\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby institution_applications_{id}_documents_Get an upload URL for a supporting document_example
require 'uri'
require 'net/http'

url = URI("https://https/institution/applications/e3945297-8a7c-4ac8-9cf4-52d4a3f67086/documents")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"filename\": \"transcript.pdf\",\n  \"contentType\": \"application/pdf\"\n}"

response = http.request(request)
puts response.read_body
```

```java institution_applications_{id}_documents_Get an upload URL for a supporting document_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://https/institution/applications/e3945297-8a7c-4ac8-9cf4-52d4a3f67086/documents")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"filename\": \"transcript.pdf\",\n  \"contentType\": \"application/pdf\"\n}")
  .asString();
```

```php institution_applications_{id}_documents_Get an upload URL for a supporting document_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/institution/applications/e3945297-8a7c-4ac8-9cf4-52d4a3f67086/documents', [
  'body' => '{
  "filename": "transcript.pdf",
  "contentType": "application/pdf"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp institution_applications_{id}_documents_Get an upload URL for a supporting document_example
using RestSharp;

var client = new RestClient("https://https/institution/applications/e3945297-8a7c-4ac8-9cf4-52d4a3f67086/documents");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"filename\": \"transcript.pdf\",\n  \"contentType\": \"application/pdf\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift institution_applications_{id}_documents_Get an upload URL for a supporting document_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "filename": "transcript.pdf",
  "contentType": "application/pdf"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://https/institution/applications/e3945297-8a7c-4ac8-9cf4-52d4a3f67086/documents")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```