---
title: "Get contents of multiple files in a single request"
method: POST
path: "/api/v4/projects/{id}/repository/blobs/batch"
tags: ["repositories"]
---

# Get contents of multiple files in a single request

`POST /api/v4/projects/{id}/repository/blobs/batch`

## Request

- Base URL: `https://gitlab.com`
- URL: `https://gitlab.com/api/v4/projects/{id}/repository/blobs/batch`
- Auth: none declared

Each blob is truncated to the first 1 MB; the `truncated` field indicates when this happens.

## Path parameters

- `id` string, required

## Request body

- PostApiV4ProjectsIdRepositoryBlobsBatch: Get contents of multiple files in a single request
  - `files` object[], required: Array of file objects to retrieve (max 20)
    - `path` string, required: The file path
    - `ref` string: The branch, tag, or commit. Defaults to the default branch

## Response `200`

Get contents of multiple files in a single request

- APIEntitiesBatchBlob: API_Entities_BatchBlob model
  - `path` string, required
  - `ref` string, required
  - `size` integer, required
  - `truncated` boolean, required
  - `encoding` string, required
  - `content` string, required

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `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)
