Documents
Classes
Documents
Bases: outline_wiki_api.resources.base.Resources
Documents are what everything else revolves around. A document represents
a single page of information and always returns the latest version of the
content. Documents are stored in Markdown
formatting.
Functions
add_user
Add a user to a document
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doc_id
|
uuid.UUID | str
|
Document ID |
required |
user_id
|
uuid.UUID | str
|
User ID to add |
required |
permission
|
outline_wiki_api.models.response.Permission | None
|
Optional permission level |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
DocumentMembershipsResponse |
outline_wiki_api.models.document.DocumentMembershipsResponse
|
The response object with the list of updated users and memberships |
answer_question
Query documents with natural language
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
The question to ask |
required |
user_id
|
uuid.UUID | str
|
Filter by user |
None
|
collection_id
|
uuid.UUID | str | None
|
Filter by collection |
None
|
document_id
|
uuid.UUID | str | None
|
Filter by document |
None
|
status_filter
|
typing.Literal['draft', 'archived', 'published'] | None
|
Filter by status |
None
|
date_filter
|
typing.Literal['day', 'week', 'month', 'year'] | None
|
Filter by date |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
DocumentAnswerResponse |
outline_wiki_api.models.document.DocumentAnswerResponse
|
The response object for the answer and related documents |
archive
Archive a document
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doc_id
|
uuid.UUID | str
|
Document ID to archive |
required |
Returns:
| Name | Type | Description |
|---|---|---|
DocumentResponse |
outline_wiki_api.models.document.DocumentResponse
|
The response object for the archived document |
create
Create a new document
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
Document title |
required |
icon
|
str | None
|
Document icon |
None
|
collection_id
|
uuid.UUID | str
|
Target collection ID |
required |
text
|
str | None
|
Document content (markdown) |
None
|
parent_document_id
|
uuid.UUID | str | None
|
Optional parent document ID |
None
|
template_id
|
uuid.UUID | str | None
|
Template to base document on |
None
|
template
|
bool
|
Whether to create as template |
False
|
publish
|
bool
|
Whether to publish immediately |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
DocumentResponse |
outline_wiki_api.models.document.DocumentResponse
|
The response object for the created document |
delete
Delete a document
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doc_id
|
uuid.UUID | str
|
Document ID to delete |
required |
permanent
|
bool
|
Whether to permanently delete |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
Success status |
drafts
List all draft documents belonging to the current user
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
collection_id
|
uuid.UUID | str | None
|
Optional collection to filter by |
None
|
date_filter
|
typing.Literal['day', 'week', 'month', 'year'] | None
|
Filter by update date |
None
|
pagination
|
outline_wiki_api.models.response.Pagination | None
|
Pagination parameters |
None
|
sorting
|
outline_wiki_api.models.response.Sort | None
|
Sorting parameters |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
DocumentListResponse |
outline_wiki_api.models.document.DocumentListResponse
|
The response object with the list of draft documents |
export
Export document as markdown
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doc_id
|
str
|
Document ID (UUID or urlId) |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Document content in Markdown format |
import_file
Import a file as a new document
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file
|
str | typing.Tuple
|
Path to a file OR File Object for import (Plain text, markdown, docx, csv, tsv, and html format are supported.) |
required |
collection_id
|
uuid.UUID | str
|
Target collection ID |
required |
parent_document_id
|
uuid.UUID | str | None
|
Optional parent document ID |
None
|
template
|
bool
|
Whether to create as template |
False
|
publish
|
bool
|
Whether to publish immediately |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
DocumentResponse |
outline_wiki_api.models.document.DocumentResponse
|
The response object for the created document |
info
Retrieve a document by ID or shareId
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doc_id
|
str | uuid.UUID
|
Unique identifier for the document (UUID or urlId) |
required |
share_id
|
str | uuid.UUID | None
|
Optional share identifier |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
DocumentResponse |
outline_wiki_api.models.document.DocumentResponse
|
The response object for the requested document |
list
List all published and user's draft documents
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
collection_id
|
uuid.UUID | str | None
|
Optionally filter to a specific collection |
None
|
user_id
|
uuid.UUID | str | None
|
Optionally filter to a specific user |
None
|
backlink_document_id
|
uuid.UUID | str | None
|
Optionally filter to a specific document in a backlinks |
None
|
parent_document_id
|
uuid.UUID | str | None
|
Optionally filter to a specific parent document |
None
|
template
|
bool | None
|
Optionally filter to only templates |
None
|
pagination
|
outline_wiki_api.models.response.Pagination | None
|
Custom pagination (default: offset=0, limit=25) |
None
|
sorting
|
outline_wiki_api.models.response.Sort | None
|
Custom sorting order (takes |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
DocumentListResponse |
outline_wiki_api.models.document.DocumentListResponse
|
Contains data (documents), policies, and pagination info |
memberships
List users with direct membership to a document
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doc_id
|
uuid.UUID | str
|
Document ID |
required |
query
|
str | None
|
Optional filter by username |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
DocumentMembershipsResponse |
outline_wiki_api.models.document.DocumentMembershipsResponse
|
The response object with the list of direct memberships |
move
Move a document to a new location or collection.md. If no parent document is provided, the document will be moved to the collection.md root.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doc_id
|
uuid.UUID | str
|
Document ID to move. Either the UUID or the urlId is acceptable. |
required |
collection_id
|
uuid.UUID | str
|
Target collection ID. |
required |
parent_document_id
|
uuid.UUID | str | None
|
Target parent document ID. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
DocumentMoveResponse |
outline_wiki_api.models.document.DocumentMoveResponse
|
The response object with the updated documents and collections data |
remove_user
Remove a user from a document
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doc_id
|
uuid.UUID | str
|
Document ID |
required |
user_id
|
uuid.UUID | str
|
User ID to remove |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
Success status |
restore
Restore a document
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doc_id
|
uuid.UUID | str
|
Document ID to restore |
required |
revision_id
|
uuid.UUID | str | None
|
Optional revision ID to restore to |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
DocumentResponse |
outline_wiki_api.models.document.DocumentResponse
|
The response object for the restored document |
search
Full-text search feature. Use of keywords is most effective.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
Full-text search query |
required |
collection_id
|
uuid.UUID | str | None
|
Optionally filter to a specific collection |
None
|
user_id
|
uuid.UUID | str | None
|
Optionally filter to a specific editor user |
None
|
document_id
|
uuid.UUID | str | None
|
You also can just put the id of the document to search within |
None
|
status_filter
|
outline_wiki_api.models.document.DocumentStatus | None
|
Any documents that are not in the specified status will be filtered out |
None
|
date_filter
|
outline_wiki_api.models.response.Period | None
|
Any documents that have not been updated within the specified period will be filtered out |
None
|
pagination
|
outline_wiki_api.models.response.Pagination | dict | None
|
Custom pagination (default: offset=0, limit=25) |
None
|
Returns: DocumentSearchResultResponse: Contains search results, policies, and pagination info
templatize
Create a template from a document
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doc_id
|
uuid.UUID | str
|
Document ID to templatize |
required |
publish
|
bool
|
Whether to publish immediately |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
DocumentResponse |
outline_wiki_api.models.document.DocumentResponse
|
The response object for the created template |
unpublish
Unpublish a document
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doc_id
|
uuid.UUID | str
|
Document ID to unpublish |
required |
Returns:
| Name | Type | Description |
|---|---|---|
DocumentResponse |
outline_wiki_api.models.document.DocumentResponse
|
The response object for the unpublished document |
update
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doc_id
|
uuid.UUID | str
|
Unique identifier for the document. Either the UUID or the urlId is acceptable. |
required |
title
|
str | None
|
The title of the document. |
None
|
icon
|
str | None
|
The icon for the document. |
None
|
text
|
str | None
|
The body of the document in markdown. |
None
|
append
|
bool
|
If true the text field will be appended to the end of the existing document, rather than the default behavior of replacing it. This is potentially useful for things like logging into a document. |
False
|
publish
|
bool
|
Whether this document should be published and made visible to other team members, if a draft |
False
|
done
|
bool
|
Whether the editing session has finished, this will trigger any notifications. This property will soon be deprecated. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
DocumentResponse |
outline_wiki_api.models.document.DocumentResponse
|
The response object for the updated document |
users
List all users with access to a document
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
doc_id
|
uuid.UUID | str
|
Document ID |
required |
query
|
str | None
|
Optional filter by username |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
DocumentUsersResponse |
outline_wiki_api.models.document.DocumentUsersResponse
|
The response object with the list of users with access |
viewed
List all recently viewed documents
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pagination
|
outline_wiki_api.models.response.Pagination | None
|
Pagination parameters |
None
|
sorting
|
outline_wiki_api.models.response.Sort | None
|
Sorting parameters |
None
|
Returns: DocumentListResponse: The response object with the list of recently viewed documents