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

# Create a translation memory

> Create a new translation memory in the organization. `minMatchPercentage` (default 75, floor 40) is the threshold below which fuzzy matches from this TM are not surfaced. `penalties` deducts points for case / whitespace / trailing punctuation differences on otherwise-identical sources.



## OpenAPI

````yaml /openapi/textsetu.json post /orgs/{orgId}/translation-memories
openapi: 3.1.0
info:
  title: TextSetu API
  version: 1.2.0
  description: >-
    Public REST API for TextSetu. Authenticate with a Personal Access Token
    (tsu_pat_…) or a project token (tsu_proj_…) via the `Authorization: Bearer
    <token>` header.


    **Authorization is permission-based.** Every token carries an explicit
    allow-list of RBAC permission keys (e.g. `translation_read`), and each
    endpoint declares the permission it requires (`x-permission`). A token's
    effective access is its underlying authority ∩ its allow-list — a PAT is
    further bounded by its owner's role-based permissions, so it can only
    narrow, never exceed, what the owner already has. A project token is bound
    to a single project. There are no coarse read/write/manage scopes.


    **Response envelope.** Every endpoint returns `{ "success": true, "data": …
    }` on success and `{ "success": false, "error": { "code", "message" } }` on
    failure.


    **Rate limit.** 600 requests/minute, keyed by token (or by IP when
    unauthenticated). Exceeding it returns 429 with the standard error envelope.
servers:
  - url: https://api.textsetu.com/api/v1
    description: Production
  - url: /api/v1
    description: This server (self-hosted / same-origin)
security:
  - bearerAuth: []
