Skip to main content

Proofread File API

This guide helps you easily integrate the Trinka Proofread File API into your applications to automatically edit an entire document and get a track-changed document as an output.

Use Cases

Here are some of the things that Proofread File API can do for you:

  • Find and fix grammar mistakes in an entire document
  • Process Word and LaTeX files
  • Return a language quality score for your documents
  • Recommend human editing services based on the language quality score

How to Get Started

  1. Get an API key - You'll need an API key to identify your account and track usage. Generate a test key for development or a production key for live use by visiting https://developer.trinka.ai/landing/apikeys

  2. Send an API request - Send an HTTPs request to Trinka for checking your document. Note that the API uses RESTful architecture, and the input/output is in JSON format. Standard HTTP response codes, authentication, and verbs are used. The content-type of both request and response must be application/json.

  3. Get the results - You will be able to download the edited file as well as get statistics about the edited document, such as the language quality score and the number of alerts in each grammar category.

  4. Handle errors - Trinka uses standard codes to indicate success or problems. Refer to the appendix for more details.

API Request-Response

Please follow the given steps to upload and process a document.

Endpoint:

POST https://api-platform.trinka.ai/autoedit/v3/document/create

Example CURL Request:

curl --location --request POST \
'https://api-platform.trinka.ai/autoedit/v3/document/create' \
--header 'x-api-key: <<your key>>'

Output:

{
"status": true,
"message": "success",
"data": "https://b2bapi.trinka.ai/autoedit/v2/submission/{uuid}",
"service_type": null
}

In the response of the Create Token API, the data field contains a unique document upload URL valid for 30 seconds. You need to use this URL in the File Submission API described below.

Step 2: Upload a Document (Submit File API):

This endpoint allows uploading Microsoft Word documents using the URL obtained from the Create Token endpoint. It returns an "id" parameter that is used to track the status of the submission and to download the processed file.

Endpoint:

POST https://b2bapi.trinka.ai/autoedit/v2/submission/{uuid}

Input Parameters for the Submit File API

The following parameters can be included in the form data:

ParameterTypeRequiredValuesNotes
filefilemandatoryvariousSelect a doc/docx file
languagestringoptionalUS, UKChoose between American English (US) or British English (UK). Default is American English (US).
doc_typeintegermandatory2, 3Choose 2 for "general writing" and 3 for "academic writing". Default doc_type is 3.
pipelinestringmandatorybasic, advancedChoose basic for making only corrections, and advanced for moderately extensive changes. Default pipeline is "advanced".
correctnessbooleanoptionaltrue, falseChoose whether to insert correctness alerts. Default: true
spellingsbooleanoptionaltrue, falseChoose whether to insert spelling alerts. Default: true
Claritybooleanoptionaltrue, falseChoose whether to insert Clarity alerts. Default: true
Fluencybooleanoptionaltrue, falseChoose whether to insert Fluency alerts. Default: true
Stylebooleanoptionaltrue, falseChoose whether to insert writing Style alerts. Default: true
style_guidestringoptionalAPA, ACS, AMA, IEEE, AGUStyle guide options for retail customers. Please contact our sales team for details on how to get your style guide added as an option.
statistics_in_documentbooleanoptionaltrue, falseInclude back cover with statistics around the different revisions made in the document along with document score. Default is false.
revisions_as_tracksbooleanoptionaltrue, falseApply revisions in the document and make it available in track changes. Default is true.
revisions_as_commentsbooleanoptionaltrue, falseApply revisions in the document as comments. Default is false.
authorstringoptionalvariousAnnotation name for track changes. Default is 'Trinka'.
inclusive_langbooleanoptionaltrue, falseThis field will be made active later on to allow users to add inclusive language alerts to their files.

Example CURL Request:

curl --location \
'https://b2bapi.trinka.ai/autoedit/v2/submission/<uuid>' \
--header 'x-api-key: <<your x-api key>>' \
--form 'file=@"/path/to/your/document.docx"' \
--form 'language="US"' \
--form 'doc_type="3"' \
--form 'pipeline="basic"' \
--form 'correctness="true"' \
--form 'spellings="false"' \
--form 'Clarity="false"' \
--form 'Fluency="false"' \
--form 'Style="false"' \
--form 'statistics_in_document="false"' \
--form 'revisions_as_tracks="true"' \
--form 'revisions_as_comments="false"' \
--form 'writing_advisor_as_comments="false"' \
--form 'inclusive_lang="false"' \
--form 'author="Author"'

Output:

