Files

2.7 KiB

Repository API reference

Base: https://git.mpm.to/api/v1

List repositories for the authenticated user

GET /repos/search?token=...&limit=50&page=1

Or list all repos the authenticated user has access to:

curl -s -H "Authorization: token e82a7235b948fbbeea60329422fcac89fa5a5ce8" \
  "https://git.mpm.to/api/v1/repos/search?limit=50&page=1"

Key response fields per repo: id, full_name, description, private, fork, stars_count, forks_count, open_issues_count, default_branch, updated_at, html_url.

List repos for a specific organization

curl -s -H "Authorization: token e82a7235b948fbbeea60329422fcac89fa5a5ce8" \
  "https://git.mpm.to/api/v1/orgs/{org}/repos?limit=50"

List repos for a specific user

curl -s -H "Authorization: token e82a7235b948fbbeea60329422fcac89fa5a5ce8" \
  "https://git.mpm.to/api/v1/users/{username}/repos?limit=50"

Get a single repository

curl -s -H "Authorization: token e82a7235b948fbbeea60329422fcac89fa5a5ce8" \
  "https://git.mpm.to/api/v1/repos/{owner}/{repo}"

Search repositories

curl -s -H "Authorization: token e82a7235b948fbbeea60329422fcac89fa5a5ce8" \
  "https://git.mpm.to/api/v1/repos/search?q=SEARCH_TERM&limit=20"

Create a repository (for the authenticated user)

curl -s -X POST \
  -H "Authorization: token e82a7235b948fbbeea60329422fcac89fa5a5ce8" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "repo-name",
    "description": "Description here",
    "private": false,
    "auto_init": true,
    "default_branch": "main"
  }' \
  "https://git.mpm.to/api/v1/user/repos"

Create a repository under an organization

curl -s -X POST \
  -H "Authorization: token e82a7235b948fbbeea60329422fcac89fa5a5ce8" \
  -H "Content-Type: application/json" \
  -d '{"name": "repo-name", "description": "...", "private": false}' \
  "https://git.mpm.to/api/v1/orgs/{org}/repos"

Delete a repository

curl -s -X DELETE \
  -H "Authorization: token e82a7235b948fbbeea60329422fcac89fa5a5ce8" \
  "https://git.mpm.to/api/v1/repos/{owner}/{repo}"

Returns 204 on success. Always confirm with the user before deleting.

List branches

curl -s -H "Authorization: token e82a7235b948fbbeea60329422fcac89fa5a5ce8" \
  "https://git.mpm.to/api/v1/repos/{owner}/{repo}/branches"

List topics/tags on a repo

curl -s -H "Authorization: token e82a7235b948fbbeea60329422fcac89fa5a5ce8" \
  "https://git.mpm.to/api/v1/repos/{owner}/{repo}/topics"

Get repo collaborators

curl -s -H "Authorization: token e82a7235b948fbbeea60329422fcac89fa5a5ce8" \
  "https://git.mpm.to/api/v1/repos/{owner}/{repo}/collaborators"