Puts an already-uploaded document into one of the caller org's data rooms and…
Puts an already-uploaded document into one of the caller org's data rooms and answers with the new membership id.
POST /v1/dataroom/datarooms/{id}/documents
| Address | https://api.hanzo.ai/v1/dataroom/datarooms/{id}/documents |
| Method | POST |
| Operation | post_dataroom_datarooms_by_id_documents |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Puts an already-uploaded document into one of the caller org's data rooms and answers with the new membership id.
It ATTACHES, it never uploads: the bytes must already be stored, so the usual order is upload the document, then add it to the room. Both the room and the document must exist in the caller's own store — either missing is not found — and a document already in the room is refused as a conflict rather than duplicated.
Request
4 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | ID is the room to add to. It is the path segment: the URL is the addressing authority, and the org it is resolved in comes from the caller's principal, so an… |
documentId | body | any | — | DocumentId is the document to attach. |
id | body | string | — | ID is the room to add to. It is the path segment: the URL is the addressing authority, and the org it is resolved in comes from the caller's principal, so an… |
orderIndex | body | any | — | OrderIndex fixes the document's place in the viewer's list. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | dataroomMembership | ok |
200 body — 3 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
dataroomDocumentId | body | string | — | DataroomDocumentId is the new membership id. |
dataroomId | body | string | — | DataroomId is the room the document was added to. |
documentId | body | string | — | DocumentId is the document that was added. |
Failure carries the platform error shape — see Errors.
Examples
hanzo dataroom datarooms documents <id>import { Configuration, DataroomApi } from 'hanzoai';
const api = new DataroomApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postDataroomDataroomsByIdDocuments({ id: 'id', documentId: "<documentId>", id: "<id>" });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import DataroomApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = DataroomApi(client).post_dataroom_datarooms_by_id_documents(id='id', document_id="<documentId>", id="<id>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.DataroomAPI.PostDataroomDataroomsByIdDocuments(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, dataroom_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = dataroom_api::post_dataroom_datarooms_by_id_documents(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.DataroomApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new DataroomApi(client).postDataroomDataroomsByIdDocuments();curl -X POST https://api.hanzo.ai/v1/dataroom/datarooms/<id>/documents \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"documentId": "<documentId>",
"id": "<id>"
}'The door reaches dataroom through the dataroom tool, which names its 17 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "get_dataroom_analytic_dataroom"
}
}
}'How is this guide?