Required. The parent resource. For example: projects/{projectId}/databases/{databaseId}/documents or projects/{projectId}/databases/{databaseId}/documents/chatrooms/{chatroom_id}
collectionId
string
Required. The collection ID, relative to parent, to list. For example: chatrooms.
Query parameters
Parameters
documentId
string
The client-assigned document ID to use for this document.
Optional. If not specified, an ID will be assigned by the service.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-20 UTC."],[],[],null,["# Method: projects.databases.documents.createDocument\n\nCreates a new document.\n\n### HTTP request\n\n`POST https://firestore.googleapis.com/v1beta1/{parent=projects/*/databases/*/documents/**}/{collectionId}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `parent` | `string` Required. The parent resource. For example: `projects/{projectId}/databases/{databaseId}/documents` or `projects/{projectId}/databases/{databaseId}/documents/chatrooms/{chatroom_id}` |\n| `collectionId` | `string` Required. The collection ID, relative to `parent`, to list. For example: `chatrooms`. |\n\n### Query parameters\n\n| Parameters ||\n|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `documentId` | `string` The client-assigned document ID to use for this document. Optional. If not specified, an ID will be assigned by the service. |\n| `mask` | `object (`[DocumentMask](/docs/firestore/reference/rest/v1beta1/DocumentMask)`)` The fields to return. If not set, returns all fields. If the document has a field that is not present in this mask, that field will not be returned in the response. |\n\n### Request body\n\nThe request body contains an instance of [Document](/docs/firestore/reference/rest/v1beta1/projects.databases.documents#Document).\n\n### Response body\n\nIf successful, the response body contains an instance of [Document](/docs/firestore/reference/rest/v1beta1/projects.databases.documents#Document).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/datastore`\n- `https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [OAuth 2.0 Overview](https://developers.google.com/identity/protocols/OAuth2)."]]