# Get File

- **Method:** `GET`
- **Path:** `/api/v1/files/{file_id}`
- **Operation ID:** `get_file`
- **Tags:** files

One uploaded file's metadata: its ref, name, size, media type and when it expires. Never its bytes.

## Effective servers

- `https://api.saram.sh`

  Saram

## Authentication

- **HTTPBearer**: HTTP bearer

  a Saram API key (`sk_saram_<env>_...`) or a person's AuthKit access token, as `Authorization: Bearer <credential>`. Both are told apart by shape and produce the same principal.

## Path parameters

- **`file_id` (required)**: `string`

## Responses

### 200 Successful Response

**Content type:** `application/json`

schema: `FileRecord`, no additional properties

One file this tenant uploaded, as `POST /api/v1/files` and the two read routes answer it.

Metadata only, and deliberately: the API never serves an uploaded file's bytes back. Nothing needs them -
the dashboard shows names - and `GET /api/v1/blobs` stays evidence-only, which is what keeps a `files/`
key unreachable there. The tenant is not a field of its own: it is the ref's first segment, and it is
always the tenant of whoever asked.

- **`expires_at` (required)**: `string`

  When the file is deleted: its upload time plus how long this deployment keeps uploads. A run naming a file
  past this is refused at `POST /runs`.
- **`media_type` (required)**: `string`
- **`name` (required)**: `string`
- **`ref` (required)**: `string`

  `saram-file://<tenant_id>/<file_id>`: what a run spec's `files[].ref` names, and the only handle a caller
  ever gets on the object. A file uploaded before files were a tenant's keeps the caller name it was uploaded
  under in that segment.
- **`sha256` (required)**: `string`
- **`size_bytes` (required)**: `integer`
- **`uploaded_at` (required)**: `string`

**Example:**

```json
{
  "ref": "",
  "name": "",
  "size_bytes": 1,
  "media_type": "",
  "sha256": "",
  "uploaded_at": "",
  "expires_at": ""
}
```

### 403 the API key lacks the required scope

### 422 Validation Error

**Content type:** `application/json`

schema: `HTTPValidationError`

- **`detail`**: `array`

  **Items:**

  schema: `ValidationError`
  - **`loc` (required)**: `array of (string | integer)`
  - **`msg` (required)**: `string`
  - **`type` (required)**: `string`
  - **`ctx`**: `object`
  - **`input`**: `any`

**Example:**

```json
{
  "detail": [
    {
      "loc": [
        ""
      ],
      "msg": "",
      "type": "",
      "input": null,
      "ctx": {}
    }
  ]
}
```

## Schemas

- `FileRecord` — shown above.
- `HTTPValidationError` — shown above.
- `ValidationError` — shown above.
