> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.glideapps.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Upload

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 theme={null}
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 theme={null}
{
  "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 theme={null}
curl --request PUT \
  --url "$UPLOAD_LOCATION" \
  --header "Content-Type: image/png" \
  --upload-file ./logo.png
```

Finally, complete the upload:

```bash theme={null}
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.


## OpenAPI

````yaml post /apps/{appID}/uploads
openapi: 3.0.0
info:
  title: ''
  version: 0.0.1
servers:
  - description: Production
    url: https://api.glideapps.com
security:
  - BearerAuth: []
tags: []
paths:
  /apps/{appID}/uploads:
    post:
      parameters:
        - name: appID
          in: path
          schema:
            type: string
            description: ID of the app, e.g., `mT91fPcZCWigkZXgSZGJ`
            example: mT91fPcZCWigkZXgSZGJ
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                contentType:
                  type: string
                  description: MIME type of the file, e.g., `image/png`
                  example: image/png
                fileName:
                  type: string
                  description: Name of the file
                  example: logo.png
              required:
                - contentType
                - fileName
              additionalProperties: false
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      uploadID:
                        type: string
                        description: ID of the upload, e.g., `upload-123`
                        example: upload-123
                      uploadLocation:
                        type: string
                        description: Pre-signed upload URL for the file bytes
                        example: >-
                          https://storage.googleapis.com/glide-uploads/example?X-Goog-Algorithm=GOOG4-RSA-SHA256
                    required:
                      - uploadID
                      - uploadLocation
                    additionalProperties: false
                required:
                  - data
                additionalProperties: false
        '402':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      message:
                        type: string
                    required:
                      - type
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '403':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      message:
                        type: string
                    required:
                      - type
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '413':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      type:
                        type: string
                      message:
                        type: string
                    required:
                      - type
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer authentication header of the form Bearer `<token>`, where
        `<token>` is your [auth
        token](/api-reference/v2/general/authentication).

````