tags:
  - name: Projects
    description: >-
      Read project metadata — settings, key separator, and the
      approval/branching flags that shape how the other endpoints behave.
  - name: Languages
    description: >-
      List and manage a project's target languages. Each language is referenced
      by its BCP-47 code; the source language is flagged separately.
  - name: Translations
    description: >-
      Manage a project's translations: create, read, update, and delete
      translation keys — the identifiers your app looks up, carrying metadata
      (description, tags, screenshot) — and set the translated value for a key
      in a given language. Value writes honor the project's approval workflow —
      non-approver writes land as `pending_review`.
  - name: Stats
    description: >-
      Per-language completeness and approval progress for a project — the
      numbers behind the dashboard.
  - name: Import/Export
    description: >-
      Bulk-load source files into a project or export the current translations.
      Supports the same file formats as the web app.
  - name: Branches
    description: >-
      Work on translations in isolation and merge them back. Branch reads/writes
      mirror the main endpoints but stage changes as a diff until merge. See the
      [branching guide](/docs/guides/branches).
  - name: Glossary
    description: >-
      Manage term bases — approved terminology and its translations — and check
      a string against them. See the [glossary guide](/docs/guides/glossary).
  - name: Translation Memory
    description: >-
      Reusable translation stores. Fuzzy-match and concordance-search prior
      translations to reuse them. See the [translation memory
      guide](/docs/guides/translation-memory).
  - name: AI
    description: >-
      Machine-translate a project with the org's configured AI engine (brand
      voice, glossary/TM grounding, and an optional review pass). Runs
      asynchronously — start a run and poll the returned `jobId`.
  - name: Webhooks
    description: >-
      Get notified when a project's translations change, instead of polling.
      Register an HTTPS endpoint, subscribe it to the events you care about, and
      TextSetu POSTs a signed payload whenever one occurs. Payloads follow the
      [Standard Webhooks](https://www.standardwebhooks.com) spec — verify the
      `webhook-signature` header with any compatible library. Delivery is
      at-least-once and unordered, so treat `webhook-id` as an idempotency key.
      Failed deliveries are retried five times over roughly seven hours, and
      every attempt is inspectable and replayable via the delivery log.
  - name: Meta
    description: Service-level and cross-cutting endpoints.
paths:
  /orgs/{orgId}/translation-memories:
    post:
      tags:
        - Translation Memory
      summary: Create a translation memory
      description: >-
        Create a new translation memory in the organization.
        `minMatchPercentage` (default 75, floor 40) is the threshold below which
        fuzzy matches from this TM are not surfaced. `penalties` deducts points
        for case / whitespace / trailing punctuation differences on
        otherwise-identical sources.
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
          description: Organization id (UUID) or id-embedded path slug.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: Human-readable name for the translation memory.
                  examples:
                    - Marketing TM
                description:
                  description: Optional free-text description.
                  examples:
                    - Reusable copy for marketing surfaces.
                  type: string
                  maxLength: 500
                sourceLanguage:
                  description: >-
                    BCP-47 code of the TM's source language — matches are keyed
                    off it.
                  examples:
                    - en
                  type: string
                  maxLength: 10
                scope:
                  description: >-
                    `all` = every project may leverage it; `selected` = only
                    assigned projects. Defaults to `all`.
                  examples:
                    - all
                  type: string
                  enum:
                    - all
                    - selected
                approvalRequired:
                  type: boolean
                  description: >-
                    When true, entry translations by non-approvers are stored as
                    proposals.
                  examples:
                    - false
                approvalBypassAdmins:
                  type: boolean
                  description: >-
                    When true, org admins' edits are auto-approved even while
                    approval is required.
                  examples:
                    - false
                minMatchPercentage:
                  description: >-
                    Minimum match % below which fuzzy matches are not surfaced
                    (floor 40, default 75).
                  examples:
                    - 75
                  type: integer
                  minimum: 40
                  maximum: 100
                penalties:
                  description: >-
                    Per-difference score deductions applied to near-exact
                    matches.
                  type: object
                  properties:
                    caseMismatch:
                      description: >-
                        Percentage points to deduct when a match differs only in
                        letter case.
                      examples:
                        - 1
                      type: number
                      minimum: 0
                      maximum: 100
                    whitespace:
                      description: >-
                        Percentage points to deduct when a match differs only in
                        whitespace.
                      examples:
                        - 1
                      type: number
                      minimum: 0
                      maximum: 100
                    punctuation:
                      description: >-
                        Percentage points to deduct when a match differs only in
                        trailing punctuation.
                      examples:
                        - 2
                      type: number
                      minimum: 0
                      maximum: 100
              required:
                - name
      responses:
        '201':
          description: The newly created translation memory.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - data
                properties:
                  success:
                    type: boolean
                    const: true
                  data:
                    type: object
                    properties:
                      translationMemory:
                        type: object
                        properties:
                          id:
                            type: string
                            description: Unique translation-memory id (UUID).
                            examples:
                              - tm_3f2a9b1c
                          orgId:
                            type: string
                            description: Id of the organization that owns this TM.
                            examples:
                              - org_5d4c3b2a
                          name:
                            type: string
                            description: Human-readable name of the translation memory.
                            examples:
                              - Marketing TM
                          description:
                            anyOf:
                              - type: string
                              - type: 'null'
                            description: Optional free-text description, or `null` if none.
                            examples:
                              - Reusable copy for marketing surfaces.
                          sourceLanguage:
                            anyOf:
                              - type: string
                              - type: 'null'
                            description: >-
                              BCP-47 code of the TM's source language — matches
                              are keyed off it. `null` until set.
                            examples:
                              - en
                          scope:
                            type: string
                            description: >-
                              Assignment scope: `all` (every project in the org
                              may leverage it) or `selected` (only assigned
                              projects).
                            examples:
                              - all
                          approvalRequired:
                            type: boolean
                            description: >-
                              When true, entry translations by non-approvers are
                              stored as proposals.
                            examples:
                              - false
                          approvalBypassAdmins:
                            type: boolean
                            description: >-
                              When true, org admins' edits are auto-approved
                              even while approval is required.
                            examples:
                              - false
                          minMatchPercentage:
                            type: integer
                            description: >-
                              Floor (40–100) below which fuzzy matches from this
                              TM are not surfaced.
                            examples:
                              - 75
                          penalties:
                            type: object
                            propertyNames:
                              type: string
                            additionalProperties: {}
                            description: >-
                              Percentage-point deductions applied to near-exact
                              matches, keyed by `caseMismatch`, `whitespace`,
                              `punctuation`.
                            examples:
                              - caseMismatch: 1
                                whitespace: 1
                                punctuation: 2
                          createdAt:
                            type: string
                            description: Creation timestamp (ISO 8601).
                            examples:
                              - '2026-01-15T09:24:00.000Z'
                          updatedAt:
                            type: string
                            description: Last-update timestamp (ISO 8601).
                            examples:
                              - '2026-02-02T14:05:00.000Z'
                        required:
                          - id
                          - orgId
                          - name
                          - description
                          - sourceLanguage
                          - scope
                          - approvalRequired
                          - approvalBypassAdmins
                          - minMatchPercentage
                          - penalties
                          - createdAt
                          - updatedAt
                        additionalProperties: false
                    required:
                      - translationMemory
                    additionalProperties: false
        '500':
          description: The translation memory could not be created.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API token: tsu_pat_… (PAT) or tsu_proj_… (project token). The token's
        granted RBAC permissions determine access; see each operation's
        `x-permission`.

````