Skip to content

Get contents of multiple files in a single request

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

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

id
required
One of:
string

The ID or URL-encoded path of the project

Example
1
Media typeapplication/json
object
files
required

Array of file objects to retrieve (max 20)

Array<object>
nullable
object
path
required

The file path

string
nullable
Example
app/models/user.rb
ref

The branch, tag, or commit. Defaults to the default branch

string
nullable
Example
main

OK

Media typeapplication/json
object
path
string
ref
string
size
integer
truncated
boolean
encoding
string
content
string
Example
{
"path": "app/models/user.rb",
"ref": "main",
"size": 1476,
"truncated": false,
"encoding": "base64",
"content": "VGhpcyBpcyBhIGZpbGU="
}

Bad Request

Unauthorized

Forbidden

Not Found