Skip to content
Authenticity

Assess Writing in Documents

The Copyleaks Writing Assistant API is a powerful tool to help improve the quality of written content by providing detailed feedback on grammar, spelling, sentence structure, and word choice.

This guide will walk you through the process of submitting documents for writing assessment and retrieving the detailed feedback.

  1. Before you start, ensure you have the following:

  2. Choose your preferred method for making API calls.

    You can interact with the API using any standard HTTP client.

    For a quicker setup, we provide a Postman collection. See our Postman guide for instructions.

  3. To perform a scan, we first need to generate an access token. For that, we will use the login endpoint. The API key can be found on the Copyleaks API Dashboard.

    Upon successful authentication, you will receive a token that must be attached to subsequent API calls via the Authorization: Bearer <TOKEN> header. This token remains valid for 48 hours.

    POST https://id.copyleaks.com/v3/account/login/api
    Headers
    Content-Type: application/json
    Body
    {
    "email": "[email protected]",
    "key": "00000000-0000-0000-0000-000000000000"
    }

    Response

    {
    "access_token": "<ACCESS_TOKEN>",
    ".issued": "2025-07-31T10:19:40.0690015Z",
    ".expires": "2025-08-02T10:19:40.0690016Z"
    }
  4. For this guide, we’ll demonstrate document submission for writing assessment. Each submission requires a unique scanId for proper tracking and identification.

    PUT https://api.copyleaks.com/v3/scans/submit/file/my-writing-assessment-scan
    Content-Type: application/json
    Authorization: Bearer YOUR_LOGIN_TOKEN
    {
    "base64": "SGVsbG8gd29ybGQuIFRoaXMgaXMgYW4gZXhhbXBsZSB0ZXh0IHRvIGJlIGNoZWNrZWQgZm9yIGdyYW1tYXIgZXJyb3JzLg==",
    "filename": "my-document.txt",
    "properties": {
    "sandbox": true,
    "webhooks": {
    "status": "https://your.server/webhook/{STATUS}"
    },
    "writingFeedback": {
    "enable": true
    }
    }
    }
  5. Once the scan is complete, Copyleaks will send a completed webhook to the status URL you provided.

    When writing assistant is enabled, the webhook response will include a writingFeedback section with detailed information about the writing quality.

  6. The completed webhook contains a writingFeedback object with the Correction Types:

    1. textStatistics: Basic metrics about the text, including sentence count, average word and sentence length, and estimated reading time.

    2. score: Detailed breakdown of writing quality across four categories:

      • Grammar
      • Mechanics (spelling, punctuation)
      • Sentence Structure
      • Word Choice

      Each category includes both a count of corrections and a score (0-100).

    3. readability: An assessment of how easy the text is to read, including:

      • Overall readability score (0-100)
      • Readability level (grade level)
      • Text description of the readability
  7. To get the specific writing corrections, you need to export the detailed results using the export endpoint:

    POST https://api.copyleaks.com/v3/downloads/my-writing-assessment-scan/export/my-export-1
    Content-Type: application/json
    Authorization: Bearer YOUR_LOGIN_TOKEN
    {
    "writingFeedback": {
    "corrections": true,
    "verb": "POST",
    "headers": [
    ["Content-Type", "application/json"]
    ],
    "endpoint": "https://your.server/export/writing-feedback"
    },
    "completionWebhook": "https://your.server/webhook/export/completion",
    "maxRetries": 3,
    "developerPayload": "writing-assessment-export"
    }
  8. You have successfully submitted a document for writing assessment and exported the detailed correction recommendations. You can now integrate these corrections into your application, display them to users, or use them to improve the document’s quality.