---
title: "Retrieve snippet file content"
method: GET
path: "/api/v4/snippets/{id}/files/{ref}/{file_path}/raw"
tags: ["snippets"]
---

# Retrieve snippet file content

`GET /api/v4/snippets/{id}/files/{ref}/{file_path}/raw`

## Request

- Base URL: `https://gitlab.com`
- URL: `https://gitlab.com/api/v4/snippets/{id}/files/{ref}/{file_path}/raw`
- Auth: none declared

Retrieves the raw file content from a snippet as plain text.

## Path parameters

- `ref` string, required
- `file_path` string, required
- `id` integer, required

## Response `200`

Retrieve snippet file content

## Other responses

- `404`: Not found

---

[API](https://skmtc.dev/gitlab/apis/gitlab-api.md) - [All operations](https://skmtc.dev/gitlab/apis/gitlab-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gitlab/apis/gitlab-api/revisions/b234947ef3f2?raw)
