> This page is for Glide Classic.

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

# Create Upload

POST https://api.glideapps.com/apps/{appID}/uploads
Content-Type: application/json

Create an upload session and get a pre-signed upload URL. Upload the file bytes to the `uploadLocation`, then call the complete endpoint to finalize the file and receive a public URL.

## Example

```bash
curl --request POST \
  --url https://api.glideapps.com/apps/$APP_ID/uploads \
  --header "Authorization: Bearer $GLIDE_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "contentType": "image/png",
    "fileName": "logo.png"
  }'
```

Response:

```json
{
  "data": {
    "uploadID": "upload-123",
    "uploadLocation": "https://storage.googleapis.com/glide-uploads/example?X-Goog-Algorithm=GOOG4-RSA-SHA256"
  }
}
```

Then upload the file bytes to `uploadLocation`:

```bash
curl --request PUT \
  --url "$UPLOAD_LOCATION" \
  --header "Content-Type: image/png" \
  --upload-file ./logo.png
```

Finally, complete the upload:

```bash
curl --request POST \
  --url https://api.glideapps.com/apps/$APP_ID/uploads/$UPLOAD_ID/complete \
  --header "Authorization: Bearer $GLIDE_API_KEY"
```

Note that Glide will delete this file within 30 days if the URL is not stored in a table in Glide.

Reference: https://www.glideapps.com/docs/classic-api/uploads/create-upload

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication header of the form Bearer `<token>`, where `<token>` is your [auth token](/docs/api-reference/v2/general/authentication).

## Request

### Path parameters

- `appID` (string, required)

### Body (application/json)

This endpoint expects an object.

- `contentType` (string, required) — MIME type of the file, e.g., `image/png`
- `fileName` (string, required) — Name of the file

## Response

### 200

- `data` (AppsAppIdUploadsPostResponsesContentApplicationJsonSchemaData, required)

## Errors

### 402 Payment Required Error

- `error` (AppsAppIdUploadsPostResponsesContentApplicationJsonSchemaError, required)

### 403 Forbidden Error

- `error` (AppsAppIdUploadsPostResponsesContentApplicationJsonSchemaError, required)

### 413 Content Too Large Error

- `error` (AppsAppIdUploadsPostResponsesContentApplicationJsonSchemaError, required)

## Types

### AppsAppIdUploadsPostResponsesContentApplicationJsonSchemaData

- `uploadID` (string, required) — ID of the upload, e.g., `upload-123`
- `uploadLocation` (string, required) — Pre-signed upload URL for the file bytes

### AppsAppIdUploadsPostResponsesContentApplicationJsonSchemaError

- `type` (string, required)
- `message` (string, required)

## Examples

**Request**

```json
{
  "contentType": "image/png",
  "fileName": "logo.png"
}
```

**Response**

```json
{
  "data": {
    "uploadID": "upload-123",
    "uploadLocation": "https://storage.googleapis.com/glide-uploads/example?X-Goog-Algorithm=GOOG4-RSA-SHA256"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.glideapps.com/apps/mT91fPcZCWigkZXgSZGJ/uploads"

payload = {
    "contentType": "image/png",
    "fileName": "logo.png"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.glideapps.com/apps/mT91fPcZCWigkZXgSZGJ/uploads';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"contentType":"image/png","fileName":"logo.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://api.glideapps.com/apps/mT91fPcZCWigkZXgSZGJ/uploads"

	payload := strings.NewReader("{\n  \"contentType\": \"image/png\",\n  \"fileName\": \"logo.png\"\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
require 'uri'
require 'net/http'

url = URI("https://api.glideapps.com/apps/mT91fPcZCWigkZXgSZGJ/uploads")

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  \"contentType\": \"image/png\",\n  \"fileName\": \"logo.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://api.glideapps.com/apps/mT91fPcZCWigkZXgSZGJ/uploads")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"contentType\": \"image/png\",\n  \"fileName\": \"logo.png\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.glideapps.com/apps/mT91fPcZCWigkZXgSZGJ/uploads', [
  'body' => '{
  "contentType": "image/png",
  "fileName": "logo.png"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.glideapps.com/apps/mT91fPcZCWigkZXgSZGJ/uploads");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"contentType\": \"image/png\",\n  \"fileName\": \"logo.png\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "contentType": "image/png",
  "fileName": "logo.png"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.glideapps.com/apps/mT91fPcZCWigkZXgSZGJ/uploads")! 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()
```