{
"status": true,
"message": "success",
"data": {
"id": "a1036415-0549-44b0-b550-58b5481c4c5b",
"filename": "document",
"status": "WAITING_IN_QUEUE",
"message": null,
"credits": 1,
"words": 1093,
"language": "US",
"parentExtension": "docx",
"deleted": false,
"error_id": -1,
"error_report": null,
"scoring_report": {},
"category_mapping": {},
"statistics_in_document": false,
"writing_advisor_as_comments": false,
"revisions_as_tracks": true,
"revisions_as_comments": false,
"inclusive_lang": false,
"created_on": 1752145755784,
"modified_on": 1752145755784,
"style_guide": "NONE",
"process_start_time": null,
"process_end_time": null,
"word_count": 1093,
"word_limit": 0,
"readonly": false,
"pipeline": "basic",
"editing_mode": "Lite",
"lang_code": "en",
"scoring_version": "v1"
},
"service_type": null
}

Step 3: Get Document Status (Document Status API)

Endpoint:

GET https://api-platform.trinka.ai/autoedit/v3/document/{id}

Example CURL Request:

curl --location \
'https://api-platform.trinka.ai/autoedit/v3/document/<id>' \
--header 'x-api-key: <<your key>>'

Output:

Note that for brevity, we have shown only a small number of the available categories in the error_report and category_mapping fields. The complete list of available categories is given in Appendix 2.

{
"status": true,
"message": "success",
"data": {
"id": "a1036415-0549-44b0-b550-58b5481c4c5b",
"filename": "document",
"status": "SUCCESS",
"message": null,
"credits": 1,
"words": 1093,
"language": "US",
"parentExtension": "docx",
"deleted": false,
"error_id": -1,
"error_report": {
"style_guide": 0,
"pronoun_and_determiner": 0,
"complexity": 0,
"----------": 10,
"----------": 10,
"other": 43,
"categories": {
"R:VERB:WC R:PREP:WC": 1,
"M:ADJ": 1,
"R:DET->ADJ U:ADP": 1
},
"ce_label": -1,
"language_score": 48,
"total_corrections": 81,
"total_suggestions": 0,
"total_sentences": 94
},
"scoring_report": {
"ce_label": -1,
"total_score": 60,
"total_count": 81,
"correctness_count": 73,
"correctness_score": 22,
"clarity_count": 2,
"clarity_score": 97.87234042553192,
"fluency_count": 2,
"fluency_score": 97.87234042553192,
"style_count": 4,
"style_score": 95.74468085106383,
"style_guide_complaince_count": 0,
"style_guide_complaince_score": 100.0,
"inclusive_language_score": 100,
"inclusive_language_count": 0,
"total_corrections": 81,
"total_suggestions": 0,
"total_sentences": 94
},
"category_mapping": {
"Correctness": [
{
"id": 1,
"category": "Correctness",
"sub_category": "Grammar",
"lang_category": "Articles",
"critical_error": false,
"count": 16
},
{
"id": 1,
"category": "Correctness",
"sub_category": "Syntax & Vocabulary",
"lang_category": "Syntax",
"critical_error": false,
"count": 9
}
],
"Clarity": [
{
"id": 3,
"category": "Clarity",
"sub_category": "",
"lang_category": "Brevity",
"critical_error": false,
"count": 2
},
{
"id": 3,
"category": "Clarity",
"sub_category": "",
"lang_category": "Vague Words/Phrases",
"critical_error": false,
"count": 0
}
],
"Fluency": [
{
"id": 3,
"category": "Fluency",
"sub_category": "",
"lang_category": "Plain Language",
"critical_error": false,
"count": 2
},
{
"id": 3,
"category": "Fluency",
"sub_category": "",
"lang_category": "Redundancy",
"critical_error": false,
"count": 0
}
],
"Style": [
{
"id": 4,
"category": "Style",
"sub_category": "",
"lang_category": "Regional Style",
"critical_error": false,
"count": 3
}
],
"Inclusivity": [
{
"id": 6,
"category": "Inclusivity",
"sub_category": "",
"lang_category": "Nationality Bias",
"critical_error": false,
"count": 0
}
],
"Style Guide Compliance": [
{
"id": 5,
"category": "Style Guide Compliance",
"sub_category": "",
"lang_category": "Style guide-NONE",
"critical_error": false,
"count": 0
}
]
},
"statistics_in_document": false,
"writing_advisor_as_comments": false,
"revisions_as_tracks": true,
"revisions_as_comments": false,
"inclusive_lang": false,
"created_on": 1752145755784,
"modified_on": 1752145756796,
"style_guide": "NONE",
"process_start_time": 1752145755866,
"process_end_time": 1752145756732,
"word_count": 1093,
"word_limit": 0,
"readonly": false,
"pipeline": "advanced",
"editing_mode": "Power",
"lang_code": "en",
"scoring_version": "v3"
},
"service_type": null
}

