# file

```graphql
query File($input: FileInput!) {
  file(input: $input) {
    binary {
      contentHash
      byteSize
      contentType
    }
    id
    versionId
    path
    type
    size
    sizeBytes
    content
    checksum
    createdAt
    updatedAt
  }
}
```

Return a file. Requires project.files.read.

## Arguments

| Name                     | Type       | Required | Description                                                                                 |
| ------------------------ | ---------- | -------- | ------------------------------------------------------------------------------------------- |
| `input`                  | FileInput! | Yes      |                                                                                             |
| `input.projectReference` | String     |          | Project UUID, slug or configured domain. Omit it to use the project of the request.         |
| `input.filePath`         | String!    | Yes      | Project-relative source path, or the file ID.                                               |
| `input.ref`              | String     |          | Content to read: main, branch:<name-or-id>, release:<version> or env:<name>. Omit for main. |

## Variables

```json
{
  "input": {
    "filePath": "string"
  }
}
```

## Responses

| Status | Description             |
| ------ | ----------------------- |
| 200    | The File! in data.file. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "query File($input: FileInput!) {\n  file(input: $input) {\n    binary {\n      contentHash\n      byteSize\n      contentType\n    }\n    id\n    versionId\n    path\n    type\n    size\n    sizeBytes\n    content\n    checksum\n    createdAt\n    updatedAt\n  }\n}",
  "variables": {
    "input": {
      "filePath": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "file": {
      "binary": {
        "contentHash": "string",
        "byteSize": 0,
        "contentType": "string"
      },
      "id": "string",
      "versionId": "string",
      "path": "string",
      "type": "string",
      "size": 0,
      "sizeBytes": 0,
      "content": "string",
      "checksum": "string",
      "createdAt": "2026-01-01T00:00:00Z",
      "updatedAt": "2026-01-01T00:00:00Z"
    }
  }
}
```
