# ai_index_orgs_users_documents_train_create Train a document through a worker process. This endpoint queues larger documents for training through a worker process, which is more suitable for handling documents that would take too long to process directly. Args: request: The HTTP request containing the document information. org: Organization key identifier. Returns: Response: A confirmation that the document was queued for training, including a task ID for tracking the progress. Raises: ValidationError: If the request data is invalid. BadRequest: If there was an error processing the document. Endpoint: POST /api/ai-index/orgs/{org}/users/{user_id}/documents/train/ Version: 3.59.0-ai-plus Security: PlatformApiKeyAuthentication ## Path parameters: - `org` (string, required) - `user_id` (string, required) ## Request fields (multipart/form-data): - `pathway` (string, required) Pathway for document to be trained in - `url` (string) Url of the document to be trained - `text` (string) Search text for wikipedia - `type` (string, required) Type of document e.g file - `translate` (boolean) If file should be translated - `file` (string) File to be trained - `access` (string) Accessibilityto the file - `branch` (string) Branch of the repository - `google_drive_auth_data` (any) Authentication and scoped details of google drive - `dropbox_auth_data` (any) Authentication and scoped details of dropbox - `crawler_max_depth` (integer) The max depth of the crawler - `crawler_max_pages_limit` (integer) The max pages limit of the crawler - `crawler_max_concurrency` (integer) The max concurrency of the crawler - `crawler_match_patterns` (array) The patterns that the crawler should use to match urls. Patterns may be a glob pattern or a full regex pattern. Indicate the specified type in . - `crawler_use_glob_matching` (boolean) Whether to use glob patterns for the crawler ## Response 200 fields (application/json): - `document_id` (string) Document id for document in training - `task_id` (string) Task id for document in training - `message` (string, required) Message of the training - `error` (string)