---
title: "Generate a presigned URL for uploading a file"
method: POST
path: "/v1/files/upload/presigned-url"
tags: ["Files"]
---

# Generate a presigned URL for uploading a file

`POST /v1/files/upload/presigned-url`

## Request

- Base URL: `https://docs.grepr.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.grepr.ai/v1/files/upload/presigned-url`
- Auth: one of:
  - API key in header `GREPR-API-KEY`
  - OpenID Connect (`https://grepr-prod.us.auth0.com/.well-known/openid-configuration`)

Generates a presigned URL that allows the client to upload a file directly. The file will be automatically deleted after 24 hours.

## Query parameters

- `fileSizeBytes` integer, required
- `format` 'json' | 'plaintext', required

## Response `200`

Presigned URL generated successfully

- PresignedUploadUrlResponse: Presigned URL for uploading a file
  - `expiresAt` string: Timestamp when the presigned URL expires
  - `orgId` string: Organization ID that owns this upload
  - `presignedUrl` string: Presigned URL that can be used to upload files
  - `uploadId` string: Unique identifier for this upload. Pass it as the uploadId of a grepr-uploaded-log-file-source to read the uploaded file.

## Other responses

- `400`: Invalid parameters (file too large, unsupported format, etc.)
- `401`: Unauthorized

---

[API](https://skmtc.dev/grepr/apis/grepr-api.md) - [All operations](https://skmtc.dev/grepr/apis/grepr-api/llms.txt) - [OpenAPI document](https://skmtc.dev/grepr/apis/grepr-api/revisions/2a5ce03a0bf0?raw)
