← All tags

Agents API Reference

Endpoints for Agents secrets and variables.

30 endpoints tagged agents, each listing its parameters and possible responses. Search or scroll the index below to jump to a specific endpoint.

No endpoints match your search.

List organization secrets

GET /orgs/{org}/agents/secrets

Lists all secrets available in an organization without revealing their

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes

Get an organization public key

GET /orgs/{org}/agents/secrets/public-key

Gets your public key, which you need to encrypt secrets. You need to

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes

Get an organization secret

GET /orgs/{org}/agents/secrets/{secret_name}

Gets a single organization secret without revealing its encrypted value.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
secret_namepathyesThe name of the secret.

Responses

StatusDescriptionHas JSON body
200Responseyes

Create or update an organization secret

PUT /orgs/{org}/agents/secrets/{secret_name}

Creates or updates an organization secret with an encrypted value. Encrypt your secret using

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
secret_namepathyesThe name of the secret.

Responses

StatusDescriptionHas JSON body
201Response when creating a secretyes
204Response when updating a secretno

Delete an organization secret

DELETE /orgs/{org}/agents/secrets/{secret_name}

Deletes a secret in an organization using the secret name.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
secret_namepathyesThe name of the secret.

Responses

StatusDescriptionHas JSON body
204Responseno

List selected repositories for an organization secret

GET /orgs/{org}/agents/secrets/{secret_name}/repositories

Lists all repositories that have been selected when the visibility

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
secret_namepathyesThe name of the secret.
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes

Set selected repositories for an organization secret

PUT /orgs/{org}/agents/secrets/{secret_name}/repositories

Replaces all repositories for an organization secret when the visibility

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
secret_namepathyesThe name of the secret.

Responses

StatusDescriptionHas JSON body
204Responseno

Add selected repository to an organization secret

PUT /orgs/{org}/agents/secrets/{secret_name}/repositories/{repository_id}

Adds a repository to an organization secret when the visibility for

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
secret_namepathyesThe name of the secret.
repository_idpathyes

Responses

StatusDescriptionHas JSON body
204No Content when repository was added to the selected listno
409Conflict when visibility type is not set to selectedno

Remove selected repository from an organization secret

DELETE /orgs/{org}/agents/secrets/{secret_name}/repositories/{repository_id}

Removes a repository from an organization secret when the visibility

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
secret_namepathyesThe name of the secret.
repository_idpathyes

Responses

StatusDescriptionHas JSON body
204Response when repository was removed from the selected listno
409Conflict when visibility type not set to selectedno

List organization variables

GET /orgs/{org}/agents/variables

Lists all agent variables available in an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
per_pagequerynoThe number of results per page (max 30). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes

Create an organization variable

POST /orgs/{org}/agents/variables

Creates an organization agent variable that you can reference in a GitHub Actions workflow.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
201Response when creating a variableyes

Get an organization variable

GET /orgs/{org}/agents/variables/{name}

Gets a specific agent variable in an organization.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
namepathyesThe name of the variable.

Responses

StatusDescriptionHas JSON body
200Responseyes

Update an organization variable

PATCH /orgs/{org}/agents/variables/{name}

Updates an organization agent variable that you can reference in a GitHub Actions workflow.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
namepathyesThe name of the variable.

Responses

StatusDescriptionHas JSON body
204Responseno

Delete an organization variable

DELETE /orgs/{org}/agents/variables/{name}

Deletes an organization agent variable using the variable name.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
namepathyesThe name of the variable.

Responses

StatusDescriptionHas JSON body
204Responseno

List selected repositories for an organization variable

GET /orgs/{org}/agents/variables/{name}/repositories

Lists all repositories that can access an organization agent variable

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
namepathyesThe name of the variable.
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes
409Response when the visibility of the variable is not set to selectedno

Set selected repositories for an organization variable

PUT /orgs/{org}/agents/variables/{name}/repositories

Replaces all repositories for an organization agent variable that is available

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
namepathyesThe name of the variable.

