Skip to main content
GitHub logo

Overview

Add GitHub to any ModuleX agent or workflow. Repository, issue, pull request, branch, commit, and code search actions against the GitHub REST API (v3, api.github.com).
Categories: Developer Tools & Infrastructure · Version Control · Productivity · Auth: OAuth2, Personal Access Token · Actions: 16

Authentication

OAuth2 Authentication

Connect using GitHub OAuth (recommended for most use cases)

Required Credentials

FieldDescriptionRequiredFormat
Client IDGitHub OAuth App Client IDYesIv1.xxxxxxxxxxxxxxxx
Client SecretGitHub OAuth App Client SecretYesxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

OAuth Configuration

  • Authorization URL: https://github.com/login/oauth/authorize
  • Token URL: https://github.com/login/oauth/access_token
  • Scopes: repo, user, read:org, workflow

Available Actions

Parameters

visibility
string
Filter by visibility: all, public, private (Default: all)
sort
string
Sort by: created, updated, pushed, full_name (Default: full_name)
per_page
integer
Results per page (max 100) (Default: 30)

Response

{
  "$defs": {
    "RepositorySummary": {
      "additionalProperties": false,
      "description": "One row of ``list_repositories``.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "full_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Full Name"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Description"
        },
        "private": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Private"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Url"
        },
        "clone_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Clone Url"
        },
        "ssh_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Ssh Url"
        },
        "language": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Language"
        },
        "stars": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Stars"
        },
        "forks": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Forks"
        },
        "open_issues": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Open Issues"
        },
        "default_branch": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Default Branch"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Created At"
        },
        "updated_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Updated At"
        }
      },
      "title": "RepositorySummary",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "repositories": {
      "items": {
        "$ref": "#/$defs/RepositorySummary"
      },
      "title": "Repositories",
      "type": "array"
    },
    "total": {
      "default": 0,
      "title": "Total",
      "type": "integer"
    },
    "page": {
      "default": 1,
      "title": "Page",
      "type": "integer"
    },
    "per_page": {
      "default": 30,
      "title": "Per Page",
      "type": "integer"
    }
  },
  "required": [
    "success"
  ],
  "title": "ListRepositoriesOutput",
  "type": "object"
}

Parameters

name
string
required
Repository name
description
string
Repository description
private
boolean
Whether the repository is private (Default: false)

Response

{
  "$defs": {
    "RepositoryCreated": {
      "additionalProperties": false,
      "description": "Repository representation from ``create_repository``.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "full_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Full Name"
        },
        "owner": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Owner"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Url"
        },
        "clone_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Clone Url"
        },
        "private": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Private"
        },
        "default_branch": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Default Branch"
        }
      },
      "title": "RepositoryCreated",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "repository": {
      "$ref": "#/$defs/RepositoryCreated"
    }
  },
  "required": [
    "success",
    "repository"
  ],
  "title": "CreateRepositoryOutput",
  "type": "object"
}

Parameters

owner
string
required
Repository owner (username or organization)
repo
string
required
Repository name to delete

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "message": {
      "title": "Message",
      "type": "string"
    }
  },
  "required": [
    "success",
    "message"
  ],
  "title": "DeleteRepositoryOutput",
  "type": "object"
}

Parameters

owner
string
required
Repository owner
repo
string
required
Repository name

Response

{
  "$defs": {
    "RepositoryDetailed": {
      "additionalProperties": false,
      "description": "Repository representation from ``get_repository``.",
      "properties": {
        "id": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Id"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "full_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Full Name"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Description"
        },
        "private": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Private"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Url"
        },
        "clone_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Clone Url"
        },
        "ssh_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Ssh Url"
        },
        "language": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Language"
        },
        "stars": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Stars"
        },
        "forks": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Forks"
        },
        "watchers": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Watchers"
        },
        "open_issues": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Open Issues"
        },
        "default_branch": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Default Branch"
        },
        "topics": {
          "items": {
            "type": "string"
          },
          "title": "Topics",
          "type": "array"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Created At"
        },
        "updated_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Updated At"
        },
        "pushed_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Pushed At"
        }
      },
      "title": "RepositoryDetailed",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "repository": {
      "$ref": "#/$defs/RepositoryDetailed"
    }
  },
  "required": [
    "success",
    "repository"
  ],
  "title": "GetRepositoryOutput",
  "type": "object"
}

Parameters

owner
string
required
Repository owner
repo
string
required
Repository name
state
string
Issue state: open, closed, all (Default: open)

Response

{
  "$defs": {
    "IssueSummary": {
      "additionalProperties": false,
      "description": "Issue row in ``list_issues`` / single fetch in ``get_issue``.",
      "properties": {
        "number": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Number"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "body": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Body"
        },
        "state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "State"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Url"
        },
        "user": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "User"
        },
        "labels": {
          "items": {
            "type": "string"
          },
          "title": "Labels",
          "type": "array"
        },
        "assignees": {
          "items": {
            "type": "string"
          },
          "title": "Assignees",
          "type": "array"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Created At"
        },
        "updated_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Updated At"
        },
        "closed_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Closed At"
        },
        "comments": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Comments"
        }
      },
      "title": "IssueSummary",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "issues": {
      "items": {
        "$ref": "#/$defs/IssueSummary"
      },
      "title": "Issues",
      "type": "array"
    },
    "total": {
      "default": 0,
      "title": "Total",
      "type": "integer"
    },
    "page": {
      "default": 1,
      "title": "Page",
      "type": "integer"
    },
    "per_page": {
      "default": 30,
      "title": "Per Page",
      "type": "integer"
    }
  },
  "required": [
    "success"
  ],
  "title": "ListIssuesOutput",
  "type": "object"
}

