Skip to main content
GET
/
{org}
/
{repo}
/
content
Get content
curl --request GET \
  --url https://api.mesa.dev/v1/{org}/{repo}/content \
  --header 'Authorization: Bearer <token>'
{
  "type": "<string>",
  "name": "<string>",
  "path": "<string>",
  "sha": "<string>",
  "size": 123,
  "encoding": "<string>",
  "content": "<string>",
  "is_conflicted": true,
  "metadata": {}
}
Required scope: read

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

org
string
required

Organization slug

Minimum string length: 1
repo
string
required

Repository name

Minimum string length: 1

Query Parameters

change_id
string

Change id to read content from. Defaults to the current change at the default bookmark tip. You may also pass the virtual root change id (zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz) to read the empty tree.

Pattern: ^[zyxwvutsrqponmlk]{32}$
path
string
depth
integer

Directory traversal depth: 0 for directory metadata only, 1 for direct children, up to 10

Required range: 0 <= x <= 10
metadata
object

Filter directory entries[] to rows whose metadata matches. Pass one param per key as a deepObject: ?metadata[<key>]=<value>, repeatable. Multiple keys are AND-ed (an entry must match every pair to survive; exact-value match). Ignored when the resolved path is a file or symlink. Example: ?metadata[tag]=archived&metadata[lang]=en.

Response

Content response

type
string
required
Allowed value: "file"
name
string
required
path
string
required
sha
string
required
size
number
required
encoding
string
required
Allowed value: "base64"
content
string
required
mode
enum<string>
required

POSIX file mode for a regular file

Available options:
100644,
100755
is_conflicted
boolean
metadata
object

Metadata attached to this path. Values are UTF-8 strings. Always reflects current values; not snapshotted with change_id.