Update a campaign
Updates a campaign in an organization.
The authenticated user must be an owner or security manager for the organization to use this endpoint.
OAuth app tokens and personal access tokens (classic) need the security_events scope to use this endpoint.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The organization name. The name is not case sensitive.
The campaign number.
Request Body required
Section titled “ Request Body required ”object
The name of the campaign
A description for the campaign
The logins of the users to set as the campaign managers. At this time, only a single manager can be supplied.
The slugs of the teams to set as the campaign managers.
The end date and time of the campaign, in ISO 8601 format’:’ YYYY-MM-DDTHH:MM:SSZ.
The contact link of the campaign. Must be a URI.
Indicates whether a campaign is open or closed
Examples
{ "name": "Critical CodeQL alerts"}Responses
Section titled “ Responses ”Response
The campaign metadata and alert stats.
object
The number of the newly created campaign
The date and time the campaign was created, in ISO 8601 format’:’ YYYY-MM-DDTHH:MM:SSZ.
The date and time the campaign was last updated, in ISO 8601 format’:’ YYYY-MM-DDTHH:MM:SSZ.
The campaign name
The campaign description
The campaign managers
A GitHub user.
object
The campaign team managers
Groups of organization members that gives permissions on specified repositories.
object
object
The ownership type of the team
How the team’s access to the repository was granted. This property is only
present when the team is returned in a repository context, such as
GET /repos/{owner}/{repo}/teams.
Unique identifier of the organization to which this team belongs
Unique identifier of the enterprise to which this team belongs
Groups of organization members that gives permissions on specified repositories.
object
Unique identifier of the team
URL for the team
Name of the team
Description of the team
Permission that the team will have for its repositories
The level of privacy this team should have
The notification setting the team has set
Distinguished Name (DN) that team maps to within LDAP environment
The ownership type of the team
Unique identifier of the organization to which this team belongs
Unique identifier of the enterprise to which this team belongs
The date and time the campaign was published, in ISO 8601 format’:’ YYYY-MM-DDTHH:MM:SSZ.
The date and time the campaign has ended, in ISO 8601 format’:’ YYYY-MM-DDTHH:MM:SSZ.
The date and time the campaign was closed, in ISO 8601 format’:’ YYYY-MM-DDTHH:MM:SSZ. Will be null if the campaign is still open.
Indicates whether a campaign is open or closed
The contact link of the campaign.
object
The number of open alerts
The number of closed alerts
The number of in-progress alerts
Examples
{ "number": 3, "created_at": "2024-02-14T12:29:18Z", "updated_at": "2024-02-14T12:29:18Z", "name": "Critical CodeQL alert", "description": "Address critical alerts before they are exploited to prevent breaches, protect sensitive data, and mitigate financial and reputational damage.", "managers": [ { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false } ], "published_at": "2024-02-14T12:29:18Z", "ends_at": "2024-03-14T12:29:18Z", "closed_at": null, "state": "open", "alert_stats": { "open_count": 10, "closed_count": 3, "in_progress_count": 3 }}Bad Request
Basic Error
object
Example generated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}Resource not found
Basic Error
object
Example generated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}Unprocessable Entity
Basic Error
object
Example generated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}Service unavailable
object
Example generated
{ "code": "example", "message": "example", "documentation_url": "example"}