Response Parameters:

ParameterTypeValuesNotes
iduuidvariousUnique document id generated at the time of document submission
filenamestringvariousName of the submitted file
statusstringWAITING_IN_QUEUE, IN_PROGRESS, SUCCESS, FAILEDWAITING_IN_QUEUE: added to queue
IN_PROGRESS: under processing
SUCCESS: File processed successfully
FAILED: Failed to process the file
messagestringVariousDetails of status as required. For example, Word limit per file restriction, File corrupted, etc.
wordsintegerVariousThe total number of words detected in the submitted document
languagestringUS, UKAmerican English (US) or British English (UK)
scoring_reportobjectVariousVarious scores and counts including total score, correctness score, and revision statistics

Step 4: Download Processed File

This endpoint provides the download URL for the processed file with proofreading corrections.

Endpoint:

GET https://api-platform.trinka.ai/autoedit/v3/document/{document_id}/final

Example CURL Request:

curl --location \
'https://api-platform.trinka.ai/autoedit/v3/document/<document_id>/final' \
--header 'x-api-key: <<your api key>>'

Output:

{
"status": true,
"message": "success",
"data": "https://autoedit.trinka.ai/download/6eb98551-8a00-4848-8d9d-d80c30e53c5b",
"service_type": null
}

In the response of the Download File API, the data field contains the URL for downloading the processed file. If you upload a docx file, the processed file will be a docx file containing Track Changes with all proofreading corrections and suggestions.

Appendix 1: Trinka API Response Codes

Response CodeExplanation
200 - OKEverything worked as expected.
400 - Bad requestThe request was unacceptable, often due to missing a required parameter or file format not acceptable.
401 - UnauthorizedNo valid API key provided.
403 - ForbiddenThe API key doesn't have permissions to perform the request.
404 - Not foundThe requested resource doesn't exist
500 - Server errorTrinka server issue

Appendix 2: Trinka Language Categories

CategorySub-categoryLanguage Category
CorrectnessGrammarAdjectives/Adverbs
GrammarArticles
GrammarConjunctions
GrammarPrepositions
GrammarPronouns & Determiners
GrammarSingular-Plural Nouns
GrammarSubject-Verb Agreement
GrammarTense
GrammarVerbs
GrammarWord Form
SpellingSpellings & Typos
PunctuationPunctuation
Syntax & VocabularySyntax
Syntax & VocabularyOther Errors
Syntax & VocabularyAccurate Phrasing
ClarityWord Order
Word Choice
Brevity
Vague Words/Phrases
Hedge Words
Idioms/Cliches
FluencyRedundancy
Noun Stacks
Plain Language
Enhancement
Active/Passive Voice
StyleCapitalization & Spacing
Number Style
Symbols/Notations
Regional Style
Contractions
Formal Word/Phrase Choice
Other Style
Consistency
Style Guide ComplianceStyle Guide – APA, AMA, APA, IEEE, AGU

Appendix 3: Change Log

Version 1.1 – July 2025

This appendix lists the key updates made to the Proofread File API documentation from version 1.0 to 1.1.

Endpoint & Parameter Changes

  • Pipeline values renamed:
    • panini1 → advanced
    • eagles → basic
  • New required parameter added:
    • doc_type: 2 = General writing, 3 = Academic writing
  • New optional parameters added for more granular control:
    • correctness (boolean)
    • Clarity (boolean)
    • Fluency (boolean)
    • Style (boolean)
  • Deprecated or replaced parameters:
    • grammar and enhancement from v1.0 are now split into category-specific flags above

Response Structure Enhancements

  • Expanded scoring and category-level feedback:
    • New scoring_report fields: clarity_score, fluency_score, style_score, inclusive_language_score, etc.
    • Added category_mapping with detailed breakdowns under: Correctness, Clarity, Fluency, Style, Style Guide Compliance, and Inclusivity
  • New metadata in response:
    • editing_mode: e.g., "Lite", "Power"
    • scoring_version: e.g., "v1", "v3"

Documentation & Structure

  • New Appendix Added:
    • Appendix 2: Trinka Language Categories – lists grammar and style categories used in reports
  • Improved consistency:
    • All example requests updated to reflect new parameters and expected defaults

Summary

Change Areav1.0v1.1
Pipeline optionspanini1, eaglesbasic, advanced
New parametersdoc_type, Clarity, Style, etc.
Category feedbackBasic scoring onlyDetailed scoring + category breakdowns
MetadataMinimalIncludes editing_mode, scoring_version
Documentation1 appendix2 appendices + changelog added