GitPHP / Docs / 🔧 Troubleshooting
⚡️ REST API v1

The GitPHP guide 🚀

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

REST API v1 Suite

🛡️ License Management, HWID Binding & Analytics API Suite

Complete documentation for License Lifecycle Management, HWID Hardware Fingerprint Binding, IP/HWID Resets, Quotas, and System-Wide Analytics.

1. Authentication & Security Headers

All administrative API endpoints require Bearer token authorization in request headers:

Authorization: Bearer <ADMIN_API_TOKEN>
# Or via custom header:
X-GitPHP-Token: <ADMIN_API_TOKEN>

📋 2. Endpoints Reference Table

Method Endpoint Route Description & Action
POST/api/v1/licensesGenerate a new server license key
GET/api/v1/licensesList and search licenses (Paginated)
GET/api/v1/licenses/statsSystem-wide license & device analytics
GET/api/v1/licenses/{id_or_key}Retrieve single license & bound HWID devices
PUT/api/v1/licenses/{id_or_key}Update customer info, plan, extend expiration
POST/api/v1/licenses/{id_or_key}/statusChange status (active, suspended, revoked)
DELETE/api/v1/licenses/{id_or_key}Delete license record & device bindings
GET/api/v1/licenses/{id_or_key}/devicesList bound hardware fingerprints / devices
DELETE/api/v1/licenses/{id_or_key}/devices/{machine_id}Unbind / revoke specific device HWID slot
POST/api/v1/licenses/{id_or_key}/reset-bindingsReset all HWID bindings & IP for server migration

💻 3. Ready-to-Use cURL Examples

Create Monthly License (30 Days):

curl -s -X POST https://git.ysnapp.com/api/v1/licenses   -H "Authorization: Bearer <TOKEN>"   -H "Content-Type: application/json"   -d '{
    "customer_name": "MUHAMMED GAILAN",
    "plan_type": "monthly",
    "duration_days": 30,
    "max_devices": 2,
    "bound_ip": "169.58.135.161",
    "notes": "VIP Client"
  }'

Get System Analytics:

curl -s -H "Authorization: Bearer <TOKEN>" https://git.ysnapp.com/api/v1/licenses/stats

Reset Device Bindings for Migration:

curl -s -X POST -H "Authorization: Bearer <TOKEN>" https://git.ysnapp.com/api/v1/licenses/FF-ED54-0CED-F732/reset-bindings

📕 4. Response Models & Error Dictionary

  • ERR_UNAUTHORIZED (401): Missing or invalid Bearer token.
  • ERR_LIC_NOT_FOUND (404): Target license key or ID does not exist.
  • ERR_LIC_EXPIRED (403): License validity period has expired.
  • ERR_LIC_REVOKED (403): License has been banned or revoked by admin.
  • ERR_LIC_DEVICE_LIMIT (403): Maximum allowed active hardware devices quota exceeded.
  • ERR_LIC_HWID_CLONED (409): Duplicate machine ID or cloned hardware collision.

18 Troubleshooting

⚠️ HTTP 401 Unauthorized on Push: Ensure you are using a Personal Access Token with write scope, or check that your web server passes the Authorization header (see docs/deploy.md).
⚠️ SSH «Permission denied (publickey)»: Verify your public key is added in Settings and run php bin/fix-push.php to set 0660 permissions on authorized_keys.
⚠️ «Branch is protected» on Push: The target branch is protected against direct pushes; push to a topic branch and open a Pull Request.
⚠️ Connection timeout during large pushes: Increase maxReqBodySize and reqTimeout in OpenLiteSpeed configuration (see docs/openlitespeed.conf).