Responses

StatusDescriptionHas JSON body
204Responseno
409Response when the visibility of the variable is not set to selectedno

Add selected repository to an organization variable

PUT /orgs/{org}/agents/variables/{name}/repositories/{repository_id}

Adds a repository to an organization agent variable that is available to selected repositories.

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
namepathyesThe name of the variable.
repository_idpathyes

Responses

StatusDescriptionHas JSON body
204Responseno
409Response when the visibility of the variable is not set to selectedno

Remove selected repository from an organization variable

DELETE /orgs/{org}/agents/variables/{name}/repositories/{repository_id}

Removes a repository from an organization agent variable that is

Parameters

NameInRequiredDescription
orgpathyesThe organization name. The name is not case sensitive.
namepathyesThe name of the variable.
repository_idpathyes

Responses

StatusDescriptionHas JSON body
204Responseno
409Response when the visibility of the variable is not set to selectedno

List repository organization secrets

GET /repos/{owner}/{repo}/agents/organization-secrets

Lists all organization secrets shared with a repository without revealing their encrypted

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes

List repository organization variables

GET /repos/{owner}/{repo}/agents/organization-variables

Lists all organization variables shared with a repository.

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.
per_pagequerynoThe number of results per page (max 30). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes

List repository secrets

GET /repos/{owner}/{repo}/agents/secrets

Lists all secrets available in a repository without revealing their encrypted

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.
per_pagequerynoThe number of results per page (max 100). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes

Get a repository public key

GET /repos/{owner}/{repo}/agents/secrets/public-key

Gets your public key, which you need to encrypt secrets. You need to

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
200Responseyes

Get a repository secret

GET /repos/{owner}/{repo}/agents/secrets/{secret_name}

Gets a single repository secret without revealing its encrypted value.

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.
secret_namepathyesThe name of the secret.

Responses

StatusDescriptionHas JSON body
200Responseyes

Create or update a repository secret

PUT /repos/{owner}/{repo}/agents/secrets/{secret_name}

Creates or updates a repository secret with an encrypted value. Encrypt your secret using

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.
secret_namepathyesThe name of the secret.

Responses

StatusDescriptionHas JSON body
201Response when creating a secretyes
204Response when updating a secretno

Delete a repository secret

DELETE /repos/{owner}/{repo}/agents/secrets/{secret_name}

Deletes a secret in a repository using the secret name.

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.
secret_namepathyesThe name of the secret.

Responses

StatusDescriptionHas JSON body
204Responseno

List repository variables

GET /repos/{owner}/{repo}/agents/variables

Lists all repository variables.

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.
per_pagequerynoThe number of results per page (max 30). For more information, see "Using pagination in the REST API."
pagequerynoThe page number of the results to fetch. For more information, see "Using pagination in the REST API."

Responses

StatusDescriptionHas JSON body
200Responseyes

Create a repository variable

POST /repos/{owner}/{repo}/agents/variables

Creates a repository variable that you can reference in a GitHub Actions workflow.

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.

Responses

StatusDescriptionHas JSON body
201Responseyes

Get a repository variable

GET /repos/{owner}/{repo}/agents/variables/{name}

Gets a specific variable in a repository.

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.
namepathyesThe name of the variable.

Responses

StatusDescriptionHas JSON body
200Responseyes

Update a repository variable

PATCH /repos/{owner}/{repo}/agents/variables/{name}

Updates a repository variable that you can reference in a GitHub Actions workflow.

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.
namepathyesThe name of the variable.

Responses

StatusDescriptionHas JSON body
204Responseno

Delete a repository variable

DELETE /repos/{owner}/{repo}/agents/variables/{name}

Deletes a repository variable using the variable name.

Parameters

NameInRequiredDescription
ownerpathyesThe account owner of the repository. The name is not case sensitive.
repopathyesThe name of the repository without the .git extension. The name is not case sensitive.
namepathyesThe name of the variable.

Responses

StatusDescriptionHas JSON body
204Responseno