Gitea
Manage Gitea and Forgejo: repositories, files, branches, issues, pull requests, releases with files and webhooks. Typical uses: open an issue from a failed job, publish a release, keep a file in a repository up to date.
gitea pinggitea requestgitea requestgitea orgsgitea orgsgitea usersgitea usersgitea repo_creategitea repo_creategitea reposgitea reposgitea repo_getgitea file_putgitea file_putgitea file_getgitea file_getgitea branchesgitea label_creategitea label_creategitea labelsgitea issue_creategitea issue_creategitea issuesgitea issuesgitea issue_commentgitea issue_updategitea issue_closegitea issue_getgitea pull_creategitea pull_creategitea pullsgitea pullsgitea pull_mergegitea pull_mergegitea release_creategitea release_creategitea releasesgitea releasesgitea webhook_creategitea webhook_creategitea webhooksgitea webhook_deletegitea file_deletegitea file_deletegitea repo_delete

gitea ping <config>


Description

    Test the URL (and the credentials): {ok, version, user}

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
admin
gitea ping "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}"
mentdb
{"ok": true, "version": "28.4.0", "user": "ops"}

gitea request <config> <method> <path>


Description

    Any call of the API v1 with the credentials: the path is relative to /api/v1, without . or .. segments. Returns the body of the answer, or {status} when it is empty

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    method:   GET, POST, PUT, DELETE, PATCH or HEAD - String - required
    path:   The path, with its query string - String - required
admin
gitea request "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "GET" "/settings/api"
mentdb
{"max_response_items":50,"default_paging_num":30,"default_git_trees_per_page":1000,"default_max_blob_size":10485760,"default_max_response_size":104857600}

gitea request <config> <method> <path> <body_json>


Description

    A call with a JSON body

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    method:   GET, POST, PUT, DELETE, PATCH or HEAD - String - required
    path:   The path, with its query string - String - required
    body_json:   The JSON body - String - required
