MediScan Public API

Public-facing GraphQL API for MediScan AI.

Getting Started

Base URL

Production: https://the-api.mediscan.ai/api

All API requests should be made to the GraphQL endpoint using POST method.

Quick Start Guide

  1. Generate an API Key - Only administrators can create API keys. In your MediScan AI account, click the top-left dropdown menu and navigate to API Management to generate a new API key

  2. Make Your First Request - Include your API key in the Authorization header:

    Authorization: Bearer YOUR_API_KEY
    
  3. Create a Case - Create a case, queue a DOCX export using the existing preset-selection behavior, and receive signed URLs for file upload. To choose a specific preset, see Preset-Aware Exports below:

    const response = await fetch('https://the-api.mediscan.ai/api', {
                      method: 'POST',
                      headers: {
                        'Authorization': 'Bearer YOUR_API_KEY',
                        'Content-Type': 'application/json'
                      },
                      body: JSON.stringify({
                       query: `
                         mutation CreateCase($fileNames: [String!]!) {
                           createCase(fileNames: $fileNames, exportConfigs: [{ exportType: docx }]) {
                              caseId
                              signedUrl
                              exportId
                            }
                          }
                        `,
                        variables: {
                          fileNames: ['medical-record.pdf', 'lab-results.pdf']
                        }
                      })
                    });
                    
                    const { data } = await response.json();
                    console.log('Case created:', data.createCase.caseId);
                    console.log('Signed URLs:', data.createCase.signedUrl);
                    
  4. Upload Files - Upload your files to the signed URLs (one URL per file):

    // Get the file to upload
                    const file = document.getElementById('fileInput').files[0];
                    
                    // Use the signed URL from createCase response
                    const signedUrl = data.createCase.signedUrl[0];
                    
                    const uploadResponse = await fetch(signedUrl, {
                      method: 'PUT',
                      body: file,
                      headers: {
                        'Content-Type': file.type || 'application/octet-stream'
                      }
                    });
                    
                    if (uploadResponse.ok) {
                      console.log('File uploaded successfully');
                    }
                    

    Important: Use the signed URL exactly as provided - do not add any additional headers or authentication.

  5. Check Processing Status - Monitor case processing progress:

    const response = await fetch('https://the-api.mediscan.ai/api', {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
       query: `
         query GetCaseStatus($caseId: String!) {
           getCaseStatus(caseId: $caseId) {
              status
              filesCount
              processedCount
            }
          }
        `,
       variables: { caseId: data.createCase.caseId }
     })
      });
    

