> This page is for version v1.
> For other versions, use one of these documentation indexes:
> - v2 (default): https://docs.pinnacle.sh/v-2/llms.txt
> - v1: https://docs.pinnacle.sh/v1/llms.txt

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

# Create Upload URL

POST https://www.trypinnacle.dev/api/tools/uploadUrl
Content-Type: application/json

Generate signed upload (expires in 2 hours) and download URLs for a file (expires in 1 hour).

See the [Upload](/v1/upload) page for native Python and Typescript SDKs.


Reference: https://docs.pinnacle.sh/v1/api-reference/tools/upload-url

## Authentication

- `PINNACLE-API-Key` header (required) — Pinnacle API Key

## Request

### Body (application/json)

This endpoint expects an object.

- `contentType` (string, required) — The MIME type of the file. Supported types are audio/basic, audio/L24, audio/mp4, audio/mpeg, audio/mpg, audio/mp3, audio/ogg, audio/aac, audio/vndrn-realaudio, audio/vndwave, audio/3gpp, audio/3gpp2, audio/ac3, audio/webm, audio/amrnb, audio/amr, video/mpeg, video/mp4, video/quicktime, video/webm, video/3gpp, video/3gpp2, video/3gpptt, video/H261, video/H263, video/H2631998, video/H2632000, video/H264, video/m4v, video/mpeg4, video/webm, image/jpeg, image/gif, image/png, image/gif, image/bmp, image/tiff, image/webp, text/vcard, text/xvcard, text/csv, text/rtf, text/richtext, text/calendar, text/directory, application/ogg, application/pdf, application/vcard, application/vndapple.pkpass.
- `size` (integer, required) — The size of the file in bytes. Should be less than 100 MB.
- `name` (string, required) — The name of the file.

## Response

### 200

Successfully generated upload and download URLs

- `upload` (string, optional) — The URL to upload the file.
- `download` (string, optional) — The URL to download the file.

## Errors

### 400 Bad Request Error

Bad request due to invalid input parameters

- `errors` (list of string, optional)

### 401 Unauthorized Error

Unauthorized access due to invalid or missing API key

- `errors` (list of string, optional)

### 500 Internal Server Error

Internal server error

- `errors` (list of string, optional)

## Examples

**Request**

```json
{
  "contentType": "image/png",
  "size": 1024,
  "name": "example.png"
}
```

**Response**

```json
{
  "upload": "https://server.trypinnacle.app/storage/v1/object/upload/sign/assets/example.png",
  "download": "https://server.trypinnacle.app/storage/v1/object/sign/assets/example.png"
}
```

**SDK Code**

```python
import requests

url = "https://www.trypinnacle.dev/api/tools/uploadUrl"

payload = {
    "contentType": "image/png",
    "size": 1024,
    "name": "example.png"
}
headers = {
    "PINNACLE-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://www.trypinnacle.dev/api/tools/uploadUrl';
const options = {
  method: 'POST',
  headers: {'PINNACLE-API-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"contentType":"image/png","size":1024,"name":"example.png"}'
};

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

```go
package main

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

func main() {

	url := "https://www.trypinnacle.dev/api/tools/uploadUrl"

	payload := strings.NewReader("{\n  \"contentType\": \"image/png\",\n  \"size\": 1024,\n  \"name\": \"example.png\"\n}")

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

	req.Header.Add("PINNACLE-API-Key", "<apiKey>")
	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
require 'uri'
require 'net/http'

url = URI("https://www.trypinnacle.dev/api/tools/uploadUrl")

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

request = Net::HTTP::Post.new(url)
request["PINNACLE-API-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"contentType\": \"image/png\",\n  \"size\": 1024,\n  \"name\": \"example.png\"\n}"

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

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://www.trypinnacle.dev/api/tools/uploadUrl")
  .header("PINNACLE-API-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"contentType\": \"image/png\",\n  \"size\": 1024,\n  \"name\": \"example.png\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://www.trypinnacle.dev/api/tools/uploadUrl', [
  'body' => '{
  "contentType": "image/png",
  "size": 1024,
  "name": "example.png"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'PINNACLE-API-Key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://www.trypinnacle.dev/api/tools/uploadUrl");
var request = new RestRequest(Method.POST);
request.AddHeader("PINNACLE-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"contentType\": \"image/png\",\n  \"size\": 1024,\n  \"name\": \"example.png\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "PINNACLE-API-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "contentType": "image/png",
  "size": 1024,
  "name": "example.png"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://www.trypinnacle.dev/api/tools/uploadUrl")! 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()
```