Skip to main content

Document Management API

The Document Management API allows you to programmatically upload documents for analysis and retrieve document information.
External IDs: The API uses external IDs (from your CRM system) for contacts and accounts rather than internal Fabius IDs. This allows seamless integration without needing to map between different ID systems.

Create Document

Upload a new document to Fabius for processing and analysis.

Endpoint

POST /external/v1/documents

Request Body

{
  "name": "string",               // Required: Document name
  "content": "string",            // Required: Document content
  "documentTimestamp": "string",  // Optional: RFC3339 timestamp when document was created
  "userEmail": "string",          // Optional: Associate with user by email
  "externalContactId": "string",  // Optional: External ID of contact in your CRM
  "externalAccountId": "string"   // Optional: External ID of account in your CRM
}

Example Request

curl -X POST https://api.fabius.io/external/v1/documents \
  -u "your-client-id:your-client-secret" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Customer Meeting Notes - Acme Corp",
    "content": "Discussion points:\n- Product roadmap review\n- Pricing negotiations\n- Next steps for Q1",
    "userEmail": "[email protected]",
    "externalAccountId": "ACCT-12345"
  }'

Example with Custom Timestamp

When uploading historical documents or processing documents in batch, you can specify when the document was originally created:
curl -X POST https://api.fabius.io/external/v1/documents \
  -u "your-client-id:your-client-secret" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Q3 2023 Sales Report",
    "content": "Quarterly sales performance summary...",
    "documentTimestamp": "2023-09-30T23:59:59Z",
    "userEmail": "[email protected]"
  }'

Response

Status Code: 201 Created
{
  "id": "7f3e4d5c-2b1a-4e3d-8c7b-9a8b7c6d5e4f",
  "status": "created",
  "createdAt": "2024-01-15T10:30:00Z"
}

List Documents

Retrieve a paginated list of documents.

Endpoint

GET /external/v1/documents

Query Parameters

ParameterTypeDescriptionDefault
limitintegerNumber of documents to return (1-100)20
offsetintegerNumber of documents to skip0
externalContactIdstringFilter by external contact ID-
externalAccountIdstringFilter by external account ID-
The response includes a nextOffset field that indicates the offset to use for the next page of results. When nextOffset is -1, there are no more pages available.

Example Request

curl -X GET "https://api.fabius.io/external/v1/documents?limit=10&offset=0" \
  -u "your-client-id:your-client-secret"

Response

{
  "items": [
    {
      "id": "7f3e4d5c-2b1a-4e3d-8c7b-9a8b7c6d5e4f",
      "name": "Customer Meeting Notes - Acme Corp",
      "documentTimestamp": "2024-01-15T10:30:00Z",
      "documentType": "FORM_SUBMISSION",
      "userEmail": "[email protected]",
      "externalContactId": "CONT-98765",
      "externalAccountId": "ACCT-12345",
      "createdAt": "2024-01-15T10:30:00Z",
      "updatedAt": "2024-01-15T10:30:00Z",
      "analysisCount": 3
    }
  ],
  "total": 42,
  "limit": 10,
  "nextOffset": 10
}

Get Document

Retrieve a specific document by ID.

Endpoint

GET /external/v1/documents/{id}

Example Request

curl -X GET "https://api.fabius.io/external/v1/documents/7f3e4d5c-2b1a-4e3d-8c7b-9a8b7c6d5e4f" \
  -u "your-client-id:your-client-secret"

Response

{
  "id": "7f3e4d5c-2b1a-4e3d-8c7b-9a8b7c6d5e4f",
  "name": "Customer Meeting Notes - Acme Corp",
  "documentTimestamp": "2024-01-15T10:30:00Z",
  "documentType": "FORM_SUBMISSION",
  "userEmail": "[email protected]",
  "externalContactId": "CONT-98765",
  "externalAccountId": "ACCT-12345",
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T10:30:00Z",
  "analyses": [
    {
      "configurationId": "8a4f3d2c-1b5a-4e7d-9c8b-7a6b5c4d3e2f",
      "configurationName": "Sales Call Analysis",
      "runAt": "2024-01-15T10:35:00Z",
      "fields": [
        {
          "fieldId": "field-123",
          "fieldName": "Deal Stage",
          "fieldType": "value",
          "value": {
            "type": "string",
            "data": "Negotiation"
          }
        },
        {
          "fieldId": "field-456",
          "fieldName": "Customer Satisfaction",
          "fieldType": "score",
          "score": {
            "value": 8,
            "pros": "Strong engagement, clear decision criteria",
            "cons": "Budget concerns mentioned",
            "suggestions": "Address pricing flexibility in next meeting"
          }
        }
      ]
    }
  ]
}

Document Analysis Results

When retrieving a specific document, the response includes analysis results if the document has been processed by AI analysis configurations.

Analysis Structure

Each analysis contains:
  • configurationId: Unique identifier for the analysis configuration used
  • configurationName: Human-readable name of the analysis configuration
  • runAt: Timestamp when the analysis was performed
  • fields: Array of extracted fields from the analysis

Field Types

Fields can be one of two types:

Score Fields

Score fields represent numerical evaluations with qualitative context:
{
  "fieldType": "score",
  "score": {
    "value": 8,
    "pros": "string",
    "cons": "string",
    "suggestions": "string"
  }
}
  • value: Numerical score (nullable)
  • pros: Positive aspects identified
  • cons: Areas for improvement
  • suggestions: Optional recommendations

Value Fields

Value fields contain extracted data in various formats:
{
  "fieldType": "value",
  "value": {
    "type": "string",
    "data": "example value"
  }
}
Value types:
  • string: Single text value (e.g., “Negotiation”)
  • strings: Array of text values (e.g., [“Budget”, “Timeline”, “Features”])
  • map: Key-value pairs (e.g., {"competitor": "Acme Corp", "strengths": "Price"})
The list documents endpoint returns an analysisCount field showing how many analyses have been run on each document, but does not include the full analysis details to keep response sizes manageable.

Document Timestamps

By default, documents are timestamped with the current time when created. However, you can specify a custom timestamp to preserve the original creation date:
{
  "name": "Historical Report",
  "content": "...",
  "documentTimestamp": "2023-12-15T14:30:00Z"
}
Document timestamps must be in RFC3339 format (ISO 8601 with timezone). This is useful for:
  • Batch uploading historical documents
  • Maintaining accurate timelines when migrating data
  • Preserving original document dates from other systems

User Association

Documents can be associated with users in your system by providing their email address:
{
  "name": "Sales Call Notes",
  "content": "...",
  "userEmail": "[email protected]"
}
The email address must match an existing Gong user in your Fabius account. The system will look up the user by email address and associate the document with them.

Best Practices

  1. Document Naming: Use descriptive names that help identify documents later
  2. User Association: Always include userEmail when the document is related to a specific team member
  3. Entity Linking: Use external IDs from your CRM system when linking documents to contacts and accounts
  4. Content Format: Provide clean, well-formatted text content for best analysis results
  5. Batch Operations: When uploading multiple documents, implement proper error handling and retries

Document Types

Documents are created with the following default settings:
  • Type: FORM_SUBMISSION
  • Timestamp: Current time (unless specified via documentTimestamp)
  • Processing: Documents are automatically queued for AI analysis after creation
Additional document types may be supported in future releases.

Limitations

  • Maximum documents per request: 1 (batch uploads coming soon)
  • Content format: Plain text is recommended for best analysis results
  • Entity associations: Documents can be linked to contacts and accounts via their UUIDs