# Get inline preview URL for a file

Returns a URL for rendering a file inline in the browser. For cloud (S3/GCS) deployments the URL is a presigned URL with inline Content-Disposition and a forced Content-Type baked in, expiring after 20 minutes. For filesystem deployments the URL routes back through the protocol API with preview=true and relies on the caller's session. The endpoint enforces the preview allowlist and a configured maximum size before returning a URL.

Endpoint: GET /har/api/v3/files/{id}/preview
Version: 1.0
Security: x-api-key

## Query parameters:

  - `account_identifier` (string, required)
    Unique identifier for the Harness account.

  - `org_identifier` (string)
    Unique identifier for the organization within the account.

Example: default or engineering_org

  - `project_identifier` (string)
    Unique identifier for the project within the organization.

Example: my_project or frontend_services

## Path parameters:

  - `id` (string, required)

## Response 200 fields (application/json):

  - `data` (object, required)
    Inline preview details for a file.

  - `data.contentType` (string, required)
    Content-Type the file will be served with for preview. HTML and SVG are forced to text/plain to mitigate stored XSS.

  - `data.expiresAt` (integer,null)
    When the preview URL expires (Unix ms). Set for cloud presigned URLs (now + 20m); null for filesystem deployments whose URL does not expire.

  - `data.fileName` (string, required)
    File name (leaf of the node path).

  - `data.previewUrl` (string, required)
    URL the browser can open to render the file inline. A presigned URL for cloud deployments, or a protocol-API URL with preview=true for filesystem deployments.

  - `data.size` (integer, required)
    File size in bytes.

## Response default fields (application/json):

  - `error` (object, required)

  - `error.code` (string)
    For some errors that could be handled programmatically, a short string indicating the [error code](https://docs.stripe.com/error-codes) reported.

  - `error.message` (string)
    A human-readable message providing more details about the error. These messages can be shown to users.

  - `error.param` (string)
    If the error is parameter-specific, the parameter related to the error. For example, we can use this to display a message near the correct form field.

  - `error.type` (string, required)
    The type of error returned.
    Enum: "INVALID_REQUEST_ERROR", "AUTHENTICATION_ERROR", "PERMISSION_ERROR", "API_ERROR"