const { data } = await response.json(); console.log(`Status: ${data.getCaseStatus.status}`); console.log(`Processed: ${data.getCaseStatus.processedCount}/${data.getCaseStatus.filesCount}`);


                6. **Get Case Details** - Retrieve full case information including exports:
                ```javascript
                const response = await fetch('https://the-api.mediscan.ai/api', {
                  method: 'POST',
                  headers: {
                    'Authorization': 'Bearer YOUR_API_KEY',
                    'Content-Type': 'application/json'
                  },
                  body: JSON.stringify({
                   query: `
                     query GetCase($caseId: String!) {
                       getCase(caseId: $caseId) {
                         id
                         patientName
                         created
                         exports {
                           exportId
                           status
                         }
                       }
                     }
                   `,
                   variables: { caseId: data.createCase.caseId }
                 })
                  });
                  
                  const { data } = await response.json();
                  console.log(\`Patient: ${data.getCase.patientName}\`);
                  console.log(\`Exports: ${data.getCase.exports.length}\`);
                
  1. Get Export by ID - Retrieve a specific export with download URLs:
    const response = await fetch('https://the-api.mediscan.ai/api', {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
       query: `
         query GetExport($exportId: String!) {
           getExport(exportId: $exportId) {
             id
             files {
               signedUrl
               filename
               mimeType
             }
           }
         }
       `,
       variables: { exportId: data.createCase.exportId }
     })
      });
    

const { data } = await response.json(); data.getExport.files.forEach(file => { console.log(`${file.filename}: ${file.signedUrl}`); });


                8. **Get Case with Exports** - Retrieve full case details with all exports:
                ```javascript
                const response = await fetch('https://the-api.mediscan.ai/api', {
                  method: 'POST',
                  headers: {
                    'Authorization': 'Bearer YOUR_API_KEY',
                    'Content-Type': 'application/json'
                  },
                  body: JSON.stringify({
                   query: `
                     query GetCase($caseId: String!) {
                       getCase(caseId: $caseId) {
                         id
                         patientName
                         exports {
                           exportId
                           status
                           files {
                             signedUrl
                             filename
                           }
                         }
                       }
                     }
                   `,
                   variables: { caseId: data.createCase.caseId }
                 })
                  });
                  
                  const { data } = await response.json();
                  data.getCase.exports.forEach(exp => {
                 console.log(\`Export ${exp.exportId} (${exp.status}):\`);
                 exp.files.forEach(file => console.log(\`  ${file.filename}\`));
                });
                
  1. Update Cases (Optional) - Add new files or modify case properties:
    const response = await fetch('https://the-api.mediscan.ai/api', {
                      method: 'POST',
                      headers: {
                        'Authorization': 'Bearer YOUR_API_KEY',
                        'Content-Type': 'application/json'
                      },
                      body: JSON.stringify({
                       query: `
                         mutation UpdateCase($caseId: String!, $fileNames: [String!]) {
                           updateCase(caseId: $caseId, fileNames: $fileNames) {
                              caseId
                              signedUrl
                              success
                              message
                            }
                          }
                        `,
                        variables: {
                          caseId: 'your-case-id',
                          fileNames: ['additional-document.pdf']
                        }
                      })
                    });
                    
                    const { data } = await response.json();
                    console.log('Case updated:', data.updateCase.success);
                    console.log('New signed URLs:', data.updateCase.signedUrl);
                    

Note: The examples above show basic usage with commonly used fields. Many more fields and options are available for each query and mutation. Please refer to the full API schema documentation below for complete details on all available fields, types, and configurations.

Preset-Aware Exports

Query getPresets with the same API key used for your case and export requests. It takes no team ID argument: results belong to the API key's team and exclude case-local presets.

query GetPresets {
  getPresets {
    id
    title
    usedBy {
      id
      name
      email
    }
  }
}

usedBy lists users who selected that preset as their default for this team, not users who previously exported with it. It is empty when no team users have selected it.

Create a case and export with a selected preset

  1. Choose an id from getPresets.
  2. Call createCase without exportConfigs, upload PDFs using the returned signed URLs, and wait for processing to complete. Omitting exportConfigs avoids creating an additional automatic export.
  3. Call createExport with the case ID and selected preset ID:
mutation CreateExport($caseId: String!, $presetId: String!) {
  createExport(
    caseId: $caseId
    config: { exportType: docx, presetOverride: $presetId }
  ) {
    exportId
    status
  }
}

Example GraphQL variables:

{ "caseId": "your-case-id", "presetId": "id-returned-by-getPresets" }
  1. Poll getExport(exportId: ...) using the exportId returned by createExport. While pending, it reports no downloadable files in the GraphQL errors array. Once ready, download each file from its signedUrl. This ID is the public request ID, not an internal export-record ID.

Selection rules and other export entry points

  • presetOverride is optional in createExport.config and in each item of createCase.exportConfigs or updateCase.exportConfigs. Existing requests do not need to change or call getPresets.
  • With createCase.exportConfigs, exports are queued and the returned exportId identifies the batch. updateCase does not return an export ID; use a separate createExport call when you need an ID to poll. When adding files, finish uploading and processing them before requesting an export separately.
  • Omit presetOverride or pass null to preserve the previous selection: use the case's preset for the API user when present, otherwise that user's default preset. Existing AccidentMate preset assignment and selection are unchanged when no override is supplied.
  • Default lookup and export ownership currently use the API user's current team. Keep it aligned with the API key's team; an explicit override does not change export ownership.
  • The override applies only to the requested export; it does not change user defaults or case presets. Preset settings are saved when the export is requested.
  • Explicit grouping and sorting override the preset's corresponding settings. Without them, the selected preset supplies those settings when available.
  • Missing, foreign-team, and case-local override IDs are rejected before quota consumption or case changes. Check the GraphQL errors array; production may mask the detailed validation message.

Error Handling

The API uses standard GraphQL error responses. All errors are returned in the errors array of the response.

Common Error Codes

Code Status Description
UNAUTHENTICATED 401 Invalid or missing API key
FORBIDDEN 403 Insufficient permissions to access resource
BAD_USER_INPUT 400 Invalid input parameters
NOT_FOUND 404 Requested resource not found
INTERNAL_SERVER_ERROR 500 Server error occurred
RATE_LIMIT_EXCEEDED 429 Too many requests

Rate Limiting

To ensure fair usage and system stability, API requests are rate limited.

Limits:

  • 100 requests per minute per API key
  • 1,000 requests per hour per API key

When rate limited, you'll receive a 429 Too Many Requests error. Wait until the reset time before making additional requests.

Best Practices:

  • Implement exponential backoff for retries
  • Cache responses when appropriate
  • Batch operations when possible
Contact

MediScan AI Support

support@mediscan.ai

https://mediscan.ai

API Endpoints
https://the-api.mediscan.ai/api
Version

1.0.0

Queries

getCase

Description

Get a specific case with its exports

Response

Returns a Case!

Arguments
Name Description
caseId - String! Case ID to retrieve

Example

Query
query getCase($caseId: String!) {
  getCase(caseId: $caseId) {
    id
    patientName
    status
    created
    modified
    createdBy
    teamId
    injuryBodyParts
    injuryDescription
    dateOfInjury
    insurance
    employer
    occupation
    dob
    claimNumber
    adjNumber
    customDemographics
    customColumns
    assignees
    guestAccess
    exports {
      ...CaseExportFragment
    }
    sourceFiles {
      ...SourceFileFragment
    }
  }
}
Variables
{"caseId": "xyz789"}
Response
{
  "data": {
    "getCase": {
      "id": "xyz789",
      "patientName": "abc123",
      "status": "IN_PROGRESS",
      "created": "abc123",
      "modified": "xyz789",
      "createdBy": "xyz789",
      "teamId": "abc123",
      "injuryBodyParts": ["xyz789"],
      "injuryDescription": ["abc123"],
      "dateOfInjury": ["xyz789"],
      "insurance": ["abc123"],
      "employer": ["xyz789"],
      "occupation": ["abc123"],
      "dob": ["abc123"],
      "claimNumber": ["abc123"],
      "adjNumber": ["xyz789"],
      "customDemographics": RecordTypeMap,
      "customColumns": RecordTypeMap,
      "assignees": ["xyz789"],
      "guestAccess": ["xyz789"],
      "exports": [CaseExport],
      "sourceFiles": [SourceFile]
    }
  }
}

getCaseStatus

Description

Get the current status of a case

Response

Returns a CaseStatusOutput!

Arguments
Name Description
caseId - String! Case ID to check status for

Example

Query
query getCaseStatus($caseId: String!) {
  getCaseStatus(caseId: $caseId) {
    caseId
    status
    message
    filesCount
    processedCount
    createdAt
    updatedAt
  }
}
Variables
{"caseId": "xyz789"}
Response
{
  "data": {
    "getCaseStatus": {
      "caseId": "xyz789",
      "status": "IN_PROGRESS",
      "message": "abc123",
      "filesCount": 987,
      "processedCount": 123,
      "createdAt": "abc123",
      "updatedAt": "xyz789"
    }
  }
}

getCases

Description

Get all cases in your team

Response

Returns [Case!]!

Example

Query
query getCases {
  getCases {
    id
    patientName
    status
    created
    modified
    createdBy
    teamId
    injuryBodyParts
    injuryDescription
    dateOfInjury
    insurance
    employer
    occupation
    dob
    claimNumber
    adjNumber
    customDemographics
    customColumns
    assignees
    guestAccess
    exports {
      ...CaseExportFragment
    }
    sourceFiles {
      ...SourceFileFragment
    }
  }
}
Response
{
  "data": {
    "getCases": [
      {
        "id": "abc123",
        "patientName": "abc123",
        "status": "IN_PROGRESS",
        "created": "xyz789",
        "modified": "abc123",
        "createdBy": "abc123",
        "teamId": "xyz789",
        "injuryBodyParts": ["abc123"],
        "injuryDescription": ["abc123"],
        "dateOfInjury": ["xyz789"],
        "insurance": ["xyz789"],
        "employer": ["abc123"],
        "occupation": ["abc123"],
        "dob": ["xyz789"],
        "claimNumber": ["abc123"],
        "adjNumber": ["abc123"],
        "customDemographics": RecordTypeMap,
        "customColumns": RecordTypeMap,
        "assignees": ["abc123"],
        "guestAccess": ["xyz789"],
        "exports": [CaseExport],
        "sourceFiles": [SourceFile]
      }
    ]
  }
}

getExport

Description

Get export details including download URLs for export files

Response

Returns an ExportOutput!

Arguments
Name Description
exportId - String! Export ID (requestId) to retrieve

Example

Query
query getExport($exportId: String!) {
  getExport(exportId: $exportId) {
    id
    files {
      ...ExportFileFragment
    }
    createdTime
    exportConfig {
      ...ExportConfigFragment
    }
  }
}
Variables
{"exportId": "xyz789"}
Response
{
  "data": {
    "getExport": {
      "id": "abc123",
      "files": [ExportFile],
      "createdTime": "xyz789",
      "exportConfig": ExportConfig
    }
  }
}

getPresets

Description

Get non-local presets belonging to the API key's team and the users who have each preset selected as their default for that team. usedBy is not export history. Use a returned preset ID as ExportConfigInput.presetOverride.

Response

Returns [Preset!]!

Example

Query
query getPresets {
  getPresets {
    id
    title
    usedBy {
      ...PresetUserFragment
    }
  }
}
Response
{
  "data": {
    "getPresets": [
      {
        "id": "abc123",
        "title": "abc123",
        "usedBy": [PresetUser]
      }
    ]
  }
}

getUsers

Description

Get all users in your team

Response

Returns [User!]!

Example

Query
query getUsers {
  getUsers {
    id
    name
    email
    role
  }
}
Response
{
  "data": {
    "getUsers": [
      {
        "id": "xyz789",
        "name": "xyz789",
        "email": "xyz789",
        "role": "xyz789"
      }
    ]
  }
}

Mutations

createCase

Description

Create a new medical record case and get signed URLs to upload files. Upload your files to the returned URLs using PUT requests.

Response

Returns a CreateCaseOutput!

Arguments
Name Description
fileNames - [String!]! List of PDF filenames to upload. Each filename must be in the format 'name.pdf'. Only PDF files are supported. Example: ['medical-record.pdf', 'lab-results.pdf']
exportConfigs - [ExportConfigInput!] Pre-configure exports, optionally selecting a team preset with presetOverride
demographics - DemographicsInput Case demographics
assignees - [String!] Assign team members to this case
guestAccess - [String!] Grant guest access to specific users
customKey - String Custom key to identify the API source (e.g., 'accidentMate')

Example

Query
mutation createCase(
  $fileNames: [String!]!,
  $exportConfigs: [ExportConfigInput!],
  $demographics: DemographicsInput,
  $assignees: [String!],
  $guestAccess: [String!],
  $customKey: String
) {
  createCase(
    fileNames: $fileNames,
    exportConfigs: $exportConfigs,
    demographics: $demographics,
    assignees: $assignees,
    guestAccess: $guestAccess,
    customKey: $customKey
  ) {
    caseId
    signedUrl
    exportId
    sourceFiles {
      ...SourceFileFragment
    }
  }
}
Variables
{
  "fileNames": ["xyz789"],
  "exportConfigs": [ExportConfigInput],
  "demographics": DemographicsInput,
  "assignees": ["abc123"],
  "guestAccess": ["abc123"],
  "customKey": "abc123"
}
Response
{
  "data": {
    "createCase": {
      "caseId": "abc123",
      "signedUrl": ["abc123"],
      "exportId": "xyz789",
      "sourceFiles": [SourceFile]
    }
  }
}

createExport

Description

Create a new export with an optional team preset and filtering, grouping, and sorting options. Use this to generate custom reports from processed records.

Response

Returns a CreateExportOutput!

Arguments
Name Description
caseId - String! Case ID to export
config - ExportConfigInput! Export configuration (format, presetOverride, filters, grouping, sorting)

Example

Query
mutation createExport(
  $caseId: String!,
  $config: ExportConfigInput!
) {
  createExport(
    caseId: $caseId,
    config: $config
  ) {
    exportId
    status
  }
}
Variables
{
  "caseId": "abc123",
  "config": ExportConfigInput
}
Response
{
  "data": {
    "createExport": {
      "exportId": "abc123",
      "status": "xyz789"
    }
  }
}

updateCase

Description

Update an existing case with new files and/or modify case properties. Returns signed URLs for any new files to upload.

Adding new files sets the case status to IN_PROGRESS while the files are being processed. Once processing completes, the status transitions to COMPLETE.

Response

Returns an UpdateCaseOutput!

Arguments
Name Description
caseId - String! Existing case ID to update
fileNames - [String!]

List of new PDF filenames to add. Each filename must be in the format 'name.pdf'. Only PDF files are supported. Example: ['additional-document.pdf']

Adding files sets the case status to IN_PROGRESS until processing completes, then COMPLETE.

exportConfigs - [ExportConfigInput!] Request exports, optionally selecting a team preset with presetOverride
demographics - DemographicsInput Update case demographics
customColumns - RecordTypeMap Update custom columns as Map<String, String>
assignees - [String!] Update team member assignments
guestAccess - [String!] Update guest access list

Example

Query
mutation updateCase(
  $caseId: String!,
  $fileNames: [String!],
  $exportConfigs: [ExportConfigInput!],
  $demographics: DemographicsInput,
  $customColumns: RecordTypeMap,
  $assignees: [String!],
  $guestAccess: [String!]
) {
  updateCase(
    caseId: $caseId,
    fileNames: $fileNames,
    exportConfigs: $exportConfigs,
    demographics: $demographics,
    customColumns: $customColumns,
    assignees: $assignees,
    guestAccess: $guestAccess
  ) {
    caseId
    signedUrl
    success
    message
    sourceFiles {
      ...SourceFileFragment
    }
  }
}
Variables
{
  "caseId": "xyz789",
  "fileNames": ["xyz789"],
  "exportConfigs": [ExportConfigInput],
  "demographics": DemographicsInput,
  "customColumns": RecordTypeMap,
  "assignees": ["xyz789"],
  "guestAccess": ["abc123"]
}
Response
{
  "data": {
    "updateCase": {
      "caseId": "abc123",
      "signedUrl": ["xyz789"],
      "success": true,
      "message": "xyz789",
      "sourceFiles": [SourceFile]
    }
  }
}

Types

Boolean

Description

The Boolean scalar type represents true or false.

Example
true

Case

Description

Case information

Fields
Field Name Description
id - String! Case identifier
patientName - String Patient name
status - CaseStatus Processing status of the case
created - String ISO 8601 timestamp when the case was created
modified - String ISO 8601 timestamp when the case was last modified
createdBy - String! User who created the case
teamId - String! Team ID
injuryBodyParts - [String!] Injured body parts
injuryDescription - [String!] Description of injury
dateOfInjury - [String!] Date of injury
insurance - [String!] Insurance provider
employer - [String!] Employer name
occupation - [String!] Patient occupation
dob - [String!] Date of birth
claimNumber - [String!] Claim number
adjNumber - [String!] Adjuster number
customDemographics - RecordTypeMap Custom demographic fields
customColumns - RecordTypeMap Custom columns
assignees - [String!] Assignees
guestAccess - [String!] Guest access list
exports - [CaseExport!] List of exports for this case
sourceFiles - [SourceFile!] List of source files uploaded to this case
Example
{
  "id": "abc123",
  "patientName": "abc123",
  "status": "IN_PROGRESS",
  "created": "abc123",
  "modified": "abc123",
  "createdBy": "xyz789",
  "teamId": "xyz789",
  "injuryBodyParts": ["abc123"],
  "injuryDescription": ["abc123"],
  "dateOfInjury": ["xyz789"],
  "insurance": ["xyz789"],
  "employer": ["abc123"],
  "occupation": ["abc123"],
  "dob": ["xyz789"],
  "claimNumber": ["abc123"],
  "adjNumber": ["xyz789"],
  "customDemographics": RecordTypeMap,
  "customColumns": RecordTypeMap,
  "assignees": ["abc123"],
  "guestAccess": ["abc123"],
  "exports": [CaseExport],
  "sourceFiles": [SourceFile]
}

CaseExport

Description

Export information for a case

Fields
Field Name Description
exportId - String! Export identifier
status - String! Export status
files - [ExportFile!]! List of downloadable files for this export
createdAt - String! ISO 8601 timestamp when export was created
exportConfig - ExportConfig! Export configuration used for this export
Example
{
  "exportId": "xyz789",
  "status": "xyz789",
  "files": [ExportFile],
  "createdAt": "abc123",
  "exportConfig": ExportConfig
}

CaseStatus

Description

Case processing status

Values
Enum Value Description

IN_PROGRESS

COMPLETE

ERROR

QA_COMPLETE

IN_REVIEW

DELIVERED

Example
"IN_PROGRESS"

CaseStatusOutput

Description

Case status output

Fields
Field Name Description
caseId - String! Case identifier
status - CaseStatus! Current status of the case
message - String Detailed message about the current status
filesCount - Int Number of files uploaded
processedCount - Int Number of files processed
createdAt - String! ISO 8601 timestamp when the case was created
updatedAt - String! ISO 8601 timestamp when the case was last updated
Example
{
  "caseId": "abc123",
  "status": "IN_PROGRESS",
  "message": "abc123",
  "filesCount": 123,
  "processedCount": 123,
  "createdAt": "abc123",
  "updatedAt": "xyz789"
}

CreateCaseOutput

Fields
Field Name Description
caseId - String!
signedUrl - [String!]!
exportId - String
sourceFiles - [SourceFile!]
Example
{
  "caseId": "abc123",
  "signedUrl": ["xyz789"],
  "exportId": "abc123",
  "sourceFiles": [SourceFile]
}

CreateExportOutput

Fields
Field Name Description
exportId - String!
status - String!
Example
{
  "exportId": "xyz789",
  "status": "abc123"
}

DemographicsInput

Fields
Input Field Description
patientName - String Patient name (sets the primary patient name for the case)
injuryBodyParts - [String!] Injured body parts
injuryDescription - [String!] Description of injury
dateOfInjury - [String!] Date of injury
insurance - [String!] Insurance provider
employer - [String!] Employer name
occupation - [String!] Patient occupation
dob - [String!] Date of birth
claimNumber - [String!] Claim number
adjNumber - [String!] Adjuster number
customDemographics - RecordTypeMap Custom demographic fields (key-value pairs)
accidentMateCustomInfo - RecordTypeMap AccidentMate custom fields (e.g., accidentMatePatientId)
Example
{
  "patientName": "xyz789",
  "injuryBodyParts": ["abc123"],
  "injuryDescription": ["abc123"],
  "dateOfInjury": ["abc123"],
  "insurance": ["xyz789"],
  "employer": ["abc123"],
  "occupation": ["abc123"],
  "dob": ["xyz789"],
  "claimNumber": ["xyz789"],
  "adjNumber": ["abc123"],
  "customDemographics": RecordTypeMap,
  "accidentMateCustomInfo": RecordTypeMap
}

DuplicatePage

Description

Information about a duplicate page

Fields
Field Name Description
pageNumber - Int! Page number in this file that is a duplicate
fromFileId - String! File ID of the original file containing the duplicate
fromPageNumber - Int! Page number in the original file
Example
{
  "pageNumber": 123,
  "fromFileId": "xyz789",
  "fromPageNumber": 987
}

ExportConfig

Description

Export configuration details

Fields
Field Name Description
exportType - ExportType!
filter - FilterCriteria
grouping - GroupCriteria
sorting - SortCriteria
appendCharts - Boolean If true, append extracted charts to the export
appendMediStamps - Boolean If true, append MediStamps to PDF exports (PDF exports only)
includeDeclarationAttestation - Boolean If true, include Declaration & Attestation in export
summaryPageNumberOrientation - PageNumberOrientation Summary page number orientation configuration (PDF exports only)
appendedSourcePageNumberOrientation - PageNumberOrientation Appended source files page number orientation configuration (PDF exports only)
Example
{
  "exportType": "docx",
  "filter": FilterCriteria,
  "grouping": GroupCriteria,
  "sorting": SortCriteria,
  "appendCharts": true,
  "appendMediStamps": true,
  "includeDeclarationAttestation": true,
  "summaryPageNumberOrientation": PageNumberOrientation,
  "appendedSourcePageNumberOrientation": PageNumberOrientation
}

ExportConfigInput

Fields
Input Field Description
exportType - ExportType! Export format type
presetOverride - String Non-local preset ID returned by getPresets for the API key's team. Applies to this export only; does not change user defaults or case presets. Omit or pass null to preserve existing behavior: use the case's preset for the API user when present, otherwise that user's default for their current team. Existing AccidentMate preset assignment and selection are unchanged when omitted. Explicit grouping and sorting take precedence over the selected preset.
arrangeByRecordOrder - Boolean If true, arrange export by record order
appendCharts - Boolean If true, append extracted charts to the export
appendMediStamps - Boolean If true, append MediStamps to PDF exports (PDF exports only)
includeDeclarationAttestation - Boolean If true, include Declaration & Attestation in export
summaryPageNumberOrientation - PageNumberOrientationInput Summary page number orientation configuration (PDF exports only)
appendedSourcePageNumberOrientation - PageNumberOrientationInput Appended source files page number orientation configuration (PDF exports only)
filter - FilterCriteriaInput Filter criteria for the export. If not provided, all records are included.
grouping - GroupCriteriaInput Group criteria for the export. Overrides preset grouping when provided; otherwise uses preset grouping if available.
sorting - SortCriteriaInput Sort criteria for the export. Overrides preset sorting when provided; otherwise uses preset sorting or the default chronological order.
Example
{
  "exportType": "docx",
  "presetOverride": "abc123",
  "arrangeByRecordOrder": true,
  "appendCharts": true,
  "appendMediStamps": true,
  "includeDeclarationAttestation": true,
  "summaryPageNumberOrientation": PageNumberOrientationInput,
  "appendedSourcePageNumberOrientation": PageNumberOrientationInput,
  "filter": FilterCriteriaInput,
  "grouping": GroupCriteriaInput,
  "sorting": SortCriteriaInput
}

ExportFile

Description

Downloadable export file

Fields
Field Name Description
signedUrl - String! Signed URL to download the file
filename - String! Filename for download
mimeType - String! MIME type of the file
fileType - FileType! Type of file - matches export type for main files, or 'dupes_only' for duplicates-only file (only present for pdf_without_dupes exports)
createdAt - String! ISO 8601 timestamp when the export file was created
Example
{
  "signedUrl": "xyz789",
  "filename": "abc123",
  "mimeType": "abc123",
  "fileType": "docx",
  "createdAt": "xyz789"
}

ExportOutput

Description

Export output with files and configuration

Fields
Field Name Description
id - String! Unique export identifier
files - [ExportFile!]! List of downloadable export files
createdTime - String! ISO 8601 timestamp when export was created
exportConfig - ExportConfig! Export configuration used for this export
Example
{
  "id": "xyz789",
  "files": [ExportFile],
  "createdTime": "xyz789",
  "exportConfig": ExportConfig
}

ExportType

Description

Export format type

Values
Enum Value Description

docx

Word document

docx_with_hyper

Word document with hyperlinks to source pages

pdf_without_dupes

PDF excluding duplicate pages

pdf_with_dupes

PDF including all pages

pdf_without_excluded

PDF excluding duplicate pages, blank pages, and manually excluded pages
Example
"docx"

FileType

Description

File type for export files

Values
Enum Value Description

docx

Word document

docx_with_hyper

Word document with hyperlinks to source pages

pdf_without_dupes

PDF excluding duplicate pages

pdf_with_dupes

PDF including all pages

pdf_without_excluded

PDF excluding duplicate pages, blank pages, and manually excluded pages

dupes_only

Duplicates-only PDF file (only present for pdf_without_dupes exports)

excluded_only

Excluded pages-only PDF file (only present for pdf_without_excluded exports)
Example
"docx"

FilterCriteria

Fields
Field Name Description
tableOfContentsOnly - Boolean
showHiddenSummaries - Boolean
includeRecordTypes - RecordTypeMap
includeAuthors - [String!]
includeFacilities - [String!]
includeSpecialties - [String!]
fileDateFilter - [UtcDateRange!] Restrict export to summaries whose source file upload falls in these UTC ranges (ISO8601 start/end per range)
selectedFlaggedTypes - [String!] Flagged record filter, e.g. illegible, duplicate-pages, or all
selectedExcludedTypes - [String!] Which excluded-record categories to include, e.g. duplicate, excluded-by-user, all
Example
{
  "tableOfContentsOnly": false,
  "showHiddenSummaries": false,
  "includeRecordTypes": RecordTypeMap,
  "includeAuthors": ["abc123"],
  "includeFacilities": ["xyz789"],
  "includeSpecialties": ["abc123"],
  "fileDateFilter": [UtcDateRange],
  "selectedFlaggedTypes": ["abc123"],
  "selectedExcludedTypes": ["xyz789"]
}

FilterCriteriaInput

Fields
Input Field Description
tableOfContentsOnly - Boolean If true, only include table of contents in export
showHiddenSummaries - Boolean If true, include hidden summaries in export
includeRecordTypes - RecordTypeMap

Filter by record types. Map of record type groups to specific fields. Record type groups: 'COMPREHENSIVE', 'GENERAL', 'DIAGNOSTIC', 'OPERATIVES', 'DEPOSITION', 'LABS', 'NON_MEDICAL'

Available fields by record type:

  • COMPREHENSIVE: historyOfPresentIllness, complaints, diagnoses, treatmentHistory, futureTreatmentPlan, jobDescription, workHistory, socialHistory, discussionOfResults, causation, permanentAndStationaryStatus, impairment, apportionment, workStatus
  • GENERAL: historyOfPresentIllness, complaints, diagnoses, treatmentPlans, labs, vitalSigns, psychDiagnoses, psychTreatments, psychSymptoms, workHistory, workStatus
  • DIAGNOSTIC: findings, impression
  • OPERATIVES: diagnoses, procedure
  • DEPOSITION: (not filterable)
  • LABS: (not filterable)
  • NON_MEDICAL: (not filterable)

Example: { "COMPREHENSIVE": ["diagnoses", "treatmentHistory"], "DIAGNOSTIC": ["findings"] }

includeAuthors - [String!] Filter by author names. Values vary depending on the medical records in the case. Example: ['Dr. Smith', 'Dr. Johnson']
includeFacilities - [String!] Filter by facility names. Values vary depending on the medical records in the case. Example: ['General Hospital', 'City Medical Center']
includeSpecialties - [String!] Filter by medical specialties. Values vary depending on the medical records in the case. Example: ['Orthopaedics', 'Internal Medicine', 'Psychiatry']
fileDateFilter - [UtcDateRangeInput!] Restrict export to summaries whose source file upload falls in these UTC ranges
selectedFlaggedTypes - [String!]
selectedExcludedTypes - [String!]
Example
{
  "tableOfContentsOnly": false,
  "showHiddenSummaries": false,
  "includeRecordTypes": RecordTypeMap,
  "includeAuthors": ["xyz789"],
  "includeFacilities": ["xyz789"],
  "includeSpecialties": ["xyz789"],
  "fileDateFilter": [UtcDateRangeInput],
  "selectedFlaggedTypes": ["xyz789"],
  "selectedExcludedTypes": ["abc123"]
}

GroupCriteria

Fields
Field Name Description
author - Boolean
recordTypeGroup - Boolean
facilityName - Boolean
specialty - Boolean
fileUploadDate - Boolean Group by file upload date when true
includeGroupSummary - Boolean
Example
{
  "author": true,
  "recordTypeGroup": false,
  "facilityName": false,
  "specialty": true,
  "fileUploadDate": false,
  "includeGroupSummary": false
}

GroupCriteriaInput

Fields
Input Field Description
author - Boolean
recordTypeGroup - Boolean
facilityName - Boolean
specialty - Boolean
fileUploadDate - Boolean
includeGroupSummary - Boolean
Example
{
  "author": false,
  "recordTypeGroup": false,
  "facilityName": true,
  "specialty": true,
  "fileUploadDate": true,
  "includeGroupSummary": true
}

Int

Description

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Example
987

PageNumberFormat

Values
Enum Value Description

arabic

Arabic numerals (1, 2, 3, ...)

roman

Roman numerals (I, II, III, ...)
Example
"arabic"

PageNumberLocation

Values
Enum Value Description

top_left

Top left corner

top_right

Top right corner

bottom_left

Bottom left corner

bottom_right

Bottom right corner
Example
"top_left"

PageNumberOrientation

Description

Page number orientation configuration

Fields
Field Name Description
location - PageNumberLocation Location of page numbers on the page
prefix - String Prefix text before page number, e.g., 'Page '
color - String Color of page numbers - hex color code, e.g., '#000000'
format - PageNumberFormat Format of numerals
numberOfDigits - Int Number of digits for padding, e.g., 6 for '000001'
Example
{
  "location": "top_left",
  "prefix": "abc123",
  "color": "abc123",
  "format": "arabic",
  "numberOfDigits": 123
}

PageNumberOrientationInput

Description

Page number orientation input configuration

Fields
Input Field Description
location - PageNumberLocation Location of page numbers on the page
prefix - String Prefix text before page number, e.g., 'Page '
color - String Color of page numbers - hex color code, e.g., '#000000'
format - PageNumberFormat Format of numerals
numberOfDigits - Int Number of digits for padding, e.g., 6 for '000001'
Example
{
  "location": "top_left",
  "prefix": "abc123",
  "color": "xyz789",
  "format": "arabic",
  "numberOfDigits": 987
}

Preset

Description

A team preset available for public API exports

Fields
Field Name Description
id - String! Preset identifier; pass this as ExportConfigInput.presetOverride
title - String! Human-readable preset name
usedBy - [PresetUser!]! Users with this preset selected as their default for this team; not export history
Example
{
  "id": "xyz789",
  "title": "abc123",
  "usedBy": [PresetUser]
}

PresetUser

Description

A team user who has a preset selected as their default

Fields
Field Name Description
id - String! User identifier
name - String! User's full name
email - String! User's email address
Example
{
  "id": "abc123",
  "name": "xyz789",
  "email": "abc123"
}

RecordTypeMap

Description

Maps record type categories to an array of specific record types. Example: { "Lab Results": ["Blood Work", "Urinalysis"], "Imaging": ["X-Ray", "MRI"] }

Example
RecordTypeMap

SortCriteria

Fields
Field Name Description
primary - SortField
secondary - SortField
tertiary - SortField
Example
{
  "primary": SortField,
  "secondary": SortField,
  "tertiary": SortField
}

SortCriteriaInput

Fields
Input Field Description
primary - SortFieldInput
secondary - SortFieldInput
tertiary - SortFieldInput
Example
{
  "primary": SortFieldInput,
  "secondary": SortFieldInput,
  "tertiary": SortFieldInput
}

SortField

Fields
Field Name Description
field - String!
order - String!
weight - Int
Example
{
  "field": "abc123",
  "order": "xyz789",
  "weight": 123
}

SortFieldInput

Fields
Input Field Description
field - String!
order - String!
weight - Int
Example
{
  "field": "abc123",
  "order": "xyz789",
  "weight": 987
}

SourceFile

Description

Source file metadata

Fields
Field Name Description
id - String! File identifier
filename - String! Original filename
filetype - String! File MIME type
pageCount - Int Number of pages in the file
duplicatePages - [DuplicatePage!] Pages identified as duplicates of other pages
createdAt - String ISO 8601 timestamp when the file was uploaded
modifiedAt - String ISO 8601 timestamp when the file was last modified
Example
{
  "id": "abc123",
  "filename": "xyz789",
  "filetype": "abc123",
  "pageCount": 987,
  "duplicatePages": [DuplicatePage],
  "createdAt": "abc123",
  "modifiedAt": "xyz789"
}

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example
"abc123"

UpdateCaseOutput

Fields
Field Name Description
caseId - String!
signedUrl - [String!]
success - Boolean!
message - String
sourceFiles - [SourceFile!]
Example
{
  "caseId": "abc123",
  "signedUrl": ["abc123"],
  "success": false,
  "message": "xyz789",
  "sourceFiles": [SourceFile]
}

User

Description

User information

Fields
Field Name Description
id - String! User identifier
name - String! User's full name
email - String! User's email address
role - String! User's role in the team
Example
{
  "id": "abc123",
  "name": "xyz789",
  "email": "xyz789",
  "role": "abc123"
}

UtcDateRange

Description

Inclusive UTC time range (output shape for filters).

Fields
Field Name Description
start - String!
end - String!
Example
{
  "start": "abc123",
  "end": "abc123"
}

UtcDateRangeInput

Description

Inclusive UTC time range for filtering (e.g. file upload dates). Use ISO8601 strings.

Fields
Input Field Description
start - String!
end - String!
Example
{
  "start": "xyz789",
  "end": "xyz789"
}