---
title: "Get a snippet's raw file"
method: GET
path: "/snippets/{workspace}/{encoded_id}/{node_id}/files/{path}"
tags: ["Snippets"]
---

# Get a snippet's raw file

`GET /snippets/{workspace}/{encoded_id}/{node_id}/files/{path}`

Retrieves the raw contents of a specific file in the snippet. The
`Content-Disposition` header will be "attachment" to avoid issues with
malevolent executable files.

The file's mime type is derived from its filename and returned in the
`Content-Type` header.

Note that for text files, no character encoding is included as part of
the content type.

## Response `200`

Returns the contents of the specified file.

## Other responses

- `403` — If the authenticated user does not have access to the snippet.
- `404` — If the file or snippet does not exist.

---

[API](https://skmtc.net/atlassian/apis/bitbucket-api.md) · [All operations](https://skmtc.net/atlassian/apis/bitbucket-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/atlassian/bitbucket-api/versions/8c7911c0a910/schema)
