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

# Get Upload URL

Use this API to mint a short-lived signed URL for uploading a file up to 30 MB. Use it for the by-reference ingestion flow: get the URL, PUT the raw file bytes to it, then pass the returned `fileRef` to [Ingest Knowledge](/api-reference/rest-apis/v2/memory/knowledge/ingest).

# Endpoint

`POST https://api.velt.dev/v2/memory/knowledge/upload-url`

# Headers

<ParamField header="x-velt-api-key" type="string" required>
  Your API key.
</ParamField>

<ParamField header="x-velt-auth-token" type="string" required>
  Your [Auth Token](/security/auth-tokens).
</ParamField>

# Body

#### Params

<ParamField body="data" type="object" required>
  <Expandable title="properties">
    <ParamField body="mimeType" type="string" required>
      One of the supported types: `application/pdf`, `text/csv`, `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`, or `text/plain`.
    </ParamField>

    <ParamField body="fileSize" type="integer" required>
      File size in bytes. Maximum 30 MB.
    </ParamField>

    <ParamField body="fileName" type="string">
      1 to 255 characters.
    </ParamField>

    <ParamField body="organizationId" type="string">
      Scope the source to one organization.
    </ParamField>

    <ParamField body="documentId" type="string">
      Scope the source to one document. Requires `organizationId`.
    </ParamField>
  </Expandable>
</ParamField>

## **Example Requests**

#### Request an upload URL for a PDF

```JSON theme={null}
{
  "data": {
    "mimeType": "application/pdf",
    "fileSize": 8421376,
    "fileName": "brand-guidelines.pdf"
  }
}
```

# Response

Upload the raw file bytes to `uploadUrl` with an HTTP `PUT`, then pass `fileRef` to Ingest Knowledge. The URL expires at `expiresAt` (epoch ms).

#### Success Response

```JSON theme={null}
{
  "result": {
    "uploadUrl": "https://storage.googleapis.com/...signed...",
    "fileRef": "gs://bucket/path/original.pdf",
    "expiresAt": 1731432600000
  }
}
```

#### Failure Response

```JSON theme={null}
{
  "error": {
    "message": "ERROR_MESSAGE",
    "status": "INVALID_ARGUMENT"
  }
}
```

<ResponseExample>
  ```js theme={null}
  {
    "result": {
      "uploadUrl": "https://storage.googleapis.com/...signed...",
      "fileRef": "gs://bucket/path/original.pdf",
      "expiresAt": 1731432600000
    }
  }
  ```
</ResponseExample>
