---
title: "Get contents"
method: GET
path: "/repos/{owner}/{repo}/contents/{path}"
tags: ["Repositories"]
---

# Get contents

`GET /repos/{owner}/{repo}/contents/{path}`

Get the contents of a file, directory, symlink, or submodule in a repository.

## Path parameters

- `owner` string, required
- `repo` string, required
- `path` string, required

## Query parameters

- `ref` string

## Response `200`

Success

- Content
  - `type` 'file' | 'dir' | 'symlink' | 'submodule'
  - `encoding` string
  - `size` integer
  - `name` string
  - `path` string
  - `content` string
  - `sha` string
  - `url` string
  - `git_url` string
  - `html_url` string
  - `download_url` string
  - `_links` object
    - `git` string
    - `self` string
    - `html` string

## Other responses

- `404` — Resource not found.

---

[API](https://skmtc.net/gogs/apis/gogs-api.md) · [All operations](https://skmtc.net/gogs/apis/gogs-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gogs/gogs-api/revisions/87e2da32266c/schema)
