Github
GitHub is a platform for version control and collaboration, enabling developers to manage and share code.
GitHub is a leading platform for version control and collaboration, enabling developers to manage and review code. The GitHub connector for Swimlane Turbine allows users to automate various GitHub operations such as managing repositories, issues, and pull requests. By integrating GitHub with Swimlane Turbine, users can streamline their security workflows, enhance collaboration, and automate repetitive tasks, thereby improving efficiency and reducing manual errors.
Prerequisites
Before you can use the GitHub connector for Turbine, you'll need access to the GitHub API. This requires the following:
- HTTP Bearer authentication using the following parameters:
- URL: The base URL for accessing the GitHub API.
- Token: A GitHub Personal Access Token (PAT) or JWT-Token for authenticating API requests.
Asset Setup
- To generate a Personal Access Token, please follow the instructions here.
- To generate a JWT-Token, please follow the instructions here.
Capabilities
The GitHub bundle has the following capabilities:
- Block a user
- Create a Repository Dispatch Event
- Create an Issue
- Create or Update File Contents
- Get a Pull Request
- Get a User
- Get an Issue
- Get an Organization by ID
- Get File
- List Organizations
- Revoke PAT (Fine-Grained Token)
Task Setup
Create a Repository Dispatch Event
- This action is used to trigger a webhook event called repository_dispatch when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the repository_dispatch event occurs. For an example repository_dispatch webhook payload, see "RepositoryDispatchEvent."
- The client_payload parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the client_payload can include a message that a user would like to send using a GitHub Actions workflow. Or the client_payload can be used as a test to debug your workflow.
- OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
- Fine-grained access tokens for "Create a repository dispatch event"
- This action works with the following fine-grained token types:
- The fine-grained token must have the following permission set:
- "Contents" repository permissions (write)
- GitHub's documentation for this action can be found here.
Notes
Additional Documentation
Configurations
HTTP Bearer Authentication
Authenticates using a GitHub PAT or JWT-Token.
Configuration Parameters
Parameter | Description | Type | Required |
|---|---|---|---|
url | An URL to the GitHub host. | string | Required |
token | A JWT-Token or an Access Token with sufficient permissions. | string | Required |
verify_ssl | Verify SSL certificate | boolean | Optional |
http_proxy | A proxy to route requests through. | string | Optional |
Actions
Block a user
Block a specified GitHub user by username and receive a confirmation with a 204 status. If blocking is not possible, a 422 error will be returned.
Endpoint
- URL: /user/blocks/{{username}}
- Method: PUT
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
headers | object | Required | HTTP headers for the request |
headers.X-GitHub-Api-Version | string | Required | HTTP headers for the request |
headers.Accept | string | Required | HTTP headers for the request |
path_parameters.username | string | Required | Parameters for the Block a user action |
Input Example
{"headers":{"X-GitHub-Api-Version":"2022-11-28","Accept":"application/vnd.github+json"},"path_parameters":{"username":"github"}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
response_text | string | Output field: response_text |
Output Example
{"status_code":204,"response_headers":{"Server":"GitHub.com","Date":"Sat, 04 Nov 2023 12:24:59 GMT","X-OAuth-Scopes":"admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, ad...","X-Accepted-OAuth-Scopes":"user","X-GitHub-Media-Type":"github.v3; format=json","x-github-api-version-selected":"2022-11-28","X-RateLimit-Limit":"5000","X-RateLimit-Remaining":"4989","X-RateLimit-Reset":"1699102435","X-RateLimit-Used":"11","X-RateLimit-Resource":"core","Access-Control-Expose-Head...
Create a Repository Dispatch Event
Trigger a repository_dispatch webhook event in GitHub to initiate Actions workflows or App webhooks using specified event_type, owner, and repo.
Endpoint
- URL: /repos/{{owner}}/{{repo}}/dispatches
- Method: POST
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
path_parameters.owner | string | Required | The account owner of the repository. The name is not case sensitive. |
path_parameters.repo | string | Required | The name of the repository without the .git extension. The name is not case sensitive. |
headers | object | Required | HTTP headers for the request |
headers.Accept | string | Required | Setting to application/vnd.github+json is recommended. |
headers.X-GitHub-Api-Version | string | Required | HTTP headers for the request |
event_type | string | Optional | A custom webhook event name. Must be 100 characters or fewer. |
client_payload | object | Optional | JSON payload with extra information about the webhook event that your action or workflow may use. The maximum number of top-level properties is 10. The total size of the JSON payload must be less than 64KB. |
client_payload.unit | boolean | Optional | Parameter for Create a Repository Dispatch Event |
client_payload.integration | boolean | Optional | Parameter for Create a Repository Dispatch Event |
Input Example
{"json_body":{"event_type":"on-demand-test","client_payload":{"unit":false,"integration":true}},"headers":{"Accept":"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
response_text | string | Output field: response_text |
Output Example
{"status_code":204,"response_headers":{"Server":"GitHub.com","Date":"Wed, 18 Dec 2024 12:24:59 GMT","X-OAuth-Scopes":"admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, ad...","X-Accepted-OAuth-Scopes":"user","X-GitHub-Media-Type":"github.v3; format=json","x-github-api-version-selected":"2022-11-28","X-RateLimit-Limit":"5000","X-RateLimit-Remaining":"4989","X-RateLimit-Reset":"1699102435","X-RateLimit-Used":"11","X-RateLimit-Resource":"core","Access-Control-Expose-Head...
Create an Issue
Create a new issue in a specified GitHub repository using the provided title. Requires owner, repo, and additional details.
Endpoint
- URL: /repos/{{owner}}/{{repo}}/issues
- Method: POST
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
path_parameters.owner | string | Required | The account owner of the repository. The name is not case sensitive. |
path_parameters.repo | string | Required | The name of the repository without the .git extension. The name is not case sensitive. |
headers | object | Required | HTTP headers for the request |
headers.Accept | string | Required | HTTP headers for the request |
headers.X-GitHub-Api-Version | string | Required | HTTP headers for the request |
title | string | Optional | The title of the issue. |
body | string | Optional | The contents of the issue. |
assignee | string | Optional | Login for the user that this issue should be assigned to. |
milestone | string | Optional | The number of the milestone to associate this issue with. |
labels | array | Optional | Labels to associate with this issue. |
assignees | array | Optional | Logins for Users to assign to this issue. |
Input Example
{"path_parameters":{"owner":"string","repo":"string"},"headers":{"Accept":"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"},"title":"string","body":"string","assignee":"string","milestone":"string","labels":["string"],"assignees":["string"]}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
url | string | URL endpoint for the request |
repository_url | string | URL endpoint for the request |
labels_url | string | URL endpoint for the request |
comments_url | string | URL endpoint for the request |
events_url | string | URL endpoint for the request |
html_url | string | URL endpoint for the request |
id | number | Unique identifier |
node_id | string | Unique identifier |
number | number | Output field: number |
title | string | Output field: title |
user | object | Output field: user |
user.login | string | Output field: user.login |
user.id | number | Unique identifier |
user.node_id | string | Unique identifier |
user.avatar_url | string | URL endpoint for the request |
user.gravatar_id | string | Unique identifier |
user.url | string | URL endpoint for the request |
user.html_url | string | URL endpoint for the request |
user.followers_url | string | URL endpoint for the request |
user.following_url | string | URL endpoint for the request |
user.gists_url | string | URL endpoint for the request |
user.starred_url | string | URL endpoint for the request |
user.subscriptions_url | string | URL endpoint for the request |
Output Example
{"status_code":201,"response_headers":{"Server":"GitHub.com","Date":"Sun, 10 Sep 2023 09:00:36 GMT","Content-Type":"application/json; charset=utf-8","Content-Length":"6126","Cache-Control":"private, max-age=60, s-maxage=60","Vary":"Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requeste...","ETag":"\"b85f090c17f8a0f07b38d07c42a6a59116fd960958f5b71a5f764ab32759965a\"","X-OAuth-Scopes":"admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:repo_hook, adm...","X...
Create or Update File Contents
Create or update file contents in a GitHub repository using path parameters (owner, repo, path) and JSON body with message and content.
Endpoint
- URL: /repos/{{owner}}/{{repo}}/contents/{{path}}
- Method: PUT
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
path_parameters.owner | string | Required | The account owner of the repository. The name is not case sensitive. |
path_parameters.repo | string | Required | The name of the repository without the .git extension. The name is not case sensitive. |
path_parameters.path | string | Required | Path from root to the file to be created or updated. |
headers | object | Required | HTTP headers for the request |
headers.Accept | string | Required | HTTP headers for the request |
headers.X-GitHub-Api-Version | string | Required | HTTP headers for the request |
message | string | Optional | The commit message. |
content | string | Optional | The file content, using Base64 encoding. |
sha | string | Optional | Required if you are updating a file. The blob SHA of the file being replaced. |
branch | string | Optional | The branch name. Default - the repositoryβs default branch. |
committer | object | Optional | The person that committed the file. Default - the authenticated user. |
committer.name | string | Optional | The name of the committer of the commit. You'll receive a 422 status code if name is omitted. |
committer.email | string | Optional | The email of the committer of the commit. You'll receive a 422 status code if email is omitted. |
committer.date | string | Optional | Date value |
author | object | Optional | Parameter for Create or Update File Contents |
author.name | string | Optional | The name of the author of the commit. You'll receive a 422 status code if name is omitted. |
author.email | string | Optional | The email of the author of the commit. You'll receive a 422 status code if email is omitted. |
author.date | string | Optional | Date value |
Input Example
{"path_parameters":{"owner":"string","repo":"string","path":"string"},"headers":{"Accept":"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"},"message":"string","content":"string","sha":"string","branch":"string","committer":{"name":"Example Name","email":"[email protected]","date":"2024-01-01T00:00:00Z"},"author":{"name":"Example Name","email":"[email protected]","date":"2024-01-01T00:00:00Z"}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
content | object | Response content |
content.name | string | Name of the resource |
content.path | string | Response content |
content.sha | string | Response content |
content.size | number | Response content |
content.url | string | URL endpoint for the request |
content.html_url | string | URL endpoint for the request |
content.git_url | string | URL endpoint for the request |
content.download_url | string | URL endpoint for the request |
content.type | string | Type of the resource |
content._links | object | Response content |
content._links.self | string | Response content |
content._links.git | string | Response content |
content._links.html | string | Response content |
commit | object | Output field: commit |
commit.sha | string | Output field: commit.sha |
commit.node_id | string | Unique identifier |
commit.url | string | URL endpoint for the request |
commit.html_url | string | URL endpoint for the request |
commit.author | object | Output field: commit.author |
commit.author.name | string | Name of the resource |
commit.author.email | string | Output field: commit.author.email |
commit.author.date | string | Date value |
Output Example
{"status_code":200,"response_headers":{"Server":"GitHub.com","Date":"Sun, 10 Sep 2023 08:29:41 GMT","Content-Type":"application/json; charset=utf-8","Transfer-Encoding":"chunked","Cache-Control":"private, max-age=60, s-maxage=60","Vary":"Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requeste...","ETag":"W/\"911292a7951b39bdc0d53e0b0ed712f92385469a64c500a2fc0e186c6d1498ec\"","X-OAuth-Scopes":"admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:repo_hook, ad...
Get a Pull Request
Retrieve detailed information for a specific pull request in GitHub using the repository owner, repo name, and pull number.
Endpoint
- URL: /repos/{{owner}}/{{repo}}/pulls/{{pull_number}}
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
path_parameters.owner | string | Required | The account owner of the repository. The name is not case sensitive. |
path_parameters.repo | string | Required | The name of the repository without the .git extension. The name is not case sensitive. |
path_parameters.pull_number | number | Required | Parameters for the Get a Pull Request action |
headers | object | Required | HTTP headers for the request |
headers.Accept | string | Required | HTTP headers for the request |
headers.X-GitHub-Api-Version | string | Required | HTTP headers for the request |
Input Example
{"path_parameters":{"owner":"string","repo":"string","pull_number":123},"headers":{"Accept":"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
url | string | URL endpoint for the request |
id | number | Unique identifier |
node_id | string | Unique identifier |
html_url | string | URL endpoint for the request |
diff_url | string | URL endpoint for the request |
patch_url | string | URL endpoint for the request |
issue_url | string | URL endpoint for the request |
commits_url | string | URL endpoint for the request |
review_comments_url | string | URL endpoint for the request |
review_comment_url | string | URL endpoint for the request |
comments_url | string | URL endpoint for the request |
statuses_url | string | URL endpoint for the request |
number | number | Output field: number |
state | string | Output field: state |
locked | boolean | Output field: locked |
title | string | Output field: title |
user | object | Output field: user |
user.login | string | Output field: user.login |
user.id | number | Unique identifier |
user.node_id | string | Unique identifier |
user.avatar_url | string | URL endpoint for the request |
user.gravatar_id | string | Unique identifier |
user.url | string | URL endpoint for the request |
Output Example
{"status_code":200,"response_headers":{"Server":"GitHub.com","Date":"Sun, 10 Sep 2023 09:19:31 GMT","Content-Type":"application/json; charset=utf-8","Transfer-Encoding":"chunked","Cache-Control":"private, max-age=60, s-maxage=60","Vary":"Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requeste...","ETag":"W/\"14f5e385ca01e477288dbb7e7d33bd5bb23711ee98b7fd5df71a58efba5418b2\"","Last-Modified":"Wed, 06 Sep 2023 16:27:54 GMT","X-OAuth-Scopes":"admin:enterprise, admin:gpg_key...
Get a user
Retrieve publicly available information about a GitHub user by specifying the username in the path parameters.
Endpoint
- URL: /users/{{username}}
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
headers | object | Required | HTTP headers for the request |
headers.X-GitHub-Api-Version | string | Required | HTTP headers for the request |
headers.Accept | string | Required | HTTP headers for the request |
path_parameters.username | string | Required | Parameters for the Get a user action |
Input Example
{"headers":{"X-GitHub-Api-Version":"2022-11-28","Accept":"application/vnd.github+json"},"path_parameters":{"username":"github"}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
login | string | Output field: login |
id | number | Unique identifier |
node_id | string | Unique identifier |
avatar_url | string | URL endpoint for the request |
gravatar_id | string | Unique identifier |
url | string | URL endpoint for the request |
html_url | string | URL endpoint for the request |
followers_url | string | URL endpoint for the request |
following_url | string | URL endpoint for the request |
gists_url | string | URL endpoint for the request |
starred_url | string | URL endpoint for the request |
subscriptions_url | string | URL endpoint for the request |
organizations_url | string | URL endpoint for the request |
repos_url | string | URL endpoint for the request |
events_url | string | URL endpoint for the request |
received_events_url | string | URL endpoint for the request |
type | string | Type of the resource |
site_admin | boolean | Output field: site_admin |
name | string | Name of the resource |
company | object | Output field: company |
blog | string | Output field: blog |
location | string | Output field: location |
object | Output field: email |
Output Example
{"status_code":200,"response_headers":{"Server":"GitHub.com","Date":"Sat, 04 Nov 2023 12:21:15 GMT","Content-Type":"application/json; charset=utf-8","Transfer-Encoding":"chunked","Cache-Control":"private, max-age=60, s-maxage=60","Vary":"Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requeste...","ETag":"W/\"a2fdd5420c59742e686712e811415f38e938e83c135f72002e3e7578fae72711\"","Last-Modified":"Tue, 29 Nov 2022 19:44:55 GMT","X-OAuth-Scopes":"admin:enterprise, admin:gpg_key...
Get an Issue
Retrieve details for a specific issue from a GitHub repository using the owner, repo, and issue number.
Endpoint
- URL: /repos/{{owner}}/{{repo}}/issues/{{issue_number}}
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
path_parameters.owner | string | Required | The account owner of the repository. The name is not case sensitive. |
path_parameters.repo | string | Required | The name of the repository without the .git extension. The name is not case sensitive. |
path_parameters.issue_number | number | Required | Parameters for the Get an Issue action |
headers | object | Required | HTTP headers for the request |
headers.Accept | string | Required | HTTP headers for the request |
headers.X-GitHub-Api-Version | string | Required | HTTP headers for the request |
Input Example
{"path_parameters":{"owner":"string","repo":"string","issue_number":123},"headers":{"Accept":"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
url | string | URL endpoint for the request |
repository_url | string | URL endpoint for the request |
labels_url | string | URL endpoint for the request |
comments_url | string | URL endpoint for the request |
events_url | string | URL endpoint for the request |
html_url | string | URL endpoint for the request |
id | number | Unique identifier |
node_id | string | Unique identifier |
number | number | Output field: number |
title | string | Output field: title |
user | object | Output field: user |
user.login | string | Output field: user.login |
user.id | number | Unique identifier |
user.node_id | string | Unique identifier |
user.avatar_url | string | URL endpoint for the request |
user.gravatar_id | string | Unique identifier |
user.url | string | URL endpoint for the request |
user.html_url | string | URL endpoint for the request |
user.followers_url | string | URL endpoint for the request |
user.following_url | string | URL endpoint for the request |
user.gists_url | string | URL endpoint for the request |
user.starred_url | string | URL endpoint for the request |
user.subscriptions_url | string | URL endpoint for the request |
Output Example
{"status_code":200,"response_headers":{"Server":"GitHub.com","Date":"Sun, 10 Sep 2023 09:07:57 GMT","Content-Type":"application/json; charset=utf-8","Transfer-Encoding":"chunked","Cache-Control":"private, max-age=60, s-maxage=60","Vary":"Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requeste...","ETag":"W/\"b85f090c17f8a0f07b38d07c42a6a59116fd960958f5b71a5f764ab32759965a\"","Last-Modified":"Sun, 10 Sep 2023 09:00:36 GMT","X-OAuth-Scopes":"admin:enterprise, admin:gpg_key...
Get an Organization by ID
Retrieve details of a specific GitHub organization using its unique ID. Requires headers and the 'orgId' path parameter.
Endpoint
- URL: /orgs/{{orgId}}
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
headers | object | Required | HTTP headers for the request |
headers.X-GitHub-Api-Version | string | Required | HTTP headers for the request |
headers.Accept | string | Required | HTTP headers for the request |
path_parameters.orgId | string | Required | Parameters for the Get an Organization by ID action |
Input Example
{"headers":{"X-GitHub-Api-Version":"2022-11-28","Accept":"application/vnd.github+json"},"path_parameters":{"org":"1"}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
login | string | Output field: login |
id | number | Unique identifier |
node_id | string | Unique identifier |
url | string | URL endpoint for the request |
repos_url | string | URL endpoint for the request |
events_url | string | URL endpoint for the request |
hooks_url | string | URL endpoint for the request |
issues_url | string | URL endpoint for the request |
members_url | string | URL endpoint for the request |
public_members_url | string | URL endpoint for the request |
avatar_url | string | URL endpoint for the request |
description | string | Output field: description |
name | string | Name of the resource |
company | object | Output field: company |
blog | string | Output field: blog |
location | string | Output field: location |
object | Output field: email | |
twitter_username | object | Name of the resource |
is_verified | boolean | Output field: is_verified |
has_organization_projects | boolean | Output field: has_organization_projects |
has_repository_projects | boolean | Output field: has_repository_projects |
public_repos | number | Output field: public_repos |
public_gists | number | Output field: public_gists |
Output Example
{"status_code":200,"response_headers":{"Server":"GitHub.com","Date":"Sat, 04 Nov 2023 12:18:22 GMT","Content-Type":"application/json; charset=utf-8","Transfer-Encoding":"chunked","Cache-Control":"private, max-age=60, s-maxage=60","Vary":"Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requeste...","ETag":"W/\"834f4948c757254f52bcf9431917b61e686bf22a9aba5324d662c440dbdc79ac\"","Last-Modified":"Tue, 29 Nov 2022 19:44:55 GMT","X-OAuth-Scopes":"admin:enterprise, admin:gpg_key...
Get File
Retrieve the content of a specified file or directory from a GitHub repository using the repository's owner, name, and file path.
Endpoint
- URL: /repos/{{owner}}/{{repo}}/contents/{{path}}
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
path_parameters.owner | string | Required | The account owner of the repository. The name is not case sensitive. |
path_parameters.repo | string | Required | The name of the repository without the .git extension. The name is not case sensitive. |
path_parameters.path | string | Required | File path or Directory path from root. |
headers | object | Required | HTTP headers for the request |
headers.Accept | string | Required | HTTP headers for the request |
headers.X-GitHub-Api-Version | string | Required | HTTP headers for the request |
parameters.ref | string | Optional | Parameters for the Get File action |
Input Example
{"path_parameters":{"owner":"string","repo":"string","path":"string"},"headers":{"Accept":"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"},"parameters":{"ref":"string"}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
name | string | Name of the resource |
path | string | Output field: path |
sha | string | Output field: sha |
size | number | Output field: size |
url | string | URL endpoint for the request |
html_url | string | URL endpoint for the request |
git_url | string | URL endpoint for the request |
download_url | string | URL endpoint for the request |
type | string | Type of the resource |
content | string | Response content |
encoding | string | Output field: encoding |
_links | object | Output field: _links |
_links.self | string | Output field: _links.self |
_links.git | string | Output field: _links.git |
_links.html | string | Output field: _links.html |
Output Example
{"status_code":200,"response_headers":{"Server":"GitHub.com","Date":"Sun, 10 Sep 2023 08:38:19 GMT","Content-Type":"application/json; charset=utf-8","Transfer-Encoding":"chunked","Cache-Control":"private, max-age=60, s-maxage=60","Vary":"Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requeste...","ETag":"W/\"7d71b040dbc5ed0cee2775d7bc31bf9962bb65b3\"","Last-Modified":"Sun, 10 Sep 2023 08:33:32 GMT","X-OAuth-Scopes":"admin:enterprise, admin:gpg_key, admin:org, admin:org_h...
List organizations
Retrieve a list of all organizations on GitHub in the order they were created, requiring specific header information.
Endpoint
- URL: /organizations
- Method: GET
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
headers | object | Required | HTTP headers for the request |
headers.X-GitHub-Api-Version | string | Required | HTTP headers for the request |
headers.Accept | string | Required | HTTP headers for the request |
parameters.since | number | Optional | Parameters for the List organizations action |
parameters.per_page | number | Optional | Parameters for the List organizations action |
Input Example
{"parameters":{"since":1,"per_page":10},"headers":{"X-GitHub-Api-Version":"2022-11-28","Accept":"application/vnd.github+json"}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
Output Example
{"status_code":200,"response_headers":{"Server":"GitHub.com","Date":"Sat, 04 Nov 2023 12:09:27 GMT","Content-Type":"application/json; charset=utf-8","Transfer-Encoding":"chunked","Cache-Control":"private, max-age=60, s-maxage=60","Vary":"Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requeste...","ETag":"W/\"7a188c41cd70b54373cb4a941d92eb1cc2950b97dfbd498e62b4477be6d00a05\"","X-OAuth-Scopes":"admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, a...
Revoke PAT
Update an organization member's resource access by revoking a specified fine-grained personal access token in GitHub. Requires orgId, patId, and action in the request.
Endpoint
- URL: /orgs/{{orgId}}/personal-access-tokens/{{patId}}
- Method: POST
Input
Argument Name | Type | Required | Description |
|---|---|---|---|
headers | object | Required | HTTP headers for the request |
headers.X-GitHub-Api-Version | string | Required | HTTP headers for the request |
headers.Accept | string | Required | HTTP headers for the request |
path_parameters.orgId | string | Required | Parameters for the Revoke PAT action |
path_parameters.patId | string | Required | Parameters for the Revoke PAT action |
action | string | Optional | Parameter for Revoke PAT |
Input Example
{"json_body":{"action":"revoke"},"headers":{"X-GitHub-Api-Version":"2022-11-28","Accept":"application/vnd.github+json"}}
Output
Parameter | Type | Description |
|---|---|---|
status_code | number | HTTP status code of the response |
reason | string | Response reason phrase |
response_text | string | Output field: response_text |
Output Example
{"status_code":204,"response_headers":{"Server":"GitHub.com","Date":"Sat, 04 Nov 2023 12:24:59 GMT","X-OAuth-Scopes":"admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, ad...","X-Accepted-OAuth-Scopes":"user","X-GitHub-Media-Type":"github.v3; format=json","x-github-api-version-selected":"2022-11-28","X-RateLimit-Limit":"5000","X-RateLimit-Remaining":"4989","X-RateLimit-Reset":"1699102435","X-RateLimit-Used":"11","X-RateLimit-Resource":"core","Access-Control-Expose-Head...
Response Headers
Header | Description | Example |
|---|---|---|
Access-Control-Allow-Origin | HTTP response header: Access-Control-Allow-Origin | * |
Access-Control-Expose-Headers | HTTP response header: Access-Control-Expose-Headers | ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset |
Cache-Control | Directives for caching mechanisms | private, max-age=60, s-maxage=60 |
Content-Encoding | HTTP response header: Content-Encoding | gzip |
Content-Length | The length of the response body in bytes | 6126 |
Content-Security-Policy | HTTP response header: Content-Security-Policy | default-src 'none' |
Content-Type | The media type of the resource | application/json; charset=utf-8 |
Date | The date and time at which the message was originated | Sun, 10 Sep 2023 09:19:31 GMT |
ETag | An identifier for a specific version of a resource | W/"a2fdd5420c59742e686712e811415f38e938e83c135f72002e3e7578fae72711" |
github-authentication-token-expiration | HTTP response header: github-authentication-token-expiration | 2023-09-17 08:10:24 UTC |
Last-Modified | The date and time at which the origin server believes the resource was last modified | Sun, 10 Sep 2023 09:00:36 GMT |
Link | HTTP response header: Link | https://api.github.com/organizations?since=374&per_page=10; rel="next", https://api.github.com/organizations{?since}; rel="first" |
Location | The URL to redirect a page to | |
Referrer-Policy | HTTP response header: Referrer-Policy | origin-when-cross-origin, strict-origin-when-cross-origin |
Server | Information about the software used by the origin server | GitHub.com |
Strict-Transport-Security | HTTP response header: Strict-Transport-Security | max-age=31536000; includeSubdomains; preload |
Transfer-Encoding | HTTP response header: Transfer-Encoding | chunked |
Vary | HTTP response header: Vary | Accept-Encoding, Accept, X-Requested-With |
X-Accepted-OAuth-Scopes | HTTP response header: X-Accepted-OAuth-Scopes | user |
X-Content-Type-Options | HTTP response header: X-Content-Type-Options | nosniff |
X-Frame-Options | HTTP response header: X-Frame-Options | deny |
x-github-api-version-selected | HTTP response header: x-github-api-version-selected | 2022-11-28 |
X-GitHub-Media-Type | HTTP response header: X-GitHub-Media-Type | github.v3; format=json |
X-GitHub-Request-Id | HTTP response header: X-GitHub-Request-Id | 9C92:3EAD8:1DF464:236A59:65463477 |
X-OAuth-Scopes | HTTP response header: X-OAuth-Scopes | admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, admin:ssh_signing_key, audit_log, codespace, delete:packages, delete_repo, gist, notifications, project, repo, user, workflow, write:discussion, write:packages |
X-RateLimit-Limit | The number of requests allowed in the current rate limit window | 5000 |
X-RateLimit-Remaining | The number of requests remaining in the current rate limit window | 4989 |
X-RateLimit-Reset | The time at which the current rate limit window resets | 1694337529 |
X-RateLimit-Resource | HTTP response header: X-RateLimit-Resource | core |
X-RateLimit-Used | HTTP response header: X-RateLimit-Used | 3 |
X-XSS-Protection | HTTP response header: X-XSS-Protection | 0 |