repositories

Get contents of multiple files in a single request

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

post/api/v4/projects/{id}/repository/blobs/batch

Request

  • Base URL
    https://gitlab.com
  • Auth
    none declared

Path parameters

idstring required

The ID or URL-encoded path of the project

Request body

Example request

{
  "files": [
    {
      "path": "app/models/user.rb",
      "ref": "main"
    }
  ]
}

Response

Get contents of multiple files in a single request

pathstring required
refstring required
sizeinteger required
truncatedboolean required
encodingstring required
contentstring required

Example response

{
  "path": "app/models/user.rb",
  "ref": "main",
  "size": 1476,
  "encoding": "base64",
  "content": "VGhpcyBpcyBhIGZpbGU="
}

Changes

No recorded changes to this operation across all 5 revisions of this API.