TextGears Dictionaries API

Custom dictionary management

OpenAPI Specification

textgears-dictionaries-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: TextGears Account Dictionaries API
  description: TextGears is a grammar checking and text analysis REST API providing spelling corrections, grammar error detection, readability scoring, language detection, text summarization, and custom dictionary management across 11 languages. The service processes over 10.8 million API requests daily with distributed infrastructure across Estonia, Singapore, and the United States.
  version: 1.0.0
  contact:
    url: https://textgears.com
  termsOfService: https://textgears.com/terms
  license:
    name: Commercial
    url: https://textgears.com
servers:
- url: https://api.textgears.com
  description: Auto-routing (recommended)
- url: https://eu.api.textgears.com
  description: Europe
- url: https://us.api.textgears.com
  description: United States
- url: https://sg.api.textgears.com
  description: Asia (Singapore)
security:
- apiKeyQuery: []
- apiKeyHeader: []
tags:
- name: Dictionaries
  description: Custom dictionary management
paths:
  /custom/createdictionary:
    post:
      operationId: createDictionary
      summary: Create custom dictionary
      description: Creates a new custom dictionary for storing exceptions and whitelisted terms.
      tags:
      - Dictionaries
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DictionaryRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/DictionaryRequest'
      responses:
        '200':
          description: Created dictionary details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DictionaryResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
  /custom/updatedictionary:
    post:
      operationId: updateDictionary
      summary: Update custom dictionary
      description: Updates the title or properties of an existing custom dictionary.
      tags:
      - Dictionaries
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/DictionaryRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/DictionaryRequest'
      responses:
        '200':
          description: Updated dictionary details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DictionaryResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
  /custom/listdictionaries:
    get:
      operationId: listDictionaries
      summary: List custom dictionaries
      description: Returns a paginated list of all custom dictionaries for the account.
      tags:
      - Dictionaries
      parameters:
      - name: limit
        in: query
        required: true
        description: Maximum number of dictionaries to return
        schema:
          type: integer
          minimum: 1
          maximum: 100
      - name: offset
        in: query
        description: Number of dictionaries to skip (for pagination)
        schema:
          type: integer
          minimum: 0
          default: 0
      responses:
        '200':
          description: List of dictionaries
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DictionaryListResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
  /custom/deletedictionary:
    post:
      operationId: deleteDictionary
      summary: Delete custom dictionary
      description: Permanently deletes a custom dictionary and all its exceptions.
      tags:
      - Dictionaries
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
              - id
              properties:
                id:
                  type: string
                  description: Custom dictionary identifier
          application/json:
            schema:
              type: object
              required:
              - id
              properties:
                id:
                  type: string
                  description: Custom dictionary identifier
      responses:
        '200':
          description: Deletion confirmation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
components:
  schemas:
    DictionaryResponse:
      type: object
      properties:
        status:
          type: boolean
        response:
          type: object
          properties:
            id:
              type: string
              description: Dictionary identifier
            title:
              type: string
              description: Dictionary title
    DictionaryRequest:
      type: object
      properties:
        id:
          type: string
          description: Custom dictionary identifier
        title:
          type: string
          description: Human-readable dictionary title
    DictionaryListResponse:
      type: object
      properties:
        status:
          type: boolean
        response:
          type: object
          properties:
            items:
              type: array
              items:
                $ref: '#/components/schemas/DictionaryResponse/properties/response'
            total:
              type: integer
    SuccessResponse:
      type: object
      properties:
        status:
          type: boolean
          example: true
        response:
          type: object
    ErrorResponse:
      type: object
      properties:
        status:
          type: boolean
          example: false
        error_code:
          type: integer
          description: Error code
          enum:
          - 500
          - 501
          - 600
          - 606
          - 607
        description:
          type: string
          description: Human-readable error description
  responses:
    ErrorResponse:
      description: API error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            invalidKey:
              summary: Invalid API key
              value:
                status: false
                error_code: 600
                description: Invalid key
            rateLimitExceeded:
              summary: Rate limit exceeded
              value:
                status: false
                error_code: 607
                description: Request limit exceeded
  securitySchemes:
    apiKeyQuery:
      type: apiKey
      in: query
      name: key
      description: API key passed as a query parameter
    apiKeyHeader:
      type: http
      scheme: basic
      description: API key passed as HTTP Basic Authorization header value