---
title: "Get metadata for a file, identified by sha."
method: GET
path: "/files/{sha}"
tags: ["Files"]
---

# Get metadata for a file, identified by sha.

`GET /files/{sha}`

## Request

- Base URL: `https://replace-with-account.api.decodable.co/v1alpha2`
- URL: `https://replace-with-account.api.decodable.co/v1alpha2/files/{sha}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/decodable/apis/decodable-control-plane/docs/files/:sha/get.ts> (a function with typed inputs; its response is checked against the schema)

Requires permission matching: `file:read:default.<file-name>`.

## Query parameters

- `type` 'JOB_FILE' | 'CONFIG_FILE', required

## Response `200`

A file get response.

- File: Metadata for a file.
  - `sha` string: The sha512 hash of the file
  - `type` 'JOB_FILE' | 'CONFIG_FILE': The type of the file
  - `name` string: The filename
  - `size` number: The file size in bytes
  - `metadata` object: Additional metadata for the file

## Other responses

- `400`: An invalid request was received.
- `403`: Access denied: requesting user lacks a required permission.
- `404`: The requested resource does not exist.

---

[API](https://skmtc.dev/decodable/apis/decodable-control-plane.md) - [All operations](https://skmtc.dev/decodable/apis/decodable-control-plane/llms.txt) - [OpenAPI document](https://skmtc.dev/decodable/apis/decodable-control-plane/revisions/9718a3019da8?raw)
