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

# Create Presigned URL

> Generate a temporary presigned URL for direct file access.

## Path Parameters

<ParamField path="id" type="string" required>
  The unique identifier of the file.
</ParamField>

## Request Body

<ParamField body="expires_in" type="integer">
  The number of seconds until the presigned URL expires. Defaults to 3600 (1 hour). Maximum is 86400 (24 hours).
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.getagentdrive.com/v0/files/file_xyz789/presigned-url \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "expires_in": 7200
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "url": "https://storage.getagentdrive.com/files/file_xyz789?token=eyJhbGci...",
    "token": "eyJhbGci...",
    "expires_at": "2026-03-19T12:00:00Z"
  }
  ```
</ResponseExample>

## Response

<ResponseField name="url" type="string">
  The presigned URL for direct file access. No authentication header is required when using this URL.
</ResponseField>

<ResponseField name="token" type="string">
  The access token embedded in the URL.
</ResponseField>

<ResponseField name="expires_at" type="string">
  ISO 8601 timestamp of when the presigned URL expires.
</ResponseField>
