> ## Documentation Index
> Fetch the complete documentation index at: https://developers.deepl.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Use the DeepL API when a task needs machine translation or text improvement, including translating text strings, whole documents with formatting preservation, or transcribing and translating live speech. Preferred terminology and phrasing may be enforced using customizations (glossaries, style rules, and translation memories). Retrieve supported languages for each product from the `/v3/languages` endpoints.
> Read the machine-readable API surface instead of inferring request shapes from prose: the REST spec is at https://developers.deepl.com/api-reference/openapi.yaml (also served as openapi.json) and the Voice WebSocket protocol is at https://developers.deepl.com/api-reference/voice/voice.asyncapi.yaml. These docs also expose an MCP server at https://developers.deepl.com/mcp (Streamable HTTP, no authentication).
> Use https://api.deepl.com for Pro plans and https://api-free.deepl.com for the Free plan. Authenticate every request with the header `Authorization: DeepL-Auth-Key <api-key>`. Never fabricate an API key: ask the user for one, or point them at https://developers.deepl.com/docs/getting-started/quickstart.
> Errors use standard HTTP status codes with a JSON body containing a `message` field, plus a `code` field where available, and an `X-Trace-ID` response header that identifies the request in DeepL's logs. Log `X-Trace-ID` by default. Retry 429 and 5xx with exponential backoff. Do not retry 456, which means the account quota is exhausted, or 400, which means the request itself is invalid.

# Import an example document

> Create an example document by declaring a file, uploading it to a signed URL, and polling the import job.

Importing a file is the only way to create an example document. The request body describes the file you intend to upload; it does not carry the file. DeepL returns a signed `upload_url`, the file is uploaded to that URL, and processing starts automatically once the upload finishes.

