Endpoints to manage Code security using the REST API.
20 endpoints tagged code-security, each listing its
parameters and possible responses. Search or scroll the index below to
jump to a specific endpoint.
No endpoints match your search.
GET /enterprises/{enterprise}/code-security/configurations
Lists all code security configurations available in an enterprise.
| Name | In | Required | Description |
|---|---|---|---|
enterprise | path | yes | The slug version of the enterprise name. |
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
before | query | no | A cursor, as given in the Link header. If specified, the query only searches for results before this cursor. For more information, see "Using pagination in the REST API." |
after | query | no | A cursor, as given in the Link header. If specified, the query only searches for results after this cursor. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 403 | Forbidden | yes |
| 404 | Resource not found | yes |
POST /enterprises/{enterprise}/code-security/configurations
Creates a code security configuration in an enterprise.
| Name | In | Required | Description |
|---|---|---|---|
enterprise | path | yes | The slug version of the enterprise name. |
| Status | Description | Has JSON body |
|---|---|---|
| 201 | Successfully created code security configuration | yes |
| 400 | Bad Request | yes |
| 403 | Forbidden | yes |
| 404 | Resource not found | yes |
GET /enterprises/{enterprise}/code-security/configurations/defaults
Lists the default code security configurations for an enterprise.
| Name | In | Required | Description |
|---|---|---|---|
enterprise | path | yes | The slug version of the enterprise name. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}
Gets a code security configuration available in an enterprise.
| Name | In | Required | Description |
|---|---|---|---|
enterprise | path | yes | The slug version of the enterprise name. |
configuration_id | path | yes | The unique identifier of the code security configuration. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
| 403 | Forbidden | yes |
| 404 | Resource not found | yes |
PATCH /enterprises/{enterprise}/code-security/configurations/{configuration_id}
Updates a code security configuration in an enterprise.
| Name | In | Required | Description |
|---|---|---|---|
enterprise | path | yes | The slug version of the enterprise name. |
configuration_id | path | yes | The unique identifier of the code security configuration. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
| 403 | Forbidden | yes |
| 404 | Resource not found | yes |
| 409 | Conflict | yes |
DELETE /enterprises/{enterprise}/code-security/configurations/{configuration_id}
Deletes a code security configuration from an enterprise.
| Name | In | Required | Description |
|---|---|---|---|
enterprise | path | yes | The slug version of the enterprise name. |
configuration_id | path | yes | The unique identifier of the code security configuration. |
| Status | Description | Has JSON body |
|---|---|---|
| 204 | A header with no content is returned. | no |
| 400 | Bad Request | yes |
| 403 | Forbidden | yes |
| 404 | Resource not found | yes |
| 409 | Conflict | yes |
POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach
Attaches an enterprise code security configuration to repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration.
| Name | In | Required | Description |
|---|---|---|---|
enterprise | path | yes | The slug version of the enterprise name. |
configuration_id | path | yes | The unique identifier of the code security configuration. |
| Status | Description | Has JSON body |
|---|---|---|
| 202 | Accepted | yes |
| 403 | Forbidden | yes |
| 404 | Resource not found | yes |
| 409 | Conflict | yes |
PUT /enterprises/{enterprise}/code-security/configurations/{configuration_id}/defaults
Sets a code security configuration as a default to be applied to new repositories in your enterprise.
| Name | In | Required | Description |
|---|---|---|---|
enterprise | path | yes | The slug version of the enterprise name. |
configuration_id | path | yes | The unique identifier of the code security configuration. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Default successfully changed. | yes |
| 403 | Forbidden | yes |
| 404 | Resource not found | yes |
GET /enterprises/{enterprise}/code-security/configurations/{configuration_id}/repositories
Lists the repositories associated with an enterprise code security configuration in an organization.
| Name | In | Required | Description |
|---|---|---|---|
enterprise | path | yes | The slug version of the enterprise name. |
configuration_id | path | yes | The unique identifier of the code security configuration. |
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
before | query | no | A cursor, as given in the Link header. If specified, the query only searches for results before this cursor. For more information, see "Using pagination in the REST API." |
after | query | no | A cursor, as given in the Link header. If specified, the query only searches for results after this cursor. For more information, see "Using pagination in the REST API." |
status | query | no | A comma-separated list of statuses. If specified, only repositories with these attachment statuses will be returned. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 403 | Forbidden | yes |
| 404 | Resource not found | yes |
GET /orgs/{org}/code-security/configurations
Lists all code security configurations available in an organization.
| Name | In | Required | Description |
|---|---|---|---|
org | path | yes | The organization name. The name is not case sensitive. |
target_type | query | no | The target type of the code security configuration |
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
before | query | no | A cursor, as given in the Link header. If specified, the query only searches for results before this cursor. For more information, see "Using pagination in the REST API." |
after | query | no | A cursor, as given in the Link header. If specified, the query only searches for results after this cursor. For more information, see "Using pagination in the REST API." |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 403 | Forbidden | yes |
| 404 | Resource not found | yes |
POST /orgs/{org}/code-security/configurations
Creates a code security configuration in an organization.
| Name | In | Required | Description |
|---|---|---|---|
org | path | yes | The organization name. The name is not case sensitive. |
| Status | Description | Has JSON body |
|---|---|---|
| 201 | Successfully created code security configuration | yes |
GET /orgs/{org}/code-security/configurations/defaults
Lists the default code security configurations for an organization.
| Name | In | Required | Description |
|---|---|---|---|
org | path | yes | The organization name. The name is not case sensitive. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
| 403 | Forbidden | yes |
| 404 | Resource not found | yes |
DELETE /orgs/{org}/code-security/configurations/detach
Detach code security configuration(s) from a set of repositories.
| Name | In | Required | Description |
|---|---|---|---|
org | path | yes | The organization name. The name is not case sensitive. |
| Status | Description | Has JSON body |
|---|---|---|
| 204 | A header with no content is returned. | no |
| 400 | Bad Request | yes |
| 403 | Forbidden | yes |
| 404 | Resource not found | yes |
| 409 | Conflict | yes |
GET /orgs/{org}/code-security/configurations/{configuration_id}
Gets a code security configuration available in an organization.
| Name | In | Required | Description |
|---|---|---|---|
org | path | yes | The organization name. The name is not case sensitive. |
configuration_id | path | yes | The unique identifier of the code security configuration. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 304 | Not modified | no |
| 403 | Forbidden | yes |
| 404 | Resource not found | yes |
PATCH /orgs/{org}/code-security/configurations/{configuration_id}
Updates a code security configuration in an organization.
| Name | In | Required | Description |
|---|---|---|---|
org | path | yes | The organization name. The name is not case sensitive. |
configuration_id | path | yes | The unique identifier of the code security configuration. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response when a configuration is updated | yes |
| 204 | Response when no new updates are made | no |
DELETE /orgs/{org}/code-security/configurations/{configuration_id}
Deletes the desired code security configuration from an organization.
| Name | In | Required | Description |
|---|---|---|---|
org | path | yes | The organization name. The name is not case sensitive. |
configuration_id | path | yes | The unique identifier of the code security configuration. |
| Status | Description | Has JSON body |
|---|---|---|
| 204 | A header with no content is returned. | no |
| 400 | Bad Request | yes |
| 403 | Forbidden | yes |
| 404 | Resource not found | yes |
| 409 | Conflict | yes |
POST /orgs/{org}/code-security/configurations/{configuration_id}/attach
Attach a code security configuration to a set of repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration.
| Name | In | Required | Description |
|---|---|---|---|
org | path | yes | The organization name. The name is not case sensitive. |
configuration_id | path | yes | The unique identifier of the code security configuration. |
| Status | Description | Has JSON body |
|---|---|---|
| 202 | Accepted | yes |
PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults
Sets a code security configuration as a default to be applied to new repositories in your organization.
| Name | In | Required | Description |
|---|---|---|---|
org | path | yes | The organization name. The name is not case sensitive. |
configuration_id | path | yes | The unique identifier of the code security configuration. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Default successfully changed. | yes |
| 403 | Forbidden | yes |
| 404 | Resource not found | yes |
GET /orgs/{org}/code-security/configurations/{configuration_id}/repositories
Lists the repositories associated with a code security configuration in an organization.
| Name | In | Required | Description |
|---|---|---|---|
org | path | yes | The organization name. The name is not case sensitive. |
configuration_id | path | yes | The unique identifier of the code security configuration. |
per_page | query | no | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
before | query | no | A cursor, as given in the Link header. If specified, the query only searches for results before this cursor. For more information, see "Using pagination in the REST API." |
after | query | no | A cursor, as given in the Link header. If specified, the query only searches for results after this cursor. For more information, see "Using pagination in the REST API." |
status | query | no | A comma-separated list of statuses. If specified, only repositories with these attachment statuses will be returned. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 403 | Forbidden | yes |
| 404 | Resource not found | yes |
GET /repos/{owner}/{repo}/code-security-configuration
Get the code security configuration that manages a repository's code security settings.
| Name | In | Required | Description |
|---|---|---|---|
owner | path | yes | The account owner of the repository. The name is not case sensitive. |
repo | path | yes | The name of the repository without the .git extension. The name is not case sensitive. |
| Status | Description | Has JSON body |
|---|---|---|
| 200 | Response | yes |
| 204 | A header with no content is returned. | no |
| 304 | Not modified | no |
| 403 | Forbidden | yes |
| 404 | Resource not found | yes |