Parameters

owner
string
required
Repository owner
repo
string
required
Repository name
title
string
required
Issue title
body
string
Issue body
labels
array
Issue labels

Response

{
  "$defs": {
    "IssueCreated": {
      "additionalProperties": false,
      "description": "Issue representation from ``create_issue``.",
      "properties": {
        "number": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Number"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "body": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Body"
        },
        "state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "State"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Url"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Created At"
        }
      },
      "title": "IssueCreated",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "issue": {
      "$ref": "#/$defs/IssueCreated"
    }
  },
  "required": [
    "success",
    "issue"
  ],
  "title": "CreateIssueOutput",
  "type": "object"
}

Parameters

owner
string
required
Repository owner
repo
string
required
Repository name
issue_number
integer
required
Issue number

Response

{
  "$defs": {
    "IssueSummary": {
      "additionalProperties": false,
      "description": "Issue row in ``list_issues`` / single fetch in ``get_issue``.",
      "properties": {
        "number": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Number"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "body": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Body"
        },
        "state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "State"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Url"
        },
        "user": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "User"
        },
        "labels": {
          "items": {
            "type": "string"
          },
          "title": "Labels",
          "type": "array"
        },
        "assignees": {
          "items": {
            "type": "string"
          },
          "title": "Assignees",
          "type": "array"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Created At"
        },
        "updated_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Updated At"
        },
        "closed_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Closed At"
        },
        "comments": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Comments"
        }
      },
      "title": "IssueSummary",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "issue": {
      "$ref": "#/$defs/IssueSummary"
    }
  },
  "required": [
    "success",
    "issue"
  ],
  "title": "GetIssueOutput",
  "type": "object"
}

Parameters

owner
string
required
Repository owner
repo
string
required
Repository name
issue_number
integer
required
Issue number
title
string
Issue title
body
string
Issue body
state
string
Issue state: open or closed

Response

{
  "$defs": {
    "IssueUpdated": {
      "additionalProperties": false,
      "description": "Issue representation from ``update_issue``.",
      "properties": {
        "number": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Number"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "body": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Body"
        },
        "state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "State"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Url"
        },
        "updated_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Updated At"
        }
      },
      "title": "IssueUpdated",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "issue": {
      "$ref": "#/$defs/IssueUpdated"
    }
  },
  "required": [
    "success",
    "issue"
  ],
  "title": "UpdateIssueOutput",
  "type": "object"
}

Parameters

owner
string
required
Repository owner
repo
string
required
Repository name
state
string
PR state: open, closed, all (Default: open)

Response

{
  "$defs": {
    "PullRequestSummary": {
      "additionalProperties": false,
      "description": "PR row in ``list_pull_requests``.",
      "properties": {
        "number": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Number"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "body": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Body"
        },
        "state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "State"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Url"
        },
        "user": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "User"
        },
        "head": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Head"
        },
        "base": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Base"
        },
        "draft": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Draft"
        },
        "mergeable": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Mergeable"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Created At"
        },
        "updated_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Updated At"
        },
        "merged_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Merged At"
        },
        "closed_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Closed At"
        }
      },
      "title": "PullRequestSummary",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "pull_requests": {
      "items": {
        "$ref": "#/$defs/PullRequestSummary"
      },
      "title": "Pull Requests",
      "type": "array"
    },
    "total": {
      "default": 0,
      "title": "Total",
      "type": "integer"
    },
    "page": {
      "default": 1,
      "title": "Page",
      "type": "integer"
    },
    "per_page": {
      "default": 30,
      "title": "Per Page",
      "type": "integer"
    }
  },
  "required": [
    "success"
  ],
  "title": "ListPullRequestsOutput",
  "type": "object"
}

Parameters

owner
string
required
Repository owner
repo
string
required
Repository name
title
string
required
Pull request title
head
string
required
The name of the branch where your changes are implemented
base
string
required
The name of the branch you want the changes pulled into
body
string
Pull request description

Response

{
  "$defs": {
    "PullRequestCreated": {
      "additionalProperties": false,
      "description": "PR representation from ``create_pull_request``.",
      "properties": {
        "number": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Number"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "body": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Body"
        },
        "state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "State"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Url"
        },
        "draft": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Draft"
        },
        "head": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Head"
        },
        "base": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Base"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Created At"
        }
      },
      "title": "PullRequestCreated",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "pull_request": {
      "$ref": "#/$defs/PullRequestCreated"
    }
  },
  "required": [
    "success",
    "pull_request"
  ],
  "title": "CreatePullRequestOutput",
  "type": "object"
}

