GitPHP / Docs / ⚡️ REST API
⚡️ REST API v1

The GitPHP guide 🚀

Comprehensive open-source documentation: Self-hosting, Personal Access Tokens, Git & SSH, pull requests, and REST API.

10 Webhooks

Under repository settings → Webhooks, register HTTP endpoints to receive real-time JSON payloads for events:

  • push — Pushes and branch creations/deletions.
  • issues — Issue creation, comments, and state changes.
  • pull_request — PR opening, review approvals, and merges.
  • release — Release publications.

When configured with a Secret Key, payloads are HMAC-SHA256 signed in the X-GitPHP-Signature header.

⚡️ REST API Documentation v1

11 REST API v1 Documentation ⚡️

A comprehensive RESTful API is provided for automation and integrations. Authenticate using personal access tokens (gtp_…) via Authorization: Bearer or X-GitPHP-Token headers.

1. Request Headers

# Standard Bearer Authentication:
Authorization: Bearer gtp_your_token_here

# Or custom header:
X-GitPHP-Token: gtp_your_token_here

2. Authenticated User Identity (Whoami)

curl -H "Authorization: Bearer gtp_your_token" \
  https://git.ysnapp.com/api/v1/user

3. Repository Metadata

curl -H "Authorization: Bearer gtp_your_token" \
  https://git.ysnapp.com/api/v1/repos/my-project

4. Commits History (Paginated)

curl -H "Authorization: Bearer gtp_your_token" \
  "https://git.ysnapp.com/api/v1/repos/my-project/commits?ref=main&page=1&per_page=10"

5. Tree Browsing & Blob Content (Base64)

# Directory Tree
curl -H "Authorization: Bearer gtp_your_token" \
  "https://git.ysnapp.com/api/v1/repos/my-project/tree?ref=main&path=src"

# File Blob Content
curl -H "Authorization: Bearer gtp_your_token" \
  "https://git.ysnapp.com/api/v1/repos/my-project/blob?ref=main&path=README.md"
EndpointDescriptionQuery Parameters
GET /api/v1/userToken owner identity & scopes—
GET /api/v1/repos/{slug}Repository metadata—
GET /api/v1/repos/{slug}/branchesBranch list with commit SHAs—
GET /api/v1/repos/{slug}/tagsTags and releases list—
GET /api/v1/repos/{slug}/commitsPaginated commit logref, page, per_page
GET /api/v1/repos/{slug}/treeDirectory tree browsingref, path
GET /api/v1/repos/{slug}/blobFile contents (Base64)ref, path
GET /api/v1/repos/{slug}/issuesIssues list and statestate=open|closed|all
GET /api/v1/repos/{slug}/pullsPull requests and review statusstate=open|closed|all
📖 Full markdown documentation is available at: docs/api.md.