### JavaScript Client for Outline API Source: https://context7.com/outline/openapi/llms.txt A JavaScript example demonstrating how to create a wrapper function for making requests to the Outline API. It handles authentication, request formatting, and response parsing for various operations like document creation, search, listing collections, and exporting documents. ```javascript const OUTLINE_API_URL = 'https://app.getoutline.com/api'; const API_KEY = 'ol_api_your_api_key_here'; async function outlineRequest(method, data = {}) { const response = await fetch(`${OUTLINE_API_URL}/${method}`, { method: 'POST', headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json', 'Accept': 'application/json' }, body: JSON.stringify(data) }); if (!response.ok) { const error = await response.json(); throw new Error(`API Error: ${error.message || error.error}`); } return response.json(); } // Usage examples: // Create a document const newDoc = await outlineRequest('documents.create', { title: 'API Created Document', text: '# Hello World\n\nCreated via API', collectionId: '550e8400-e29b-41d4-a716-446655440000', publish: true }); console.log('Created document:', newDoc.data.id); // Search documents const searchResults = await outlineRequest('documents.search', { query: 'getting started', limit: 10 }); console.log('Found documents:', searchResults.data.length); // List collections const collections = await outlineRequest('collections.list', { limit: 50 }); console.log('Collections:', collections.data.map(c => c.name)); // Export a document const exported = await outlineRequest('documents.export', { id: 'hDYep1TPAM' }); console.log('Document content:', exported.data); ``` -------------------------------- ### POST /api/documents.answerQuestion Source: https://context7.com/outline/openapi/llms.txt Queries documents using natural language to get AI-generated answers from your knowledge base. Available for Business/Enterprise plans. ```APIDOC ## POST /api/documents.answerQuestion ### Description Query documents using natural language to get AI-generated answers from your knowledge base (Business/Enterprise only). ### Method POST ### Endpoint /api/documents.answerQuestion ### Parameters #### Request Body - **query** (string) - Required - The natural language question to ask. - **collectionId** (string) - Optional - Filter the search to a specific collection. ### Request Example ```json { "query": "What is our holiday policy?", "collectionId": "550e8400-e29b-41d4-a716-446655440000" } ``` ### Response #### Success Response (200) - **documents** (array) - Related documents that were used to generate the answer. - **search** (object) - Details about the AI-generated answer. - **id** (string) - The ID of the search query. - **query** (string) - The original question asked. - **answer** (string) - The AI-generated answer. - **source** (string) - The source of the answer (e.g., 'api'). - **createdAt** (string) - The timestamp when the answer was generated. #### Response Example ```json { "documents": [...], "search": { "id": "...", "query": "What is our holiday policy?", "answer": "Based on the HR documentation, employees receive 25 days of paid time off...", "source": "api", "createdAt": "2024-01-15T10:30:00.000Z" } } ``` ``` -------------------------------- ### AI-Powered Document Q&A using API Source: https://context7.com/outline/openapi/llms.txt Queries documents using natural language to get AI-generated answers. Requires a collection ID and the user's query. This feature is available for Business/Enterprise plans. ```curl curl https://app.getoutline.com/api/documents.answerQuestion \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "query": "What is our holiday policy?", "collectionId": "550e8400-e29b-41d4-a716-446655440000" }' ``` -------------------------------- ### Get Collection Document Structure (Bash) Source: https://context7.com/outline/openapi/llms.txt Retrieves the hierarchical structure of documents within a specified collection. This endpoint returns a tree-like representation of the documents, including their titles and URLs. Requires the collection ID and an API key. ```bash curl https://app.getoutline.com/api/collections.documents \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "id": "550e8400-e29b-41d4-a716-446655440000" }' ``` -------------------------------- ### Create a Document - Bash Source: https://context7.com/outline/openapi/llms.txt Creates a new document within a specified collection. Supports adding markdown content, setting a title, and publishing the document. Optional parameters include `publish` and `fullWidth`. Requires an API key for authorization. ```bash curl https://app.getoutline.com/api/documents.create \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "title": "Welcome to Acme Inc", "text": "# Welcome\n\nThis is our company wiki.\n\n## Getting Started\n\nHere you will find all the information you need.", "collectionId": "550e8400-e29b-41d4-a716-446655440000", "publish": true, "fullWidth": false }' ``` -------------------------------- ### POST /api/collections.create Source: https://context7.com/outline/openapi/llms.txt Creates a new collection with configurable permissions, icons, and sharing settings. ```APIDOC ## POST /api/collections.create ### Description Creates a new collection with configurable permissions, icons, and sharing settings. ### Method POST ### Endpoint https://app.getoutline.com/api/collections.create ### Parameters #### Request Body - **name** (string) - Required - The name of the collection. - **description** (string) - Optional - A description for the collection. - **icon** (string) - Optional - An emoji or icon for the collection. - **color** (string) - Optional - A hex color code for the collection. - **permission** (string) - Optional - Default permission level for the collection (e.g., "read", "write"). - **sharing** (boolean) - Optional - Whether the collection is publicly shareable. Defaults to false. ### Request Example ```json { "name": "Human Resources", "description": "HR documentation and policies", "icon": "📋", "color": "#5C6BC0", "permission": "read", "sharing": false } ``` ### Response #### Success Response (200) - **data** (object) - **id** (string) - The unique ID of the created collection. - **urlId** (string) - A URL-friendly identifier for the collection. - **name** (string) - The name of the collection. - **description** (string) - The description of the collection. - **icon** (string) - The icon of the collection. - **color** (string) - The color of the collection. - **permission** (string) - The permission level of the collection. - **sharing** (boolean) - Whether the collection is shareable. - **createdAt** (string) - The timestamp when the collection was created. #### Response Example ```json { "data": { "id": "550e8400-e29b-41d4-a716-446655440000", "urlId": "jKLmn2OPQR", "name": "Human Resources", "description": "HR documentation and policies", "icon": "📋", "color": "#5C6BC0", "permission": "read", "sharing": false, "createdAt": "2024-01-15T10:00:00.000Z" } } ``` ``` -------------------------------- ### Import Document using API Source: https://context7.com/outline/openapi/llms.txt Imports files (plain text, markdown, docx, csv, tsv, html) as new documents. Requires the file path, collection ID, and an option to publish immediately. The API returns the newly created document's metadata. ```curl curl https://app.getoutline.com/api/documents.import \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -F "file=@/path/to/document.md" \ -F "collectionId=550e8400-e29b-41d4-a716-446655440000" \ -F "publish=true" ``` -------------------------------- ### Retrieve Authentication Info - Bash Source: https://context7.com/outline/openapi/llms.txt Fetches details about the current API key, including the authenticated user and workspace information. Requires a Bearer token for authentication. The response includes user and team data. ```bash curl https://app.getoutline.com/api/auth.info \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -H "Accept: application/json" ``` -------------------------------- ### List Collections (Bash) Source: https://context7.com/outline/openapi/llms.txt Retrieves a list of all collections accessible to the authenticated user. Supports pagination with `limit` and `offset` parameters, and filtering by name using the `query` parameter. Requires an API key for authentication. ```bash curl https://app.getoutline.com/api/collections.list \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "limit": 25, "offset": 0 }' ``` ```bash curl https://app.getoutline.com/api/collections.list \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "query": "engineering" }' ``` -------------------------------- ### Invite Users using cURL Source: https://context7.com/outline/openapi/llms.txt Sends email invitations to new users, specifying their email, name, and role (e.g., 'member', 'admin'). Requires an API key for authorization. ```bash curl https://app.getoutline.com/api/users.invite \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "invites": [ {"email": "john@example.com", "name": "John Smith", "role": "member"}, {"email": "jane@example.com", "name": "Jane Doe", "role": "admin"} ] }' ``` -------------------------------- ### List Users with Filtering and Pagination (Bash) Source: https://context7.com/outline/openapi/llms.txt Retrieves a list of users from the workspace. Supports filtering by status and role, sorting by name, and pagination using limit and offset. Can also filter by email addresses. ```bash curl https://app.getoutline.com/api/users.list \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ \ "filter": "active", \ "role": "member", \ "sort": "name", \ "direction": "ASC", \ "limit": 50 \ }' # Search by email: curl https://app.getoutline.com/api/users.list \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ \ "emails": ["jane@example.com", "john@example.com"] \ }' # Response: # { # "data": [ # {"id": "...", "name": "Jane Doe", "email": "jane@example.com", "role": "admin"}, # {"id": "...", "name": "John Smith", "email": "john@example.com", "role": "member"} # ], # "pagination": {"limit": 50, "offset": 0} # } ``` -------------------------------- ### Retrieve Authentication Config - Bash Source: https://context7.com/outline/openapi/llms.txt Retrieves available authentication options for a workspace without requiring authentication. This is useful for discovering available authentication services like Slack. The response includes workspace name, hostname, and a list of services with their respective auth URLs. ```bash curl https://app.getoutline.com/api/auth.config \ -X POST \ -H "Content-Type: application/json" \ -H "Accept: application/json" ``` -------------------------------- ### Create a Template using cURL Source: https://context7.com/outline/openapi/llms.txt Creates a new document template with a specified title, content structure, icon, color, and collection ID. The content is defined using a JSON object representing the document structure. ```bash curl https://app.getoutline.com/api/templates.create \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "title": "Meeting Notes Template", "data": {"type": "doc", "content": [{"type": "heading", "attrs": {"level": 1}, "content": [{"type": "text", "text": "Meeting Notes"}]}, {"type": "paragraph", "content": [{"type": "text", "text": "Date: "}]}, {"type": "heading", "attrs": {"level": 2}, "content": [{"type": "text", "text": "Attendees"}]}, {"type": "bullet_list", "content": [{"type": "list_item", "content": [{"type": "paragraph", "content": [{"type": "text", "text": "Add attendees"}]}]}]}, {"type": "heading", "attrs": {"level": 2}, "content": [{"type": "text", "text": "Agenda"}]}, {"type": "heading", "attrs": {"level": 2}, "content": [{"type": "text", "text": "Action Items"}]}]}, "icon": "📝", "color": "#4CAF50", "collectionId": "550e8400-e29b-41d4-a716-446655440000" }' ``` -------------------------------- ### Create a New Group (Bash) Source: https://context7.com/outline/openapi/llms.txt Creates a new group within the workspace, which can be used for organizing users and managing permissions in bulk. Requires a name for the group. ```bash curl https://app.getoutline.com/api/groups.create \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ \ "name": "Engineering Team" \ }' # Response: # { # "data": { # "id": "bb0e8400-e29b-41d4-a716-446655440007", # "name": "Engineering Team", # "memberCount": 0, # "createdAt": "2024-01-15T10:00:00.000Z" # } # } ``` -------------------------------- ### List Shares using Outline API Source: https://context7.com/outline/openapi/llms.txt Retrieves a list of all share links within the workspace. Supports filtering by query, and sorting by creation date in ascending or descending order. Uses a POST request to the shares.list endpoint. ```bash curl https://app.getoutline.com/api/shares.list \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "query": "getting started", "sort": "createdAt", "direction": "DESC" }' ``` -------------------------------- ### Create a Share using cURL Source: https://context7.com/outline/openapi/llms.txt Generates a shareable link for a specific document, enabling public access. The document ID is required, and the share can optionally include child documents. ```bash curl https://app.getoutline.com/api/shares.create \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "documentId": "770e8400-e29b-41d4-a716-446655440002" }' ``` -------------------------------- ### Retrieve a Template using cURL Source: https://context7.com/outline/openapi/llms.txt Fetches the details of a specific template, including its full document structure. Requires the template ID for identification. ```bash curl https://app.getoutline.com/api/templates.info \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "id": "ee0e8400-e29b-41d4-a716-446655440010" }' ``` -------------------------------- ### Suspend and Activate User Accounts (Bash) Source: https://context7.com/outline/openapi/llms.txt Allows for the temporary disabling (suspension) and re-enabling (activation) of user access to the workspace. Requires the user's unique identifier. ```bash # Suspend a user curl https://app.getoutline.com/api/users.suspend \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ \ "id": "aa0e8400-e29b-41d4-a716-446655440006" \ }' # Activate a suspended user curl https://app.getoutline.com/api/users.activate \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ \ "id": "aa0e8400-e29b-41d4-a716-446655440006" \ }' ``` -------------------------------- ### POST /api/collections.list Source: https://context7.com/outline/openapi/llms.txt Returns a list of all collections accessible to the authenticated user, with options for filtering and pagination. ```APIDOC ## POST /api/collections.list ### Description Returns all collections accessible to the authenticated user. ### Method POST ### Endpoint /api/collections.list ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of collections to return. - **offset** (integer) - Optional - The number of collections to skip. - **query** (string) - Optional - A search query to filter collections by name. ### Request Example ```json { "limit": 25, "offset": 0 } ``` ### Request Example (Filtered) ```json { "query": "engineering" } ``` ### Response #### Success Response (200) - **data** (array) - An array of collection objects, each containing id, name, and icon. - **pagination** (object) - Contains pagination details like limit and offset. #### Response Example ```json { "data": [ {"id": "...", "name": "Engineering", "icon": "⚙️"}, {"id": "...", "name": "Human Resources", "icon": "📋"} ], "pagination": {"limit": 25, "offset": 0} } ``` ``` -------------------------------- ### Manage Collection Users (Bash) Source: https://context7.com/outline/openapi/llms.txt Enables management of individual user memberships within a collection. This includes adding users with specific permissions, removing users, and listing current members. Requires collection ID, user ID, and an API key. ```bash # Add a user to a collection curl https://app.getoutline.com/api/collections.add_user \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "id": "550e8400-e29b-41d4-a716-446655440000", "userId": "aa0e8400-e29b-41d4-a716-446655440006", "permission": "read_write" }' ``` ```bash # Remove a user from a collection curl https://app.getoutline.com/api/collections.remove_user \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "id": "550e8400-e29b-41d4-a716-446655440000", "userId": "aa0e8400-e29b-41d4-a716-446655440006" }' ``` ```bash # List collection memberships curl https://app.getoutline.com/api/collections.memberships \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "id": "550e8400-e29b-41d4-a716-446655440000", "limit": 50 }' ``` -------------------------------- ### Retrieve a Document - Bash Source: https://context7.com/outline/openapi/llms.txt Fetches a document's content and metadata using its ID, URL ID, or share ID. This endpoint allows retrieval of full document details. Authentication via Bearer token is required. ```bash curl https://app.getoutline.com/api/documents.info \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "id": "770e8400-e29b-41d4-a716-446655440002" }' # Alternative using urlId: curl https://app.getoutline.com/api/documents.info \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "id": "hDYep1TPAM" }' ``` -------------------------------- ### Create Collection - Outline API Source: https://context7.com/outline/openapi/llms.txt Creates a new collection in Outline with configurable settings such as name, description, icon, color, permissions, and sharing status. Requires authentication via a Bearer token and provides details of the created collection in the response. ```bash curl https://app.getoutline.com/api/collections.create \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "name": "Human Resources", "description": "HR documentation and policies", "icon": "📋", "color": "#5C6BC0", "permission": "read", "sharing": false }' # Response: # { # "data": { # "id": "550e8400-e29b-41d4-a716-446655440000", # "urlId": "jKLmn2OPQR", # "name": "Human Resources", # "description": "HR documentation and policies", # "icon": "📋", # "color": "#5C6BC0", # "permission": "read", # "sharing": false, # "createdAt": "2024-01-15T10:00:00.000Z" # } # } ``` -------------------------------- ### Export Collection (Bash) Source: https://context7.com/outline/openapi/llms.txt Initiates the export of a collection's content in a specified format (e.g., markdown, JSON, HTML). This can be used for backing up or migrating collection data. Requires the collection ID, desired format, and an API key. ```bash # Export a single collection curl https://app.getoutline.com/api/collections.export \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "id": "550e8400-e29b-41d4-a716-446655440000", "format": "outline-markdown" }' ``` -------------------------------- ### Create and List Document Views using cURL Source: https://context7.com/outline/openapi/llms.txt API endpoints for creating view records and listing document view analytics. Requires an API key for authorization and accepts a JSON payload with document IDs. Returns view data including first/last viewed times and view counts. ```bash # Create a view record curl https://app.getoutline.com/api/views.create \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "documentId": "770e8400-e29b-41d4-a716-446655440002" }' # List document views curl https://app.getoutline.com/api/views.list \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "documentId": "770e8400-e29b-41d4-a716-446655440002", "includeSuspended": false }' ``` -------------------------------- ### List Templates using cURL Source: https://context7.com/outline/openapi/llms.txt Retrieves a list of all templates within a workspace or filters them by a specific collection ID. Supports sorting by title in ascending or descending order. ```bash curl https://app.getoutline.com/api/templates.list \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "collectionId": "550e8400-e29b-41d4-a716-446655440000", "sort": "title", "direction": "ASC" }' ``` -------------------------------- ### POST /api/documents.import Source: https://context7.com/outline/openapi/llms.txt Imports files (plain text, markdown, docx, csv, tsv, html) as new documents into a specified collection. ```APIDOC ## POST /api/documents.import ### Description Import files (plain text, markdown, docx, csv, tsv, html) as new documents. ### Method POST ### Endpoint /api/documents.import ### Parameters #### Form Data - **file** (file) - Required - The document file to import. - **collectionId** (string) - Required - The ID of the collection to import the document into. - **publish** (boolean) - Optional - If true, the document will be published immediately. ### Request Example ```bash curl https://app.getoutline.com/api/documents.import \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -F "file=@/path/to/document.md" \ -F "collectionId=550e8400-e29b-41d4-a716-446655440000" \ -F "publish=true" ``` ### Response #### Success Response (200) - **data** (object) - Contains details of the imported document. - **id** (string) - The ID of the newly created document. - **title** (string) - The title of the document. - **text** (string) - The content of the document. #### Response Example ```json { "data": { "id": "880e8400-e29b-41d4-a716-446655440003", "title": "Imported Document", "text": "..." } } ``` ``` -------------------------------- ### Retrieve Collection Details (Bash) Source: https://context7.com/outline/openapi/llms.txt Fetches detailed information about a specific collection, including its metadata and associated permissions. Requires the collection ID and an API key for authentication. The response includes collection data and policy information. ```bash curl https://app.getoutline.com/api/collections.info \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "id": "550e8400-e29b-41d4-a716-446655440000" }' ``` -------------------------------- ### Manage Group Memberships (Bash) Source: https://context7.com/outline/openapi/llms.txt Enables adding and removing users from specific groups. Also provides functionality to list members of a group, with an option to filter by a query string. ```bash # Add a user to a group curl https://app.getoutline.com/api/groups.add_user \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ \ "id": "bb0e8400-e29b-41d4-a716-446655440007", \ "userId": "aa0e8400-e29b-41d4-a716-446655440006" \ }' # Remove a user from a group curl https://app.getoutline.com/api/groups.remove_user \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ \ "id": "bb0e8400-e29b-41d4-a716-446655440007", \ "userId": "aa0e8400-e29b-41d4-a716-446655440006" \ }' # List group members curl https://app.getoutline.com/api/groups.memberships \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ \ "id": "bb0e8400-e29b-41d4-a716-446655440007", \ "query": "jane" \ }' ``` -------------------------------- ### List Documents using API Source: https://context7.com/outline/openapi/llms.txt Retrieves a list of published documents and drafts. Supports filtering by collection, sorting, and pagination. The response includes document metadata and pagination details. ```curl curl https://app.getoutline.com/api/documents.list \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "collectionId": "550e8400-e29b-41d4-a716-446655440000", "sort": "updatedAt", "direction": "DESC", "limit": 25, "offset": 0 }' ``` ```curl curl https://app.getoutline.com/api/documents.list \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "statusFilter": ["published", "draft"], "limit": 50 }' ``` -------------------------------- ### Duplicate a Template using cURL Source: https://context7.com/outline/openapi/llms.txt Creates an exact copy of an existing template, allowing for a new title for the duplicated template. Requires the original template ID and the desired new title. ```bash curl https://app.getoutline.com/api/templates.duplicate \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "id": "ee0e8400-e29b-41d4-a716-446655440010", "title": "Meeting Notes Template (Copy)" }' ``` -------------------------------- ### Update a Document - Bash Source: https://context7.com/outline/openapi/llms.txt Modifies an existing document's title, content, or layout settings. Supports updating the document via its ID or URL ID. Optional parameters include `fullWidth` for layout adjustments. Requires API key authentication. ```bash curl https://app.getoutline.com/api/documents.update \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "id": "hDYep1TPAM", "title": "Welcome to Acme Inc - Updated", "text": "# Welcome\n\nThis is our updated company wiki.\n\n## New Section\n\nAdditional content here.", "fullWidth": true }' ``` -------------------------------- ### Manage Collection Groups (Bash) Source: https://context7.com/outline/openapi/llms.txt Manages group memberships within a collection, allowing for adding groups with specific permissions and listing existing group memberships. Requires collection ID, group ID, and an API key for authentication. ```bash # Add a group to a collection curl https://app.getoutline.com/api/collections.add_group \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "id": "550e8400-e29b-41d4-a716-446655440000", "groupId": "bb0e8400-e29b-41d4-a716-446655440007", "permission": "read" }' ``` ```bash # List group memberships curl https://app.getoutline.com/api/collections.group_memberships \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "id": "550e8400-e29b-41d4-a716-446655440000" }' ``` -------------------------------- ### User Management within Collections Source: https://context7.com/outline/openapi/llms.txt APIs for managing individual user memberships within collections, including adding, removing, and listing users. ```APIDOC ## User Management within Collections ### Description Add, remove, and list individual user memberships for a collection. ### POST /api/collections.add_user #### Description Adds a user to a collection with specified permissions. #### Parameters - **id** (string) - Required - The collection ID. - **userId** (string) - Required - The user ID to add. - **permission** (string) - Required - The permission level (e.g., "read_write"). #### Request Example ```json { "id": "550e8400-e29b-41d4-a716-446655440000", "userId": "aa0e8400-e29b-41d4-a716-446655440006", "permission": "read_write" } ``` ### POST /api/collections.remove_user #### Description Removes a user from a collection. #### Parameters - **id** (string) - Required - The collection ID. - **userId** (string) - Required - The user ID to remove. #### Request Example ```json { "id": "550e8400-e29b-41d4-a716-446655440000", "userId": "aa0e8400-e29b-41d4-a716-446655440006" } ``` ### POST /api/collections.memberships #### Description Lists all users and their permissions for a given collection. #### Parameters - **id** (string) - Required - The collection ID. - **limit** (integer) - Optional - Maximum number of memberships to return. #### Request Example ```json { "id": "550e8400-e29b-41d4-a716-446655440000", "limit": 50 } ``` ``` -------------------------------- ### OAuth Clients API Source: https://context7.com/outline/openapi/llms.txt Endpoints for creating, listing, and managing OAuth clients for third-party integrations. ```APIDOC ## POST /api/oauthClients.create ### Description Registers a new OAuth client application for third-party integrations. ### Method POST ### Endpoint /api/oauthClients.create ### Parameters #### Query Parameters None #### Request Body - **name** (string) - Required - The name of the OAuth client application. - **description** (string) - Optional - A description of the application. - **developerName** (string) - Optional - The name of the developer or company. - **developerUrl** (string) - Optional - The URL of the developer's website. - **redirectUris** (array of strings) - Required - A list of valid redirect URIs for the OAuth flow. - **published** (boolean) - Optional - Whether the application is publicly published. ### Request Example ```json { "name": "My Integration App", "description": "Custom integration for Acme workflows", "developerName": "Acme Inc", "developerUrl": "https://acme.com", "redirectUris": ["https://myapp.acme.com/oauth/callback"], "published": false } ``` ### Response #### Success Response (200) - **data** (object) - Contains the details of the created OAuth client. - **id** (string) - The unique identifier of the OAuth client. - **name** (string) - The name of the client. - **clientId** (string) - The client ID for authentication. - **clientSecret** (string) - The client secret for authentication. - **redirectUris** (array of strings) - The registered redirect URIs. #### Response Example ```json { "data": { "id": "kk0e8400-e29b-41d4-a716-446655440016", "name": "My Integration App", "clientId": "2bquf8avrpdv31par42a", "clientSecret": "ol_sk_rapdv31...", "redirectUris": ["https://myapp.acme.com/oauth/callback"] } } ``` ## POST /api/oauthClients.list ### Description Retrieves a list of all registered OAuth clients. ### Method POST ### Endpoint /api/oauthClients.list ### Parameters #### Query Parameters None #### Request Body - **limit** (integer) - Optional - Maximum number of clients to return. - **after** (string) - Optional - Cursor for pagination. ### Request Example ```json { "limit": 10 } ``` ### Response #### Success Response (200) - **data** (array) - A list of OAuth client objects. - Each object contains `id`, `name`, `clientId`, and `redirectUris`. - **hasMore** (boolean) - Indicates if there are more results. #### Response Example ```json { "data": [ { "id": "kk0e8400-e29b-41d4-a716-446655440016", "name": "My Integration App", "clientId": "2bquf8avrpdv31par42a", "redirectUris": ["https://myapp.acme.com/oauth/callback"] } ], "hasMore": false } ``` ## POST /api/oauthClients.rotate_secret ### Description Rotates the client secret for a specified OAuth client. The old secret will become invalid. ### Method POST ### Endpoint /api/oauthClients.rotate_secret ### Parameters #### Query Parameters None #### Request Body - **id** (string) - Required - The ID of the OAuth client whose secret needs to be rotated. ### Request Example ```json { "id": "kk0e8400-e29b-41d4-a716-446655440016" } ``` ### Response #### Success Response (200) - **data** (object) - Contains the updated OAuth client details with the new secret. - **id** (string) - The unique identifier of the OAuth client. - **clientId** (string) - The client ID. - **clientSecret** (string) - The newly generated client secret. #### Response Example ```json { "data": { "id": "kk0e8400-e29b-41d4-a716-446655440016", "clientId": "2bquf8avrpdv31par42a", "clientSecret": "ol_sk_new_secret_here..." } } ``` ``` -------------------------------- ### POST /api/collections.info Source: https://context7.com/outline/openapi/llms.txt Retrieves details for a specific collection, including its metadata and associated permissions. ```APIDOC ## POST /api/collections.info ### Description Gets collection details including permissions and metadata. ### Method POST ### Endpoint /api/collections.info ### Parameters #### Request Body - **id** (string) - Required - The unique identifier of the collection. ### Request Example ```json { "id": "550e8400-e29b-41d4-a716-446655440000" } ``` ### Response #### Success Response (200) - **data** (object) - Contains collection details like id, name, description, and sort settings. - **policies** (array) - List of policies associated with the collection. #### Response Example ```json { "data": { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Human Resources", "description": "HR documentation and policies", "sort": {"field": "title", "direction": "asc"} }, "policies": [{"id": "550e8400-e29b-41d4-a716-446655440000", "abilities": {"read": true, "update": true}}] } ``` ``` -------------------------------- ### POST /api/documents.duplicate Source: https://context7.com/outline/openapi/llms.txt Creates a copy of a document, with options to duplicate child documents and publish the copy. ```APIDOC ## POST /api/documents.duplicate ### Description Creates a copy of a document with optional child document duplication. ### Method POST ### Endpoint https://app.getoutline.com/api/documents.duplicate ### Parameters #### Request Body - **id** (string) - Required - The ID of the document to duplicate. - **title** (string) - Optional - The title for the duplicated document. Defaults to the original title with "(Copy)" appended. - **recursive** (boolean) - Optional - If true, duplicates child documents as well. Defaults to false. - **publish** (boolean) - Optional - If true, the duplicated document is published. Defaults to false. ### Request Example ```json { "id": "hDYep1TPAM", "title": "Welcome to Acme Inc (Copy)", "recursive": true, "publish": true } ``` ### Response #### Success Response (200) - **data** (object) - **documents** (array) - An array of duplicated documents, including the main document and any children if `recursive` was true. - **id** (string) - The ID of the duplicated document. - **title** (string) - The title of the duplicated document. #### Response Example ```json { "data": { "documents": [ {"id": "...", "title": "Welcome to Acme Inc (Copy)"}, {"id": "...", "title": "Child Document (Copy)"} ] } } ``` ``` -------------------------------- ### POST /api/collections.export_all Source: https://context7.com/outline/openapi/llms.txt Initiates an export of all collections from your Outline instance. The export can be in JSON format and may include attachments. ```APIDOC ## POST /api/collections.export_all ### Description Initiates an export of all collections from your Outline instance. The export can be in JSON format and may include attachments. ### Method POST ### Endpoint https://app.getoutline.com/api/collections.export_all ### Parameters #### Request Body - **format** (string) - Required - The desired export format (e.g., "json"). - **includeAttachments** (boolean) - Optional - Whether to include attachments in the export. - **includePrivate** (boolean) - Optional - Whether to include private collections in the export. ### Request Example ```json { "format": "json", "includeAttachments": true, "includePrivate": false } ``` ### Response #### Success Response (200) - **data** (object) - Contains information about the file operation. - **fileOperation** (object) - **id** (string) - The unique identifier for the export operation. - **type** (string) - The type of operation, "export". - **state** (string) - The current state of the operation (e.g., "creating"). #### Response Example ```json { "data": { "fileOperation": { "id": "cc0e8400-e29b-41d4-a716-446655440008", "type": "export", "state": "creating" } } } ``` ``` -------------------------------- ### Manage OAuth Clients - Outline API Source: https://context7.com/outline/openapi/llms.txt Manages OAuth clients for third-party integrations, including creation, listing, and secret rotation. Requires an API key for authorization. ```curl # Create an OAuth client curl https://app.getoutline.com/api/oauthClients.create \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "name": "My Integration App", "description": "Custom integration for Acme workflows", "developerName": "Acme Inc", "developerUrl": "https://acme.com", "redirectUris": ["https://myapp.acme.com/oauth/callback"], "published": false }' # List OAuth clients curl https://app.getoutline.com/api/oauthClients.list \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{}' # Rotate client secret curl https://app.getoutline.com/api/oauthClients.rotate_secret \ -X POST \ -H "Authorization: Bearer ol_api_your_api_key_here" \ -H "Content-Type: application/json" \ -d '{ "id": "kk0e8400-e29b-41d4-a716-446655440016" }' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.