We've recently moved some of the REST API documentation. If you can't find what you're looking for, you might try the Actions REST API page.
조직
REST API를 사용하여 엔터프라이즈에 조직을 만듭니다.
조직 관리 정보
이러한 엔드포인트는 인증된 사이트 관리자만 사용할 수 있습니다. 일반 사용자는 응답을 받습니다 404
.
Create an organization
매개 변수
헤더 |
---|
이름, Type, 설명 |
accept stringSetting to |
본문 매개 변수 |
이름, Type, 설명 |
login string필수The organization's username. |
admin string필수The login of the user who will manage this organization. |
profile_name stringThe organization's display name. |
HTTP 응답 상태 코드
상태 코드 | Description |
---|---|
201 | Created |
코드 샘플
post/admin/organizations
curl \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/admin/organizations \
-d '{"login":"github","profile_name":"GitHub, Inc.","admin":"monalisaoctocat"}'
Response
Status: 201
{
"login": "github",
"id": 1,
"node_id": "MDEyOk9yZ2FuaXphdGlvbjE=",
"url": "https://api.github.com/orgs/github",
"repos_url": "https://api.github.com/orgs/github/repos",
"events_url": "https://api.github.com/orgs/github/events",
"hooks_url": "https://api.github.com/orgs/github/hooks",
"issues_url": "https://api.github.com/orgs/github/issues",
"members_url": "https://api.github.com/orgs/github/members{/member}",
"public_members_url": "https://api.github.com/orgs/github/public_members{/member}",
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
"description": "A great organization"
}
Update an organization name
매개 변수
헤더 |
---|
이름, Type, 설명 |
accept stringSetting to |
경로 매개 변수 |
이름, Type, 설명 |
org string필수The organization name. The name is not case sensitive. |
본문 매개 변수 |
이름, Type, 설명 |
login string필수The organization's new name. |
HTTP 응답 상태 코드
상태 코드 | Description |
---|---|
202 | Accepted |
코드 샘플
patch /admin /organizations /{org}
curl \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
http(s)://HOSTNAME/api/v3/admin/organizations/ORG \
-d '{"login":"the-new-octocats"}'
Response
Status: 202
{
"message": "Job queued to rename organization. It may take a few minutes to complete.",
"url": "https://<hostname>/api/v3/organizations/1"
}