Skip to main content

Enterprise Server 3.21 está disponível no momento como versão candidata a lançamento.

A API REST agora é versionada. Para obter mais informações, confira "Sobre o controle de versão da API".

Pontos de extremidade da API REST para banners de anúncio da organização

A API de Banners de Anúncio da Organização permite obter, definir e remover o banner de anúncio da sua organização.

Get announcement banner for organization

Gets the announcement banner currently set for the organization. Only returns the announcement banner set at the organization level. Organization members may also see an enterprise-level announcement banner. To get an announcement banner displayed at the enterprise level, use the enterprise-level endpoint.

Fine-grained access tokens for "Get announcement banner for organization"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Organization announcement banners" organization permissions (read)

Parâmetros para "Get announcement banner for organization"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

HTTP response status codes for "Get announcement banner for organization"

Status codeDescrição
200

OK

Code samples for "Get announcement banner for organization"

Request example

get/orgs/{org}/announcement
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ http(s)://HOSTNAME/api/v3/orgs/ORG/announcement

Announcement banner

Status: 200
{ "announcement": "Very **important** announcement about _something_.", "expires_at": "2021-01-01T00:00:00.000+00:00", "user_dismissible": false }

Set announcement banner for organization

Sets the announcement banner to display for the organization.

Fine-grained access tokens for "Set announcement banner for organization"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Organization announcement banners" organization permissions (write)

Parâmetros para "Set announcement banner for organization"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

Parâmetros do corpo
Nome, Tipo, Descrição
announcement string or null Obrigatório

The announcement text in GitHub Flavored Markdown. For more information about GitHub Flavored Markdown, see "Basic writing and formatting syntax."

expires_at string or null

The time at which the announcement expires. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. To set an announcement that never expires, omit this parameter, set it to null, or set it to an empty string.

user_dismissible boolean or null

Whether an announcement can be dismissed by the user.

Padrão: false

HTTP response status codes for "Set announcement banner for organization"

Status codeDescrição
200

OK

Code samples for "Set announcement banner for organization"

Request example

patch/orgs/{org}/announcement
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ http(s)://HOSTNAME/api/v3/orgs/ORG/announcement \ -d '{"announcement":"Very **important** announcement about _something_.","expires_at":"2021-01-01T00:00:00.000+00:00","user_dismissible":false}'

Announcement banner

Status: 200
{ "announcement": "Very **important** announcement about _something_.", "expires_at": "2021-01-01T00:00:00.000+00:00", "user_dismissible": false }

Remove announcement banner from organization

Removes the announcement banner currently set for the organization.

Fine-grained access tokens for "Remove announcement banner from organization"

This endpoint works with the following fine-grained token types:

The fine-grained token must have the following permission set:

  • "Organization announcement banners" organization permissions (write)

Parâmetros para "Remove announcement banner from organization"

Cabeçalhos
Nome, Tipo, Descrição
accept string

Setting to application/vnd.github+json is recommended.

Parâmetros de caminho
Nome, Tipo, Descrição
org string Obrigatório

The organization name. The name is not case sensitive.

HTTP response status codes for "Remove announcement banner from organization"

Status codeDescrição
204

No Content

Code samples for "Remove announcement banner from organization"

Request example

delete/orgs/{org}/announcement
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ http(s)://HOSTNAME/api/v3/orgs/ORG/announcement

Response

Status: 204