{"meta":{"title":"组织公告横幅的 REST API 端点","intro":"使用组织公告横幅 API，可以获取、设置和删除组织的公告横幅。","product":"REST API","breadcrumbs":[{"href":"/zh/enterprise-cloud@latest/rest","title":"REST API"},{"href":"/zh/enterprise-cloud@latest/rest/announcement-banners","title":"公告横幅"},{"href":"/zh/enterprise-cloud@latest/rest/announcement-banners/organizations","title":"组织"}],"documentType":"article"},"body":"# 组织公告横幅的 REST API 端点\n\n使用组织公告横幅 API，可以获取、设置和删除组织的公告横幅。\n\n> [!NOTE]\n> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2026-03-10`. Curl examples below omit these standard headers for brevity.\n\n## Get announcement banner for organization\n\n```\nGET /orgs/{org}/announcement\n```\n\nGets the announcement banner currently set for the organization. Only returns the announcement banner set at the\norganization level. Organization members may also see an enterprise-level announcement banner. To get an\nannouncement banner displayed at the enterprise level, use the enterprise-level endpoint.\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n### HTTP response status codes\n\n- **200** - OK\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  https://api.github.com/orgs/ORG/announcement\n```\n\n**Response schema (Status: 200):**\n\n* `announcement`: required, string or null\n* `expires_at`: required, string or null, format: date-time\n* `user_dismissible`: required, boolean or null, default: `false`\n\n## Set announcement banner for organization\n\n```\nPATCH /orgs/{org}/announcement\n```\n\nSets the announcement banner to display for the organization.\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n#### Body parameters\n\n- **`announcement`** (string or null) (required)\n  The announcement text in GitHub Flavored Markdown. For more information about GitHub Flavored Markdown, see \"Basic writing and formatting syntax.\"\n\n- **`expires_at`** (string or null)\n  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.\n\n- **`user_dismissible`** (boolean or null)\n  Whether an announcement can be dismissed by the user.\n  Default: `false`\n\n### HTTP response status codes\n\n- **200** - OK\n\n### Code examples\n\n#### Announcement banner\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PATCH \\\n  https://api.github.com/orgs/ORG/announcement \\\n  -d '{\n  \"announcement\": \"Very **important** announcement about _something_.\",\n  \"expires_at\": \"2021-01-01T00:00:00.000+00:00\",\n  \"user_dismissible\": false\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Get announcement banner for organization](#get-announcement-banner-for-organization).\n\n## Remove announcement banner from organization\n\n```\nDELETE /orgs/{org}/announcement\n```\n\nRemoves the announcement banner currently set for the organization.\n\n### Parameters\n\n#### Headers\n\n- **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n- **`org`** (string) (required)\n  The organization name. The name is not case sensitive.\n\n### HTTP response status codes\n\n- **204** - No Content\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  https://api.github.com/orgs/ORG/announcement\n```\n\n**Response schema (Status: 204):**"}