admin
gitea request "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "POST" "/orgs" "{\"username\": \"acme\", \"full_name\": \"Acme Corp\"}"
mentdb
{"id":2,"name":"acme","full_name":"Acme Corp","email":"","avatar_url":"http://127.0.0.1:3000/avatars/17863ad09ef6941539d3728918d7c2924567c0e307c4a83e56c1ebf9be955fbf","description":"","website":"","location":"","visibility":"public","repo_admin_change_team_access":false,"username":"acme"}

gitea orgs <config>


Description

    The organizations: rows {id, name, full_name, description, visibility} (100 at most)

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
admin
gitea orgs "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}"
mentdb
[{"id": 2, "name": "acme", "full_name": "Acme Corp", "description": "", "visibility": "public"}]

gitea orgs <config> <options_json>


Description

    The organizations with options: limit (100)

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    options_json:   The options - String - required
admin
gitea orgs "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "{\"limit\": 1}"
mentdb
[{"id": 2, "name": "acme", "full_name": "Acme Corp", "description": "", "visibility": "public"}]

gitea users <config>


Description

    The users: rows {id, login, full_name, email, is_admin, created} (the email is hidden from a non-administrator)

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
admin
gitea users "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}"
mentdb
[{"id": 1, "login": "ops", "full_name": "", "email": "ops@example.com", "is_admin": true, "created": "2026-11-17T20:00:19+04:00"}]

gitea users <config> <options_json>


Description

    Search the users with options: query (a part of the login or of the name), limit (100)

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    options_json:   The options - String - required
admin
gitea users "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "{\"query\": \"op\"}"
mentdb
[{"id": 1, "login": "ops", "full_name": "", "email": "ops@example.com", "is_admin": true, "created": "2026-11-17T20:00:19+04:00"}]

gitea repo_create <config> <name>


Description

    Create a repository for the account of the token. Returns {id, full_name, html_url, clone_url}

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    name:   The name of the repository - String - required
admin
gitea repo_create "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "sandbox"
mentdb
{"id": 1, "full_name": "ops/sandbox", "html_url": "http://127.0.0.1:3000/ops/sandbox", "clone_url": "http://127.0.0.1:3000/ops/sandbox.git"}

gitea repo_create <config> <name> <options_json>


Description

    Create a repository with options: org (in an organization), private, description, auto_init (a first commit with a README, needed for the file functions on a new repository), default_branch, gitignores, license, readme, template

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    name:   The name of the repository - String - required
    options_json:   The options - String - required
admin
gitea repo_create "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "billing" "{\"org\": \"acme\", \"private\": true, \"description\": \"Billing scripts\", \"auto_init\": true, \"default_branch\": \"main\"}"
mentdb
{"id": 2, "full_name": "acme/billing", "html_url": "http://127.0.0.1:3000/acme/billing", "clone_url": "http://127.0.0.1:3000/acme/billing.git"}

gitea repos <config>


Description

    The repositories the account can see: rows {id, full_name, owner, name, private, default_branch, description, html_url, clone_url, stars, forks, open_issues, updated}

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
admin
gitea repos "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}"
mentdb
[{"id": 2, "full_name": "acme/billing", "owner": "acme", "name": "billing", "private": true, "default_branch": "main", "description": "Billing scripts", "html_url": "http://127.0.0.1:3000/acme/billing", "clone_url": "http://127.0.0.1:3000/acme/billing.git", "stars": 0, "forks": 0, "open_issues": 0, "updated": "2026-11-17T20:00:37+04:00"}, {"id": 1, "full_name": "ops/sandbox", "owner": "ops", "name": "sandbox", "private": false, "default_branch": "main", "description": "", "html_url": "http://127.0.0.1:3000/ops/sandbox", "clone_url": "http://127.0.0.1:3000/ops/sandbox.git", "stars": 0, "forks": 0, "open_issues": 0, "updated": "2026-11-17T20:00:34+04:00"}]

gitea repos <config> <options_json>


Description

    The repositories with options: owner (a user or an organization), query (a part of the name), limit (100)

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    options_json:   The options - String - required
admin
gitea repos "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "{\"owner\": \"acme\"}"
mentdb
[{"id": 2, "full_name": "acme/billing", "owner": "acme", "name": "billing", "private": true, "default_branch": "main", "description": "Billing scripts", "html_url": "http://127.0.0.1:3000/acme/billing", "clone_url": "http://127.0.0.1:3000/acme/billing.git", "stars": 0, "forks": 0, "open_issues": 0, "updated": "2026-11-17T20:00:37+04:00"}]
a search by name (fixed result: real Gitea 28.4.0)
admin
gitea repos "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "{\"query\": \"sand\"}"
mentdb
[{"id": 1, "full_name": "ops/sandbox", "owner": "ops", "name": "sandbox", "private": false, "default_branch": "main", "description": "", "html_url": "http://127.0.0.1:3000/ops/sandbox", "clone_url": "http://127.0.0.1:3000/ops/sandbox.git", "stars": 0, "forks": 0, "open_issues": 0, "updated": "2026-11-17T20:00:34+04:00"}]

gitea repo_get <config> <repo>


Description

    The whole representation of a repository; null when it does not exist

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
admin
gitea repo_get "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/nothing"
mentdb
null

gitea file_put <config> <repo> <path> <content>


Description

    Create or update a text file (one commit on the default branch). Returns {path, sha, commit, created}

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    path:   The path of the file in the repository, like config/rates.json - String - required
    content:   The content (UTF-8 text, or base64 with the option base64) - String - required
admin
gitea file_put "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "config/rates.json" "{\"vat\": 0.2}"
mentdb
{"path": "config/rates.json", "sha": "d8eec1b8f2615f79caccf386227af35bae737a6d", "commit": "4716e479cd399ae6d775943664ba1c18ec171201", "created": true}

gitea file_put <config> <repo> <path> <content> <options_json>


Description

    Create or update a file with options: message (the commit message), branch, new_branch (the commit goes to a new branch made from branch), sha (the current sha, read by the function when missing), base64 (true: the content is base64, for binary data), author_name, author_email

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    path:   The path of the file in the repository, like config/rates.json - String - required
    content:   The content (UTF-8 text, or base64 with the option base64) - String - required
    options_json:   The options - String - required
admin
gitea file_put "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "config/rates.json" "{\"vat\": 0.085}" "{\"message\": \"VAT of Reunion Island\", \"author_name\": \"MentDB job\", \"author_email\": \"jobs@example.com\"}"
mentdb
{"path": "config/rates.json", "sha": "0efdbff6faa8b02acc2fac58e1e296ba4a279649", "commit": "486bef62f06d15d2e2839ad819a87d8aa5510678", "created": false}
a binary file on a new branch (fixed result: real Gitea 28.4.0)
admin
gitea file_put "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "img/logo.png" "iVBORw0KGgo=" "{\"base64\": true, \"branch\": \"main\", \"new_branch\": \"feature-logo\"}"
mentdb
{"path": "img/logo.png", "sha": "0dd1608e45a9c4d35bfc1e6f266a796364aa8754", "commit": "d9b82a94e39d226bc3717520b411231c4798952d", "created": true}
a fix on another new branch (fixed result: real Gitea 28.4.0)
admin
gitea file_put "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "config/rates.json" "{\"vat\": 0.085, \"currency\": \"EUR\"}" "{\"branch\": \"main\", \"new_branch\": \"fix-currency\", \"message\": \"Add the currency\"}"
mentdb
{"path": "config/rates.json", "sha": "9e48371d618e69aa9603a7dcd08345964214c3f6", "commit": "7baef1d76e29cb26ae02765580a7ef6c75977d01", "created": false}

gitea file_get <config> <repo> <path>


Description

    Read a file: {path, sha, size, encoding (utf-8 or base64), content}; a folder gives its entries as rows {name, path, type, size, sha}; null when it does not exist

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    path:   The path of the file in the repository, like config/rates.json - String - required
admin
gitea file_get "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "config/rates.json"
mentdb
{"path": "config/rates.json", "sha": "0efdbff6faa8b02acc2fac58e1e296ba4a279649", "size": 14, "encoding": "utf-8", "content": "{\"vat\": 0.085}"}
a folder (fixed result: real Gitea 28.4.0)
admin
gitea file_get "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "config"
mentdb
[{"name": "rates.json", "path": "config/rates.json", "type": "file", "size": 14, "sha": "0efdbff6faa8b02acc2fac58e1e296ba4a279649"}]
no such file (fixed result: real Gitea 28.4.0)
admin
gitea file_get "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "nothing.txt"
mentdb
null

gitea file_get <config> <repo> <path> <options_json>


Description

    Read a file with options: ref (a branch, a tag or a commit), base64 (true: always base64)

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    path:   The path of the file in the repository, like config/rates.json - String - required
    options_json:   The options - String - required
admin
gitea file_get "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "img/logo.png" "{\"ref\": \"feature-logo\"}"
mentdb
{"path": "img/logo.png", "sha": "0dd1608e45a9c4d35bfc1e6f266a796364aa8754", "size": 8, "encoding": "base64", "content": "iVBORw0KGgo="}

gitea branches <config> <repo>


Description

    The branches: rows {name, commit, message, protected}

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
admin
gitea branches "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing"
mentdb
[{"name": "fix-currency", "commit": "7baef1d76e29cb26ae02765580a7ef6c75977d01", "message": "Add the currency", "protected": false}, {"name": "feature-logo", "commit": "d9b82a94e39d226bc3717520b411231c4798952d", "message": "Create img/logo.png", "protected": false}, {"name": "main", "commit": "486bef62f06d15d2e2839ad819a87d8aa5510678", "message": "VAT of Reunion Island", "protected": false}]

gitea label_create <config> <repo> <name>


Description

    Create a label (green). Returns {id, name}

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    name:   The name of the label - String - required
admin
gitea label_create "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "urgent"
mentdb
{"id": 1, "name": "urgent"}

gitea label_create <config> <repo> <name> <options_json>


Description

    Create a label with options: color (#rrggbb), description, exclusive (scoped labels like priority/high)

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    name:   The name of the label - String - required
    options_json:   The options - String - required
admin
gitea label_create "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "bug" "{\"color\": \"#d73a4a\", \"description\": \"Something is wrong\"}"
mentdb
{"id": 2, "name": "bug"}

gitea labels <config> <repo>


Description

    The labels of a repository: rows {id, name, color, description, exclusive}

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
admin
gitea labels "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing"
mentdb
[{"id": 2, "name": "bug", "color": "d73a4a", "description": "Something is wrong", "exclusive": false}, {"id": 1, "name": "urgent", "color": "0e8a16", "description": "", "exclusive": false}]

gitea issue_create <config> <repo> <title>


Description

    Open an issue. Returns {number, id, html_url}

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    title:   The title - String - required
admin
gitea issue_create "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "Add a PDF export"
mentdb
{"number": 1, "id": 1, "html_url": "http://127.0.0.1:3000/acme/billing/issues/1"}

gitea issue_create <config> <repo> <title> <options_json>


Description

    Open an issue with options: body (Markdown), labels (names), assignees (logins), milestone (id), due_date (ISO 8601)

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    title:   The title - String - required
    options_json:   The options - String - required
admin
gitea issue_create "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "Wrong VAT on the invoices" "{\"body\": \"The VAT is 20 % instead of 8.5 %.\", \"labels\": [\"bug\", \"urgent\"], \"assignees\": [\"ops\"]}"
mentdb
{"number": 2, "id": 2, "html_url": "http://127.0.0.1:3000/acme/billing/issues/2"}

gitea issues <config> <repo>


Description

    The open issues (not the pull requests): rows {number, title, state, user, labels, assignees, milestone, comments, created, updated, closed, html_url}

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
admin
gitea issues "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing"
mentdb
[{"number": 2, "title": "Wrong VAT on the invoices", "state": "open", "user": "ops", "labels": ["bug", "urgent"], "assignees": ["ops"], "milestone": null, "comments": 0, "created": "2026-11-17T20:00:38+04:00", "updated": "2026-11-17T20:00:38+04:00", "closed": null, "html_url": "http://127.0.0.1:3000/acme/billing/issues/2"}, {"number": 1, "title": "Add a PDF export", "state": "open", "user": "ops", "labels": [], "assignees": [], "milestone": null, "comments": 0, "created": "2026-11-17T20:00:38+04:00", "updated": "2026-11-17T20:00:38+04:00", "closed": null, "html_url": "http://127.0.0.1:3000/acme/billing/issues/1"}]

gitea issues <config> <repo> <filter_json>


Description

    Search the issues: state (open, closed, all), labels (names: a JSON array or a comma separated text, every label must be there), query (words of the title or body), milestone (names), assignee (login), limit (100)

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    filter_json:   The filter as a JSON object - String - required
admin
gitea issues "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "{\"labels\": \"bug\", \"state\": \"all\"}"
mentdb
[{"number": 2, "title": "Wrong VAT on the invoices", "state": "open", "user": "ops", "labels": ["bug", "urgent"], "assignees": ["ops"], "milestone": null, "comments": 0, "created": "2026-11-17T20:00:38+04:00", "updated": "2026-11-17T20:00:38+04:00", "closed": null, "html_url": "http://127.0.0.1:3000/acme/billing/issues/2"}]

gitea issue_comment <config> <repo> <number> <body>


Description

    Add a comment (Markdown). Returns {id, html_url}

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    number:   The number of the issue or of the pull request - String - required
    body:   The comment - String - required
admin
gitea issue_comment "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "2" "Fixed in config/rates.json"
mentdb
{"id": 4, "html_url": "http://127.0.0.1:3000/acme/billing/issues/2#issuecomment-4"}

gitea issue_update <config> <repo> <number> <changes_json>


Description

    Change an issue: title, body, state (open, closed), labels (names: they replace the labels), assignees, milestone (id, 0 to remove), due_date. Returns {number, state}

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    number:   The number of the issue or of the pull request - String - required
    changes_json:   The changes as a JSON object - String - required
admin
gitea issue_update "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "1" "{\"title\": \"Add a PDF and a CSV export\", \"labels\": [\"urgent\"]}"
mentdb
{"number": 1, "state": "open"}

gitea issue_close <config> <repo> <number>


Description

    Close an issue (or a pull request). Returns {number, state}

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    number:   The number of the issue or of the pull request - String - required
admin
gitea issue_close "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "2"
mentdb
{"number": 2, "state": "closed"}

gitea issue_get <config> <repo> <number>


Description

    An issue with its body (same fields as the rows of gitea issues); null when it does not exist

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    number:   The number of the issue or of the pull request - String - required
admin
gitea issue_get "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "2"
mentdb
{"number": 2, "title": "Wrong VAT on the invoices", "state": "closed", "user": "ops", "labels": ["bug", "urgent"], "assignees": ["ops"], "milestone": null, "comments": 1, "created": "2026-11-17T20:00:38+04:00", "updated": "2026-11-17T20:00:38+04:00", "closed": "2026-11-17T20:00:38+04:00", "html_url": "http://127.0.0.1:3000/acme/billing/issues/2", "body": "The VAT is 20 % instead of 8.5 %."}

gitea pull_create <config> <repo> <head> <base> <title>


Description

    Open a pull request from the branch head to the branch base. Returns {number, html_url, mergeable}

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    head:   The branch with the changes (owner:branch for a fork) - String - required
    base:   The target branch - String - required
    title:   The title - String - required
admin
gitea pull_create "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "feature-logo" "main" "Add the logo"
mentdb
{"number": 3, "html_url": "http://127.0.0.1:3000/acme/billing/pulls/3", "mergeable": true}

gitea pull_create <config> <repo> <head> <base> <title> <options_json>


Description

    Open a pull request with options: body, labels (names), assignees

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    head:   The branch with the changes - String - required
    base:   The target branch - String - required
    title:   The title - String - required
    options_json:   The options - String - required
admin
gitea pull_create "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "fix-currency" "main" "Add the currency" "{\"body\": \"The rates need their currency.\", \"labels\": [\"urgent\"]}"
mentdb
{"number": 4, "html_url": "http://127.0.0.1:3000/acme/billing/pulls/4", "mergeable": true}

gitea pulls <config> <repo>


Description

    The open pull requests: rows {number, title, state, user, head, base, mergeable, merged, labels, created, html_url}

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
admin
gitea pulls "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing"
mentdb
[{"number": 4, "title": "Add the currency", "state": "open", "user": "ops", "head": "fix-currency", "base": "main", "mergeable": true, "merged": false, "labels": ["urgent"], "created": "2026-11-17T20:00:38+04:00", "html_url": "http://127.0.0.1:3000/acme/billing/pulls/4"}, {"number": 3, "title": "Add the logo", "state": "open", "user": "ops", "head": "feature-logo", "base": "main", "mergeable": true, "merged": false, "labels": [], "created": "2026-11-17T20:00:38+04:00", "html_url": "http://127.0.0.1:3000/acme/billing/pulls/3"}]

gitea pulls <config> <repo> <filter_json>


Description

    The pull requests with a filter: state (open, closed, all), limit (100)

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    filter_json:   The filter as a JSON object - String - required
admin
gitea pulls "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "{\"state\": \"all\", \"limit\": 10}"
mentdb
[{"number": 4, "title": "Add the currency", "state": "open", "user": "ops", "head": "fix-currency", "base": "main", "mergeable": true, "merged": false, "labels": ["urgent"], "created": "2026-11-17T20:00:38+04:00", "html_url": "http://127.0.0.1:3000/acme/billing/pulls/4"}, {"number": 3, "title": "Add the logo", "state": "open", "user": "ops", "head": "feature-logo", "base": "main", "mergeable": true, "merged": false, "labels": [], "created": "2026-11-17T20:00:38+04:00", "html_url": "http://127.0.0.1:3000/acme/billing/pulls/3"}]

gitea pull_merge <config> <repo> <number>


Description

    Merge a pull request (merge commit). Returns {merged, number, method}

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    number:   The number of the issue or of the pull request - String - required
admin
gitea pull_merge "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "3"
mentdb
{"merged": true, "number": 3, "method": "merge"}

gitea pull_merge <config> <repo> <number> <options_json>


Description

    Merge with options: method (merge, rebase, rebase-merge, squash, fast-forward-only), title and message (of the merge commit), delete_branch

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    number:   The number of the issue or of the pull request - String - required
    options_json:   The options - String - required
admin
gitea pull_merge "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "4" "{\"method\": \"squash\", \"delete_branch\": true}"
mentdb
{"merged": true, "number": 4, "method": "squash"}

gitea release_create <config> <repo> <tag>


Description

    Create a release and its tag on the default branch. Returns {id, tag, html_url, assets}

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    tag:   The tag, like v1.0 - String - required
admin
gitea release_create "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "v0.9"
mentdb
{"id": 1, "tag": "v0.9", "html_url": "http://127.0.0.1:3000/acme/billing/releases/tag/v0.9", "assets": []}

gitea release_create <config> <repo> <tag> <options_json>


Description

    Create a release with options: name, body (Markdown), target (the branch or commit of a new tag), draft, prerelease, assets (paths of files to attach, read with the file rights of the session)

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    tag:   The tag, like v1.0 - String - required
    options_json:   The options - String - required
admin
gitea release_create "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "v1.0" "{\"name\": \"Version 1.0\", \"body\": \"First release\", \"target\": \"main\", \"assets\": [\"tmp/release/app-1.0.zip\"]}"
mentdb
{"id": 2, "tag": "v1.0", "html_url": "http://127.0.0.1:3000/acme/billing/releases/tag/v1.0", "assets": [{"id": 1, "name": "app-1.0.zip", "size": 2048, "download_url": "http://127.0.0.1:3000/attachments/5061b7dc-959c-41e8-9cdd-c63eaed62147"}]}

gitea releases <config> <repo>


Description

    The releases: rows {id, tag, name, target, draft, prerelease, author, created, published, html_url, assets: [{id, name, size, download_url}]}

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
admin
gitea releases "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing"
mentdb
[{"id": 2, "tag": "v1.0", "name": "Version 1.0", "target": "main", "draft": false, "prerelease": false, "author": "ops", "created": "2026-11-17T20:00:39+04:00", "published": "2026-11-17T20:00:39+04:00", "html_url": "http://127.0.0.1:3000/acme/billing/releases/tag/v1.0", "assets": [{"id": 1, "name": "app-1.0.zip", "size": 2048, "download_url": "http://127.0.0.1:3000/acme/billing/releases/download/v1.0/app-1.0.zip"}]}, {"id": 1, "tag": "v0.9", "name": "v0.9", "target": "main", "draft": false, "prerelease": false, "author": "ops", "created": "2026-11-17T20:00:39+04:00", "published": "2026-11-17T20:00:39+04:00", "html_url": "http://127.0.0.1:3000/acme/billing/releases/tag/v0.9", "assets": []}]

gitea releases <config> <repo> <options_json>


Description

    The releases with options: limit (100)

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    options_json:   The options - String - required
admin
gitea releases "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "{\"limit\": 1}"
mentdb
[{"id": 2, "tag": "v1.0", "name": "Version 1.0", "target": "main", "draft": false, "prerelease": false, "author": "ops", "created": "2026-11-17T20:00:39+04:00", "published": "2026-11-17T20:00:39+04:00", "html_url": "http://127.0.0.1:3000/acme/billing/releases/tag/v1.0", "assets": [{"id": 1, "name": "app-1.0.zip", "size": 2048, "download_url": "http://127.0.0.1:3000/acme/billing/releases/download/v1.0/app-1.0.zip"}]}]

gitea webhook_create <config> <repo> <url>


Description

    Create a webhook called on push. Returns the webhook row

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    url:   The URL called by Gitea - String - required
admin
gitea webhook_create "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "https://mentdb.example.com/api/gitea"
mentdb
{"id": 1, "type": "gitea", "url": "https://mentdb.example.com/api/gitea", "content_type": "json", "events": ["push"], "active": true, "branch_filter": "", "created": "2026-11-17T20:00:40+04:00"}

gitea webhook_create <config> <repo> <url> <options_json>


Description

    Create a webhook with options: events (push, issues, pull_request, release, create, delete...; Gitea adds the related events), type (gitea, forgejo, slack, discord, msteams...), content_type (json or form), secret (the HMAC key of the signature header, never echoed), active (true), branch_filter (a glob like main or release/*)

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    url:   The URL called by Gitea - String - required
    options_json:   The options - String - required
admin
gitea webhook_create "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "https://mentdb.example.com/api/gitea-release" "{\"events\": [\"release\"], \"secret\": \"gitea_hook_secret\", \"branch_filter\": \"main\"}"
mentdb
{"id": 2, "type": "gitea", "url": "https://mentdb.example.com/api/gitea-release", "content_type": "json", "events": ["release"], "active": true, "branch_filter": "main", "created": "2026-11-17T20:00:40+04:00"}

gitea webhooks <config> <repo>


Description

    The webhooks of a repository: rows {id, type, url, content_type, events, active, branch_filter, created} (never the secret)

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
admin
gitea webhooks "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing"
mentdb
[{"id": 1, "type": "gitea", "url": "https://mentdb.example.com/api/gitea", "content_type": "json", "events": ["push"], "active": true, "branch_filter": "", "created": "2026-11-17T20:00:40+04:00"}, {"id": 2, "type": "gitea", "url": "https://mentdb.example.com/api/gitea-release", "content_type": "json", "events": ["release"], "active": true, "branch_filter": "main", "created": "2026-11-17T20:00:40+04:00"}]

gitea webhook_delete <config> <repo> <id>


Description

    Delete a webhook by its id. Returns {deleted}

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    id:   The id of the webhook - String - required
admin
gitea webhook_delete "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "1"
mentdb
{"deleted": 1}

gitea file_delete <config> <repo> <path>


Description

    Delete a file (one commit). Returns {deleted: 1, commit}, or {deleted: 0} when it does not exist

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    path:   The path of the file in the repository, like config/rates.json - String - required
admin
gitea file_delete "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "config/rates.json"
mentdb
{"deleted": 1, "commit": "61e4bcdf24f16bfed17038a43b8a0e9b14a86cdf"}

gitea file_delete <config> <repo> <path> <options_json>


Description

    Delete a file with options: message, branch, sha

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
    path:   The path of the file in the repository, like config/rates.json - String - required
    options_json:   The options - String - required
admin
gitea file_delete "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "acme/billing" "img/logo.png" "{\"branch\": \"main\", \"message\": \"Remove the old logo\"}"
mentdb
{"deleted": 1, "commit": "39fa98e35b7d4850f7ccf173e873c81a9585f6ae"}

gitea repo_delete <config> <repo>


Description

    Delete a repository (no way back). Returns {deleted: 1}, or 0 when it does not exist

Parameters

    config:   The Gitea or Forgejo configuration as JSON: url (http://127.0.0.1:3000, the root of the server: the API is under /api/v1), token (an access token, the recommended way; give it the scopes the functions need) or username and password (basic authentication), nothing for the public data, ca_file (a PEM file of a private CA, with https), allow_plain (false: credentials over http are refused unless the host is localhost, 127.0.0.1 or ::1), timeout_ms (30000), max_bytes (64 MB, the largest answer) - String - required
    repo:   The repository: owner/name (the owner is a user or an organization) - String - required
admin
gitea repo_delete "{\"url\": \"http://127.0.0.1:3000\", \"token\": \"gitea_token\"}" "ops/sandbox"
mentdb
{"deleted": 1}