Parameters

owner
string
required
Repository owner
repo
string
required
Repository name
pull_number
integer
required
Pull request number

Response

{
  "$defs": {
    "PullRequestDetailed": {
      "additionalProperties": false,
      "description": "PR representation from ``get_pull_request``.",
      "properties": {
        "number": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Number"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "body": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Body"
        },
        "state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "State"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Url"
        },
        "user": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "User"
        },
        "head": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Head"
        },
        "base": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Base"
        },
        "draft": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Draft"
        },
        "mergeable": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Mergeable"
        },
        "merged": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Merged"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Created At"
        },
        "updated_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Updated At"
        },
        "merged_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Merged At"
        },
        "closed_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Closed At"
        },
        "commits": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Commits"
        },
        "additions": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Additions"
        },
        "deletions": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Deletions"
        },
        "changed_files": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Changed Files"
        }
      },
      "title": "PullRequestDetailed",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "pull_request": {
      "$ref": "#/$defs/PullRequestDetailed"
    }
  },
  "required": [
    "success",
    "pull_request"
  ],
  "title": "GetPullRequestOutput",
  "type": "object"
}

Parameters

owner
string
required
Repository owner
repo
string
required
Repository name
pull_number
integer
required
Pull request number
commit_message
string
Commit message for the merge
merge_method
string
Merge method: merge, squash, rebase (Default: merge)

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "merged": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Merged"
    },
    "message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Message"
    },
    "sha": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Sha"
    }
  },
  "required": [
    "success"
  ],
  "title": "MergePullRequestOutput",
  "type": "object"
}

Parameters

owner
string
required
Repository owner
repo
string
required
Repository name
branch_name
string
required
New branch name
from_branch
string
Source branch (defaults to default branch)

Response

{
  "$defs": {
    "Branch": {
      "additionalProperties": false,
      "description": "Branch returned by ``create_branch``.",
      "properties": {
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "ref": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Ref"
        },
        "sha": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Sha"
        }
      },
      "title": "Branch",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "branch": {
      "$ref": "#/$defs/Branch"
    }
  },
  "required": [
    "success",
    "branch"
  ],
  "title": "CreateBranchOutput",
  "type": "object"
}

Parameters

owner
string
required
Repository owner
repo
string
required
Repository name
path
string
required
File path
branch
string
Branch name (defaults to default branch)

Response

{
  "$defs": {
    "FileContent": {
      "additionalProperties": false,
      "description": "File returned by ``get_file_content`` (content is base64-decoded UTF-8).",
      "properties": {
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Path"
        },
        "size": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Size"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Content"
        },
        "sha": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Sha"
        },
        "download_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Download Url"
        }
      },
      "title": "FileContent",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "file": {
      "$ref": "#/$defs/FileContent"
    }
  },
  "required": [
    "success",
    "file"
  ],
  "title": "GetFileContentOutput",
  "type": "object"
}

Parameters

owner
string
required
Repository owner
repo
string
required
Repository name
branch
string
required
Branch name
message
string
required
Commit message
files
array
required
Array of file objects with path and content

Response

{
  "$defs": {
    "CommitCreated": {
      "additionalProperties": false,
      "description": "Commit returned by ``create_commit``.",
      "properties": {
        "sha": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Sha"
        },
        "message": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Message"
        },
        "branch": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Branch"
        }
      },
      "title": "CommitCreated",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "commit": {
      "$ref": "#/$defs/CommitCreated"
    }
  },
  "required": [
    "success",
    "commit"
  ],
  "title": "CreateCommitOutput",
  "type": "object"
}

Parameters

query
string
required
Search query
sort
string
Sort by: indexed (default) (Default: indexed)
per_page
integer
Results per page (max 100) (Default: 30)

Response

{
  "$defs": {
    "SearchCodeItem": {
      "additionalProperties": false,
      "description": "One result row of ``search_code``.",
      "properties": {
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Path"
        },
        "repository": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Repository"
        },
        "url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Url"
        },
        "sha": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Sha"
        }
      },
      "title": "SearchCodeItem",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "total_count": {
      "default": 0,
      "title": "Total Count",
      "type": "integer"
    },
    "items": {
      "items": {
        "$ref": "#/$defs/SearchCodeItem"
      },
      "title": "Items",
      "type": "array"
    },
    "page": {
      "default": 1,
      "title": "Page",
      "type": "integer"
    },
    "per_page": {
      "default": 30,
      "title": "Per Page",
      "type": "integer"
    }
  },
  "required": [
    "success"
  ],
  "title": "SearchCodeOutput",
  "type": "object"
}

Limits & Quotas

  • Authenticated REST API: 5,000 requests per hour per token.
  • Search API (search_code): 30 requests per minute, separate quota — and q must be at least one valid qualifier (e.g. repo:owner/name or language:python).
  • create_commit makes five sequential API calls (ref, base commit, one blob per file, tree, commit, ref update). Budget accordingly when committing many files.
  • delete_repository is irreversible and requires the token to carry the delete_repo scope; Fine-grained tokens additionally need the Administration: write permission.

GitLab

Greptile

Algolia