Authentication
This endpoint requires a valid API key in the Authorization header.Path Parameters
The ID of the assistant to use. Use
"default"
for the general Wordsmith
assistant, or specify a custom assistant ID if available.Request Body
The question to ask the assistant. Maximum length: 10,000 characters.
An array of file attachments (maximum 10 files). Each attachment can be either
an uploaded file or a URL.
The session ID to add this question to. If not provided, a new session will be
created. When adding to an existing session, the conversation context is
preserved for follow-up questions.
Optional permissions settings for the chat session.
URL to receive a webhook notification when async processing is complete. Only
used when
sync_mode
is false
. Optionally signed with the webhook secret if
provided when creating a new API key. Signature is in the
Wordsmith-Signature
header.Whether to wait for the complete response synchronously.
true
: Response
includes the full answer (30-second timeout). false
: Returns immediately
with a session ID for async processing.Response
The unique identifier for this specific question.
The session ID that contains this question. This is always the same for all
questions within a conversation session.
A direct URL to view this session in the Wordsmith web application. This
allows users to access the full conversation history and interact with the
assistant through the web interface.
The current status of the question:
"in_progress"
: Processing is ongoing.
"completed"
: Answer is ready. "error"
: Processing failed.The assistant’s response to your question. Only present when
status
is
"completed"
.Array of files generated by the assistant (e.g., summary documents, analysis reports). Only present when
status
is "completed"
.Async Processing & Webhooks
When usingsync_mode: false
, you can receive notifications via webhook when processing completes:
Error Responses
Session Management
Adding Questions to Existing Sessions
When adding questions to an existing session using thesession_id
parameter:
- Conversation Context: The assistant maintains context from previous questions and answers in the session
- Sequential Processing: New questions cannot be submitted until the previous question in the session has completed processing
- Error Handling: If a previous question is still processing, the API will return a 400 Bad Request error
ID vs Session ID
The response includes two important identifiers:id
: The unique identifier for this specific question. For new sessions, this equals the session_id. For follow-up questions, this is a unique question ID.session_id
: The session ID that contains this question. This remains constant for all questions within the same conversation.
id
field to check the status of individual questions, and the session_id
to identify which conversation session the question belongs to.
Best Practices
Sync vs Async Mode
Use Sync Mode (sync_mode: true
) for:
- Testing and development
sync_mode: false
) for:
- Complex document analysis
- Multiple file attachments
- Production applications
- Long-form research questions
File Attachments
- Supported formats: PDF, DOC, DOCX, TXT, MD, HTML, XLS, XLSX, CSV, TSV, PPT, PPTX, PNG, JPEG, WebP, TIFF, MP3, MP4, M4A, MPEG, WAV, WebM, ZIP
- Maximum file size: 50 MB per file
- Maximum attachments: 10 files per question
Question Guidelines
- Be specific: More detailed questions get better answers
- Provide context: Include relevant background information
Use Cases
1. Document Review & Analysis
- Basic Review: “Review attached document”
- Review with Specific Playbook: “Review this document using the Standard NDA playbook”
- Reference Playbook by ID: “Review this document using playbook ID: 123e4567-e89b-12d3-a456-426614174000”
2. Template Filling & Document Generation
- Fill Template: “Fill in our standardemployment agreement template using me as the employer party”
- Reference Template by ID: “Fill in template ID: 123e4567-e89b-12d3-a456-426614174000 using my company information”
3. Legal Research & Analysis
- Case Law Research: “What are the recent precedents for breach of contract cases in California?”
- Regulatory Compliance: “What are the current requirements for data protection in healthcare contracts?”
- Legal Framework: “Explain the key elements of a valid employment contract under UK law”
- Industry Standards: “What are the standard terms typically included in SaaS vendor agreements?“
4. Document Drafting & Creation
- Email Drafting: “Draft a professional email to a client explaining contract delays”
- Clause Drafting: “Draft a force majeure clause for a construction contract”
- Legal Letters: “Write a demand letter for unpaid invoices”
- Meeting Minutes: “Draft meeting minutes based on the attached audio recording”
5. Translation & Conversion
- Language Translation: “Translate this contract to Spanish while maintaining legal accuracy”
- Multi-language: “Provide this agreement in both English and French versions”
- Format Conversion: “Convert this PDF document to DOCX”
6. Presentations & Spreadsheets
- Generate Presentation: “Create a PowerPoint presentation summarizing the key findings from the review of attached NDA”
- Executive Summary: “Generate an executive summary of this legal document for senior management”
- Questionnaire Processing: “Fill in this security questionnaire in the attached XLSX”
- Spreadsheet Generation: “Extract all dates, amounts, and party names from this document into a structured spreadsheet”