Method: spaces.create
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
스페이스를 만듭니다. Import mode
에서 이름이 지정된 스페이스 또는 그룹 채팅을 만드는 데 사용할 수 있습니다. 예시는 스페이스 만들기를 참고하세요.
다음 유형의 인증을 지원합니다.
앱으로 인증할 때는 요청에서 space.customer
필드를 설정해야 합니다.
앱으로 인증하면 Chat 앱이 스페이스의 구성원으로 추가됩니다. 하지만 사람 인증과 달리 Chat 앱은 스페이스 관리자로 추가되지 않습니다. 기본적으로 모든 스페이스 참여자가 스페이스에서 Chat 앱을 삭제할 수 있습니다. 스페이스 관리자만 스페이스에서 앱을 삭제할 수 있도록 하려면 space.permission_settings.manage_apps
을 managersAllowed
로 설정하세요.
생성 시 스페이스 멤버십은 스페이스가 Import mode
에서 생성되었는지에 따라 달라집니다.
- 가져오기 모드: 회원이 생성되지 않습니다.
- 기타 모든 모드: 통화하는 사용자가 회원으로 추가됩니다. 이는 다음을 의미합니다.
- 앱 인증을 사용하는 경우 앱 자체
- 사용자 인증을 사용하는 경우의 실제 사용자입니다.
스페이스를 만들 때 ALREADY_EXISTS
오류 메시지가 표시되면 다른 displayName
를 사용해 보세요. Google Workspace 조직 내의 기존 스페이스에서 이미 이 표시 이름을 사용하고 있을 수 있습니다.
HTTP 요청
POST https://chat.googleapis.com/v1/spaces
URL은 gRPC 트랜스코딩 구문을 사용합니다.
쿼리 매개변수
매개변수 |
requestId |
string
선택사항입니다. 이 요청의 고유 식별자입니다. 임의의 UUID를 사용하는 것이 좋습니다. 기존 요청 ID를 지정하면 새 스페이스가 생성되는 대신 해당 ID로 생성된 스페이스가 반환됩니다. 인증된 사용자가 다른 동일한 Chat 앱의 기존 요청 ID를 지정하면 오류가 반환됩니다.
|
요청 본문
요청 본문에 Space
의 인스턴스가 포함됩니다.
응답 본문
성공한 경우 응답 본문에 새로 생성된 Space
의 인스턴스가 포함됩니다.
승인 범위
다음 OAuth 범위 중 하나가 필요합니다.
https://www.googleapis.com/auth/chat.app.spaces.create
https://www.googleapis.com/auth/chat.app.spaces
https://www.googleapis.com/auth/chat.import
https://www.googleapis.com/auth/chat.spaces
https://www.googleapis.com/auth/chat.spaces.create
자세한 내용은 승인 가이드를 참고하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-29(UTC)
[null,null,["최종 업데이트: 2025-07-29(UTC)"],[[["\u003cp\u003eCreates a space in Google Chat, which can be a named space or a group chat, supporting app and user authentication.\u003c/p\u003e\n"],["\u003cp\u003eWhen using app authentication, the space.customer field is required and no members are added in Import mode; otherwise, the calling user becomes a member.\u003c/p\u003e\n"],["\u003cp\u003eUses the \u003ccode\u003ePOST https://chat.googleapis.com/v1/spaces\u003c/code\u003e HTTP request to create a space and requires specific OAuth scopes for authorization.\u003c/p\u003e\n"],["\u003cp\u003eThe request body should contain a Space object and the response, if successful, will contain the newly created Space object.\u003c/p\u003e\n"],["\u003cp\u003eIf the displayName already exists, an \u003ccode\u003eALREADY_EXISTS\u003c/code\u003e error will be returned, suggesting to try a different displayName.\u003c/p\u003e\n"]]],["This content outlines how to create a space using the Chat API. Key actions include sending a `POST` request to `https://chat.googleapis.com/v1/spaces`. The request may include a unique `requestId` and must contain a `Space` instance in the body. Authentication can be app-based or user-based, requiring specific OAuth scopes. Space membership varies by import mode; no members in import mode, otherwise the caller is added. Response will contain new space information.\n"],null,["# Method: spaces.create\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates a space. Can be used to create a named space, or a group chat in `Import mode`. For an example, see [Create a space](https://developers.google.com/workspace/chat/create-spaces).\n\nSupports the following types of [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):\n\n- [App authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app) with [administrator approval](https://support.google.com/a?p=chat-app-auth) and one of the following authorization scopes:\n\n - `https://www.googleapis.com/auth/chat.app.spaces.create`\n - `https://www.googleapis.com/auth/chat.app.spaces`\n- [User authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) with one of the following authorization scopes:\n\n - `https://www.googleapis.com/auth/chat.spaces.create`\n - `https://www.googleapis.com/auth/chat.spaces`\n - `https://www.googleapis.com/auth/chat.import` (import mode spaces only)\n\nWhen authenticating as an app, the `space.customer` field must be set in the request.\n\nWhen authenticating as an app, the Chat app is added as a member of the space. However, unlike human authentication, the Chat app is not added as a space manager. By default, the Chat app can be removed from the space by all space members. To allow only space managers to remove the app from a space, set `space.permission_settings.manage_apps` to `managersAllowed`.\n\nSpace membership upon creation depends on whether the space is created in `Import mode`:\n\n- **Import mode:** No members are created.\n- **All other modes:** The calling user is added as a member. This is:\n - The app itself when using app authentication.\n - The human user when using user authentication.\n\nIf you receive the error message `ALREADY_EXISTS` when creating a space, try a different `displayName`. An existing space within the Google Workspace organization might already use this display name.\n\n### HTTP request\n\n`POST https://chat.googleapis.com/v1/spaces`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `requestId` | `string` Optional. A unique identifier for this request. A random UUID is recommended. Specifying an existing request ID returns the space created with that ID instead of creating a new space. Specifying an existing request ID from the same Chat app with a different authenticated user returns an error. |\n\n### Request body\n\nThe request body contains an instance of [Space](/workspace/chat/api/reference/rest/v1/spaces#Space).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Space](/workspace/chat/api/reference/rest/v1/spaces#Space).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/chat.app.spaces.create`\n- `https://www.googleapis.com/auth/chat.app.spaces`\n- `https://www.googleapis.com/auth/chat.import`\n- `https://www.googleapis.com/auth/chat.spaces`\n- `https://www.googleapis.com/auth/chat.spaces.create`\n\nFor more information, see the [Authorization guide](/workspace/chat/authenticate-authorize)."]]