v68

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-011,21696712.3 MB
campaigns

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.

patch/orgs/{org}/campaigns/{campaign_number}

Path parameters

orgstring required

The organization name. The name is not case sensitive.

campaign_numberinteger required

The campaign number.

Request body

namestring

The name of the campaign

descriptionstring

A description for the campaign

managersstring[]

The logins of the users to set as the campaign managers. At this time, only a single manager can be supplied.

team_managersstring[]

The slugs of the teams to set as the campaign managers.

ends_atstring date-time

The end date and time of the campaign, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.

contact_linkstring uri nullable

The contact link of the campaign. Must be a URI.

state'open' | 'closed'

Indicates whether a campaign is open or closed

Response

Response

numberinteger required

The number of the newly created campaign

created_atstring date-time required

The date and time the campaign was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.

updated_atstring date-time required

The date and time the campaign was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.

namestring

The campaign name

descriptionstring required

The campaign description

published_atstring date-time

The date and time the campaign was published, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.

ends_atstring date-time required

The date and time the campaign has ended, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ.

closed_atstring date-time nullable

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.

state'open' | 'closed' required

Indicates whether a campaign is open or closed

contact_linkstring uri nullable required

The contact link of the campaign.

Example response

{
  "managers": [
    {
      "login": "octocat",
      "id": 1,
      "node_id": "MDQ6VXNlcjE=",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "gravatar_id": "41d064eb2195891e12d0413f63227ea7",
      "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",
      "starred_at": "\"2020-07-09T00:17:55Z\"",
      "user_view_type": "public"
    }
  ],
  "team_managers": [
    {
      "html_url": "https://github.com/orgs/rails/teams/core",
      "access_source": "direct",
      "organization_id": 37,
      "enterprise_id": 42,
      "parent": {
        "id": 1,
        "node_id": "MDQ6VGVhbTE=",
        "url": "https://api.github.com/organizations/1/team/1",
        "members_url": "https://api.github.com/organizations/1/team/1/members{/member}",
        "name": "Justice League",
        "description": "A great team.",
        "permission": "admin",
        "privacy": "closed",
        "notification_setting": "notifications_enabled",
        "html_url": "https://github.com/orgs/rails/teams/core",
        "repositories_url": "https://api.github.com/organizations/1/team/1/repos",
        "slug": "justice-league",
        "ldap_dn": "uid=example,ou=users,dc=github,dc=com",
        "organization_id": 37,
        "enterprise_id": 42
      }
    }
  ]
}