LogoFreestyle
API Reference/Git

Get the contents of a file or directory

Get the contents of a file or directory in a repository

GET/git/v1/repo/{repo}/contents/{*path}

Path Parameters

repoRequiredstring

The repository ID.

Format: "uuid"
*pathRequiredstring | null

The path to the file or directory. Empty for root.

Query Parameters

refstring

The git reference (branch name, commit SHA, etc.). Defaults to HEAD.

Response Body

200

Success

responseRequiredFile | Directory

400

Bad Request

messageRequiredstring

401

Unauthorized

messageRequiredstring

403

Forbidden

messageRequiredstring

404

Not Found

messageRequiredstring

500

Internal Server Error

messageRequiredstring
curl -X GET "https://api.freestyle.sh/git/v1/repo/497f6eca-6276-4993-bfeb-53cbbbba6f08/contents/string?ref=%3Cstring%3E"

Success

{
  "name": "string",
  "path": "string",
  "sha": "string",
  "size": 0,
  "content": "string",
  "type": "file"
}