Documents API: Publish document
Endpoint#
Section titled “Endpoint#”| Property | Value |
|---|---|
| Type | mutation |
| Method | POST |
| Path | /api/external/v1/documents/publish_document |
| Handler | OperatelyWeb.Api.Documents.Publish |
Authentication#
Section titled “Authentication#”- Requires a valid API token.
- Requires a write-enabled token.
- Read-only tokens return
403.
| Field | Type | Required | Nullable | Default |
|---|---|---|---|---|
document_id | id primitive (encoded as string) | Yes | No | - |
name | string | No | Yes | - |
content | json primitive (encoded as string) | No | Yes | - |
send_notifications_to_everyone | boolean | No | Yes | - |
subscriber_ids | array of id primitive (encoded as string) | No | Yes | - |
Outputs#
Section titled “Outputs#”| Field | Type | Required | Nullable |
|---|---|---|---|
document | resource_hub_document object | Yes | No |
cURL Example#
Section titled “cURL Example#”Copied
curl --request POST \
--url "https://app.operately.com/api/external/v1/documents/publish_document" \
--header "Authorization: Bearer ${OPERATELY_API_TOKEN}" \
--header "Content-Type: application/json" \
--data '{"content":"value", "document_id":"value", "name":"value", "send_notifications_to_everyone":true, "subscriber_ids":["value"]}'Response Example#
Section titled “Response Example#”{ "document": { "__typename": "value", "author": "<person>", "comments_count": 123, "content": "value", "current_version": 123, "goal": "<goal>", "id": "value", "inserted_at": "value", "name": "value", "notifications": [ "<notification>" ], "parent_folder": "<resource_hub_folder>", "parent_folder_id": "value", "path_to_document": [ "<resource_hub_folder>" ], "permissions": "<resource_hub_permissions>", "potential_subscribers": [ "<subscriber>" ], "project": "<project>", "public_url": "value", "published_at": "2026-01-01T09:30:00Z", "reactions": [ "<reaction>" ], "resource_hub": "<resource_hub>", "resource_hub_id": "value", "space": "<space>", "state": "draft", "subscription_list": "<subscription_list>", "updated_at": "2026-01-01", "url": "value", "versions_count": 123 }}