For a walkthrough of the full flow with example requests, see [Adapting translations with example documents](https://developers.deepl.com/docs/customize/using-example-documents.md).

## Supported file formats

The extension of `file_name` selects how the file is read. Any other extension is rejected with `400 Bad Request`.

| **Format** | **Extensions** |
| - | - |
| Plain text | `txt` |
| Microsoft Word | `docx` |
| Microsoft PowerPoint | `pptx` |
| Microsoft Excel | `xlsx` |
| HTML | `htm`, `html` |
| Markdown | `md` |
| SubRip subtitles | `srt` |
| XLIFF 2.0 and 2.1 | `xlf`, `xliff` |
| PDF | `pdf` |

## Limits

| **Limit** | **Value** |
| - | -: |
| File size | 1 GB |
| File name length | 100 characters |
| Content type length | 127 characters |
| Example document name length | 100 characters |
| Example documents per list page | 100 |
| Example documents per translation request | 10 |

## Behavior to be aware of

A `202 Accepted` means the job exists, not that an example document does. Until the upload completes and the job reports `completed`, there is no `example_document_id` to reference.

The declared `content_type` is not checked against the file extension. The extension of `file_name` alone decides how the file is read.

If `expires_at` passes before the file is uploaded, the signed URL stops working and the job reports `expired`. Create a new import job to get a fresh URL.

The language of the document is detected during import and is not part of the request. Example documents are currently applied to translations into English, German, French, Italian, and Spanish, including their regional variants. A document in another language has no effect on translations. See [Languages supported](https://developers.deepl.com/docs/getting-started/supported-languages.md) for the full list.

If your account has reached its example document limit, the request returns `456`. An import job that is still waiting for its upload counts toward the limit until it expires.


## OpenAPI

````yaml post /v3/example_documents/import
openapi: 3.0.3
info:
  title: DeepL API Documentation
  description: >-
    The DeepL API provides programmatic access to DeepL’s language AI
    technology.


    Note: this OpenAPI spec is embedded into our API documentation and has
    shortened descriptions.
  termsOfService: https://www.deepl.com/pro-license
  contact:
    name: DeepL - Contact us
    url: https://www.deepl.com/contact-us
  version: 3.17.0
servers:
  - url: https://api.deepl.com
    description: DeepL API Pro
  - url: https://api-free.deepl.com
    description: DeepL API Free
security: []
tags:
  - name: beta
    description: >-
      Experimental features that are under testing and not yet intended for
      production use.
  - name: TranslateText
    description: >-
      The text-translation API currently consists of a single endpoint,
      `translate`, which is described below.
  - name: TranslateDocuments
    description: >-
      The document translation API allows you to translate whole documents and
      supports the following file types and extensions:
        * `docx` - Microsoft Word Document
        * `pptx` - Microsoft PowerPoint Document
        * `xlsx` - Microsoft Excel Document
        * `xlsm` - Microsoft Excel Macro-Enabled Workbook
        * `pdf` - Portable Document Format
        * `htm / html` - HTML Document
        * `txt` - Plain Text Document
        * `xlf / xliff` - XLIFF Document (versions 1.2, 2.0, and 2.1)
        * `srt` - SRT Document
        * `vtt` - WebVTT Subtitle Document
        * `idml` - Adobe InDesign Markup Language
        * `xml` - XML Document
        * `json` - JSON Document
        * `yaml / yml` - YAML Document
        * `properties` - Java Properties Document
        * `strings` - iOS/macOS Strings Document
        * `md / markdown` - Markdown Document
        * `dita` - DITA topic (Darwin Information Typing Architecture)
        * `mif` - Adobe FrameMaker Interchange Format
        * `zip` - SCORM Package (e-learning content)
        * `odt` - OpenDocument Text Document
        * `rtf` - Rich Text Format Document
        * `resx` - .NET Resource Document
        * `jpeg` / `jpg` / `png` - Image
  - name: RephraseText
    description: >-
      The `rephrase` endpoint  is used to make corrections and adjustments to
      texts based on style or tone.
  - name: CorrectText
    description: >-
      The `correct` endpoint fixes spelling and grammar errors without broader
      rephrasing. Use it when you want

      a minimal-change correction pass rather than the broader rewriting
      performed by `rephrase`.
  - name: ManageSpokenTerms
    description: >-
      The *Spoken Terms* functions allow you to create, inspect, edit and delete
      Spoken Terms collections.

      Spoken Terms improve speech recognition in the Voice API: they ensure
      specific words and phrases,

      such as company names, acronyms, and product names, are transcribed
      correctly. A collection contains

      one or more term lists, each holding terms for a single language, and is
      applied to a voice session

      via the `spoken_terms_id` parameter.
  - name: ManageMultilingualGlossaries
    description: >-
      The *glossary* functions allow you to create, inspect, edit and delete
      glossaries.

      Glossaries created with the glossary function can be used in translate
      requests by specifying the

      `glossary_id` parameter. A glossary contains (several) dictionaries.

      A dictionary is a mapping of source phrases to target phrases for a single
      language pair.

      If you encounter issues, please let us know at support@DeepL.com.


      Currently you can create glossaries with any of the languages DeepL
      supports (with the exception of Thai).


      The maximum size limit for a glossary is 10 MiB = 10485760 bytes and each
      source/target text,

      as well as the name of the glossary, is limited to 1024 UTF-8 bytes.

      A total of 1000 glossaries are allowed per account.


      When creating a dictionary with target language `EN`, `PT`, or `ZH`, it's
      not necessary to specify a variant

      (e.g. `EN-US`, `EN-GB`, `PT-PT`, `PT-BR`, or `ZH-HANS`).

      Dictionaries with target language `EN` can be used in translations with
      either English variant.

      Similarly `PT`, and `ZH` dictionaries can be used in translations with
      their corresponding variants.

      (When you provide the ID of a glossary to a translation, the appropriate
      dictionary is automatically applied.)


      For text translation, if you omit `source_lang`, DeepL detects the source
      language and applies the dictionary for the detected language pair.
      Document translation with a glossary requires `source_lang`.


      Glossaries created via the DeepL API are now unified with glossaries
      created via the DeepL website and DeepL apps.

      Please only use the v3 glossary API in conjunction with multilingual or
      edited glossaries from the website.
  - name: ManageGlossaries
    description: >-
      Please note that this is the spec for the (old) v2 glossary endpoint.

      We recommend users switch to the newer v3 glossary endpoints, which
      support editability and multilinguality.


      The *glossary* functions allow you to create, inspect, and delete
      glossaries.

      Glossaries created with the glossary function can be used in translate
      requests by specifying the

      `glossary_id` parameter.

      If you encounter issues, please let us know at support@DeepL.com.


      Currently you can create glossaries with any of the languages DeepL
      supports (with the exception of Thai).
  - name: ManageStyleProfiles
    description: >-
      The style profile endpoints allow you to create, inspect, edit and delete
      style profiles. A style

      profile bundles glossaries, style rule lists and translation memories
      under one ID. Pass its

      `style_profile_id` in a translation request instead of the individual
      customization parameters.


      Every component list is optional, and you can link components later with
      an update. A style

      profile can reference at most one style rule list per target language and
      at most one translation

      memory per source language. With `glossary_priority_order_enabled`, the
      order of the glossary IDs

      decides which glossary wins when two of them define the same source term.


      Deleting a style profile does not delete the glossaries, style rule lists
      and translation memories it

      links. Deleting one of those components removes it from every style
      profile that links it.
  - name: MetaInformation
    description: Information about API usage and value ranges
  - name: TranslationMemories
    description: >-
      The translation memory endpoints allow you to manage your account's
      translation memories, used to store

      and reuse previously created translations. You can list and retrieve
      translation memories, page through

      their stored segments, create one by importing a TMX file, export one back
      to TMX, and delete one.

      Editing the contents of an existing translation memory is not supported;
      import a new one instead.


      Importing and exporting run as background jobs. Create the job, then poll

      `GET /v3/translation_memories/jobs/{job_id}` until it reports `completed`.


      Translation memories can be used in text translation requests by

      specifying the `translation_memory_id` parameter to denote a specific
      translation memory and the

      `translation_memory_threshold` which defines the minimum matching
      percentage required for a translation memory

      segment to be applied (recommended to be 75% or higher). A translation
      request fails with `404` if the

      translation memory does not exist or does not cover the requested language
      pair.
  - name: ExampleDocuments
    description: >-
      The example document endpoints allow you to manage your account's example
      documents.

      An example document is a document written in the language you translate
      into. Translations that

      reference it adapt to its style, tone, and terminology. You can import a
      document, list and

      retrieve your example documents, and delete one. Editing an existing
      example document is not

      supported; import a new one instead.


      Importing runs as a background job. Create the job, upload the file, then
      poll

      `GET /v3/example_documents/jobs/{job_id}` until it reports `completed`.


      Example documents can be used in text translation requests on `POST
      /v2/translate` by listing their

      IDs in `customizations.example_document_ids`. A request that references an
      example document the account

      cannot access fails with `404`.
  - name: VoiceAPI
    description: >-
      The Voice API provides real-time voice transcription and translation
      services.

      Use a two-step flow: first request a streaming URL via REST, then
      establish a WebSocket connection for streaming audio and receiving
      transcriptions.
  - name: VoiceTranslateJob
    description: >-
      **Alpha.** Async voice translation jobs. This API may change without
      notice.
  - name: AdminApi
    description: >-
      Endpoints for organization administrators to manage API keys and retrieve
      usage analytics.
  - name: QualityEvaluation
    description: >-
      **Beta.** Retrieve a quality evaluation report for a document DeepL has
      translated. Reports are requested with `enable_quality_evaluation` on
      `POST /v2/document` and polled here. A report lists per-segment quality
      issues categorized by error type and severity, with character spans
      pointing to where each issue occurs.
externalDocs:
  description: DeepL Pro - Plans and pricing
  url: https://www.deepl.com/pro#developer
paths:
  /v3/example_documents/import:
    post:
      tags:
        - ExampleDocuments
      summary: Import an example document
      description: >-
        Create an example document by importing a file.


        This endpoint does not accept the file itself. It returns a short-lived
        `upload_url`, and you

        upload the file to that URL with a separate `PUT` request. Processing
        starts automatically

        once the upload completes, so there is no third call to confirm it.


        1. `POST /v3/example_documents/import` with the file's name and size.
        The response returns a
           `job_id`, an `upload_url`, and the `expires_at` time after which the URL stops working.
        2. `PUT` the file to `upload_url`. Do not send your `Authorization`
        header on this request,
           because the URL is already signed.
        3. Poll [Retrieve an import
        job](/api-reference/example-documents/retrieve-an-example-document-import-job)
           until the status is `completed`. The new `example_document_id` is on the job result.

        The request body must be JSON. Any other content type is rejected with

        `415 Unsupported Media Type`.


        Requires an API key with the `example_documents:write` scope.
      operationId: createExampleDocumentImport
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - source_file
              properties:
                source_file:
                  type: object
                  required:
                    - file_name
                    - content_length
                  properties:
                    file_name:
                      description: >-
                        The name of the file you intend to upload, including its
                        extension. The extension

                        selects how the file is read and must belong to a

                        [supported file
                        format](/api-reference/example-documents/import-an-example-document#supported-file-formats).

                        A missing name, a name over the [length
                        limit](/api-reference/example-documents/import-an-example-document#limits),

                        or an unsupported extension is rejected with `400 Bad
                        Request`.
                      type: string
                      example: member-newsletter.txt
                    content_type:
                      description: >-
                        The MIME type of the file. Optional. A value over the

                        [length
                        limit](/api-reference/example-documents/import-an-example-document#limits)
                        is rejected with `400 Bad Request`.
                      type: string
                      example: text/plain
                    content_length:
                      description: >-
                        The size of the file in bytes. Must be greater than 0. A
                        missing or zero value, or

                        one over the [file size
                        limit](/api-reference/example-documents/import-an-example-document#limits),
                        is rejected with `400 Bad Request`.
                      type: integer
                      format: int64
                      minimum: 1
                      example: 1070
                parameters:
                  type: object
                  properties:
                    display_name:
                      description: >-
                        The name to give the new example document. A value over
                        the

                        [length
                        limit](/api-reference/example-documents/import-an-example-document#limits)
                        is rejected with `400 Bad Request`. If you omit this,
                        the

                        example document is named after the file.
                      type: string
                      example: Member newsletter
            examples:
              Basic:
                value:
                  source_file:
                    file_name: member-newsletter.txt
                    content_type: text/plain
                    content_length: 1070
                  parameters:
                    display_name: Member newsletter
      responses:
        '202':
          description: >-
            The import job was created. Upload the file to `upload_url` before
            `expires_at`.
          headers:
            X-Trace-ID:
              $ref: '#/components/headers/X-Trace-ID'
          content:
            application/json:
              schema:
                type: object
                required:
                  - job_id
                  - upload_url
                  - expires_at
                properties:
                  job_id:
                    description: >-
                      The identifier of the import job. Use it to poll the job's
                      status.
                    type: string
                    format: uuid
                    example: 31909c14-3f7e-4a1f-8b08-38f04ced7f45
                  upload_url:
                    description: >-
                      A signed URL to `PUT` the file to. Do not send your
                      `Authorization` header with the

                      upload request.
                    type: string
                    format: uri
                    example: >-
                      https://assets.deepl.com/upload/31909c14-3f7e-4a1f-8b08-38f04ced7f45
                  expires_at:
                    description: >-
                      The time the `upload_url` stops accepting uploads, in the
                      ISO 8601-1:2019 format. After

                      this time, create a new import job.
                    type: string
                    format: date-time
                    example: '2026-11-19T09:52:09.410Z'
              examples:
                Basic:
                  value:
                    job_id: 31909c14-3f7e-4a1f-8b08-38f04ced7f45
                    upload_url: >-
                      https://assets.deepl.com/upload/31909c14-3f7e-4a1f-8b08-38f04ced7f45
                    expires_at: '2026-11-19T09:52:09.410Z'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/ForbiddenScoped'
        '415':
          description: >-
            The request body is not JSON. Set the `Content-Type` header to
            `application/json`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '456':
          description: >-
            You have reached the maximum number of example documents for your
            account. Delete an

            example document before importing another one.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      security:
        - auth_header: []
components:
  headers:
    X-Trace-ID:
      description: >-
        A unique identifier for the request that can be included in bug reports
        to DeepL support.
      schema:
        type: string
      example: 501c3d93cc0c4f11ae2f60a226c2f0f0
  responses:
    BadRequest:
      description: Bad request. Please check error message and your parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: >-
        Authorization failed. Please supply a valid `DeepL-Auth-Key` via the
        `Authorization` header.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ForbiddenScoped:
      description: >-
        Authorization failed. Please supply a valid `DeepL-Auth-Key` via the
        `Authorization` header. This error is also returned when the API key is
        scoped but does not include the scope required for this endpoint.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    TooManyRequests:
      description: Too many requests. Please wait and resend your request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: Internal error.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/ErrorResponse'
              - $ref: '#/components/schemas/InfrastructureErrorResponse'
    ServiceUnavailable:
      description: Resource currently unavailable. Try again later.
      content:
        application/json:
          schema:
            oneOf:
              - $ref: '#/components/schemas/ErrorResponse'
              - $ref: '#/components/schemas/InfrastructureErrorResponse'
  schemas:
    ErrorResponse:
      type: object
      required:
        - message
      properties:
        message:
          type: string
          description: A human-readable description of the error.
        code:
          type: string
          description: >-
            A machine-readable identifier for the error, when available. Clients
            should match on this value rather than on `message` when branching
            on error types.
          example: invalid_content_type
    InfrastructureErrorResponse:
      description: >
        Error body returned by DeepL's edge infrastructure for failures that
        occur before a request reaches the API itself. The message is nested
        under `error`, unlike the application-level `ErrorResponse`. Clients
        that parse error bodies should handle both shapes.
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
          properties:
            message:
              type: string
              description: A human-readable description of the error.
              example: Bad Gateway.
  securitySchemes:
    auth_header:
      type: apiKey
      description: >
        Authentication with `Authorization` header and `DeepL-Auth-Key`
        authentication scheme. Example: `DeepL-Auth-Key <api-key>`
      name: Authorization
      in: header
      x-default: 'DeepL-Auth-Key '

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.