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

# Check whether a metadata definition can be replaced

> `PUT /definitions/documents/replaceable`

Runs the compatibility check that `PUT /definitions/documents` would run, and changes nothing. Call it before offering a replacement to a user: a success means the swap goes through cleanly, a rejection means it would only go through by force and at the cost of the existing documents.

The check is about the documents that already exist. It objects to dropping a field, to changing a field's type or its option set, and to moving the type onto a different workflow. The rejection reports only that the definition is incompatible - which field caused it is not in the response.

---

**Token authorization:** Authorize using a token — either a session token obtained from login or an API key — to call this endpoint.

**Required user role:** `admin`



## OpenAPI

````yaml /api-v1/openapi.json put /definitions/documents/replaceable
openapi: 3.0.3
info:
  title: Circularo API v1
  description: >-
    Circularo API v1 is the REST API that powers the Circularo platform and its
    first-party clients — the web app, the mobile apps and the Microsoft 365
    add-ins.


    This API spans the full surface of Circularo's functionality — document
    management, signing and sharing, workflow processing, administration, and
    configuration. It is **not** a stable contract and may change between
    releases without prior notice. It stays available for existing integrations
    while they move to Circularo API v2; new integrations belong on API v2.


    ## Authentication


    Most endpoints act on behalf of a signed-in user and require a token. Obtain
    a session token by signing in with `POST /login` — when multi-factor
    authentication is active, the token stays locked until you unlock it with a
    second factor — or use a long-lived API key. Send it as the `token` query
    parameter or in an `Authorization: Bearer` header. A session token expires
    after a period without use. Each endpoint's description lists the rights and
    roles it requires.


    Endpoints usable without signing in identify the environment by the request
    address or by the `tenant` query parameter. Endpoints for share recipients
    authenticate with the share token instead, together with a one-time password
    where the share is protected.
  termsOfService: https://terms.circularo.com/
  contact:
    name: Circularo
    url: https://developers.circularo.com/
    email: support@circularo.com
  version: 26.2.0
servers:
  - url: https://sandbox.circularo.com/api/v1
security:
  - Token: []
tags:
  - name: ACLs
    description: >-
      An ACL (access control list) is a named bundle of rights carried by groups
      — a user holds a right only because one of their groups carries an ACL
      that grants it. Create, search, update and delete ACLs; which rights an
      ACL grants is set on the rights, and which groups carry it is set on the
      groups. Deleting an ACL detaches it from every right and group.
  - name: API Keys
    description: >-
      An API key is a long-lived credential for connecting an external system to
      Circularo. It acts with the rights of the user who owns it and stays valid
      as long as it is in regular use. Create, list and revoke your own API keys
      — the secret is returned only once, at creation, so store it securely. A
      key can also be issued for a SCIM client, in which case only the SCIM
      endpoints accept it.
  - name: Attachments
    description: >-
      An attachment is a supporting file filed alongside a document, separate
      from its main file. Add, download, replace, rename and delete the
      attachments of a document, download all of them at once as a ZIP archive,
      or read an attachment of a draft. An attachment is addressed by the
      document identifier and its file hash.
  - name: Certificates
    description: >-
      Download the signing certificates configured for the instance as a ZIP
      archive of PKCS#12 files, for use by external signing components, and
      check whether they have changed since your last download so you can skip
      an unnecessary one. Both endpoints are meant for those components and
      authenticate with a pre-shared key rather than a user token.
  - name: Configuration
    description: >-
      The signed-in user's own account — profile and preferences, password,
      authentication factors and recovery codes, saved search filters,
      signature, initials and profile images, device push tokens, and
      introductory guides. Every endpoint acts on the caller only; other users'
      accounts are managed through the user endpoints.
  - name: Contacts
    description: >-
      A contact is an address-book entry owned by the user who created it,
      optionally shared with other users and groups, who can then pick it as a
      recipient when sharing documents. Create, search, update and delete
      contacts, change who they are shared with, and import or export them as
      CSV or JSON, previewing an import file before it is applied.
  - name: Counters
    description: >-
      A counter issues sequential identifiers, such as document numbers,
      following a pattern that combines fixed text, date segments and
      incrementing digits or letters — for example `ID-{year}-{###}`. A counter
      can restart whenever one of its date segments changes, such as at the
      start of each year. Create, read and update counters, and take the next
      value from one.
  - name: Definitions
    description: >-
      Definitions describe how documents are structured and processed. A
      metadata definition is a document type — its fields, its form, its
      processing options and the workflow it follows; a workflow definition is a
      set of states and the actions that move a document between them. Create,
      read, update and delete both kinds, list the actions available in a
      workflow state, put individual transitions behind a right, and export a
      metadata definition together with everything it depends on.
  - name: Documents
    description: >-
      A document is the central record of Circularo — a main file together with
      the metadata its metadata definition describes, optional attachments, and
      the workflow that moves it through its states. Create, read, edit and
      delete documents; sign, seal or annotate them; convert or merge their
      files; clone, rename or transfer them to a new owner; control who may read
      and edit them; and download their audit trail. Operations that change a
      document carry the version you last read, so a change made in the meantime
      is not silently overwritten.
  - name: Drafts
    description: >-
      A draft is the unfinished state of a document being prepared — created,
      edited, cloned or signed — kept privately for the user who started it and
      never shared. Create, list, search, update and delete drafts; an update
      replaces the whole draft and carries the version you last read. A draft is
      removed automatically once the document operation it was prepared for
      succeeds.
  - name: Enums
    description: >-
      An enumeration is a tenant-wide reference list — a definition declaring
      its fields, some of which may be unique, and the records that fill it —
      that supplies the values of list-type metadata fields. Create, search,
      update and delete enumerations and their records, share records with users
      and groups, and import or export records as CSV or JSON. Fields can be
      added to an existing enumeration but never removed or retyped.
  - name: Export
    description: >-
      An exporter turns a selection of documents into a downloadable output —
      such as a CSV or XLSX listing, PDF files, the original files, or a ZIP
      archive of a folder tree. List the exporters available to you, select the
      documents with a search query, and tune the output with exporter-specific
      options. Large exports run in the background; count the documents first to
      learn whether the result comes back directly or as a background job.
  - name: Fields
    description: >-
      A global field is a metadata field declared once per tenant and reused by
      many metadata definitions, which makes its values searchable and
      aggregatable across document types. Create, read, search, export and
      delete global fields, see which definitions use a field, and check whether
      a field name is available. A global field is never updated in place —
      delete it and create it again.
  - name: Files
    description: >-
      A file is a stored binary, identified by its hash, that documents,
      attachments, signatures and profiles refer to. Upload, download (including
      byte ranges), inspect, rename, relabel and replace files; convert them to
      PDF or PDF/A, or merge several into one PDF; upload signature, initials
      and profile images; and check your storage capacity. Public files, such as
      branding assets, can be downloaded without authentication.
  - name: Folders
    description: >-
      A folder organizes documents into a tree — either your personal tree,
      which is yours alone, or the shared tree. Create, read, rename and delete
      folders, move items within a tree, hand documents over to the other tree,
      or take them out of a tree entirely. Moving documents into the shared tree
      can grant them the rights of the target folder; deleted folders go to the
      trash, from which they can be restored.
  - name: Groups
    description: >-
      A group bundles users and carries the permissions granted to them — it
      holds ACLs, and its members receive the rights those ACLs grant. An
      organization is represented as a group too. Create, search, update and
      delete groups, add them to and remove them from ACLs, find the groups that
      grant a particular right, and resolve group display names. Membership is
      managed from the user side.
  - name: Inbox
    description: >-
      The inbox is where internal users act on the documents in their workflow.
      Execute a workflow action on a document, comment on its workflow, cancel
      the workflow and archive the document, or reset it to its start state.
      Cancelling or resetting a workflow does not withdraw the shares already
      sent to recipients.
  - name: Languages
    description: >-
      Languages and their translation keys hold the interface texts of the
      tenant. Add, activate, deactivate and delete languages; create, update,
      rename and delete translation keys, one at a time or in bulk; read
      translations per key or per language, including as a flat map for client
      localization; and import or export languages as JSON files. An imported
      language always arrives inactive.
  - name: LDAP
    description: >-
      Synchronize users and groups from Active Directory into Circularo. The
      synchronization only creates and updates — it never deletes anything and
      never writes back to the directory — and a dry run previews its result
      without applying it.
  - name: Links
    description: >-
      A link connects two documents that relate to each other. Link two
      documents, list the links of a document, or remove a link. Links have no
      direction — each pair of documents is linked at most once.
  - name: Login
    description: >-
      Sign in and inspect the sessions of the signed-in user. Sign in with a
      username and password to obtain a session token; when multi-factor
      authentication is active, the token stays locked until you unlock it with
      a second factor or a recovery code, and you can have a new code sent. Read
      the current sign-in status, the rights you hold, and your active sessions.
  - name: Logout
    description: >-
      End sign-in sessions. Sign out of the current session or another of your
      own, or — as an administrator — end every session of a user at once, for
      example when an account may be compromised. Ending a user's sessions
      leaves their API keys working.
  - name: Logs
    description: >-
      The audit log is the record of significant actions across the system — who
      did what, to which entity, and when. Search it with a structured query and
      page through large results with a scroll, which you release when done, or
      read a single entry. What you see depends on your role: the activity that
      concerns you, your organization's activity, or the whole tenant's. Entries
      are written in batches, so the most recent actions may appear with a short
      delay.
  - name: Nafath
    description: >-
      Verify a person's identity through Nafath, the Saudi national digital
      identity platform — to sign in, to link the identity to an account, to
      verify a share recipient, or to authorize a signature. Start a check,
      which the person confirms in the Nafath app, and poll its status until it
      completes; Nafath reports the outcome through a callback.
  - name: Notifications
    description: >-
      A notification informs a user about an event that concerns them. These
      endpoints cover your in-app notifications: list and search them, count the
      unread ones, mark them as read, and delete them. You can also list the
      delivery channels — in-app, e-mail and push — and the notification types,
      which each user switches on or off per channel.
  - name: OAuth
    description: >-
      Connect to external identity and service providers over OAuth 2.0, such as
      Microsoft, Google or Dropbox. Sign in through a provider, which can also
      create the account, or connect a provider account to your own — such as a
      cloud storage — then obtain a fresh access token for it or disconnect it.
      A provider can also verify a share recipient or authorize a signature. A
      client that cannot rely on the session cookie, such as a native app,
      exchanges a one-time code for a login token.
  - name: Ping
    description: >-
      Check that Circularo API v1 is reachable and answering. No authentication
      is required; the check covers the API itself, not storage or background
      services.
  - name: Plans
    description: >-
      A plan is a named entry in the catalogue of service offerings that
      subscriptions refer to; it carries no limits or billing of its own — those
      belong to the subscription. Create, search and update plans, which is an
      administrative task, and read a single plan.
  - name: Revisions
    description: >-
      A revision is a snapshot of a whole document, taken by the operations that
      change it. List the revisions of a document, read one, compare two of
      them, restore a document to an earlier revision, or undo the changes made
      to its main file since the last snapshot, such as annotations or
      signatures. Restoring is refused for a document that is signed or waiting
      for action unless you force it.
  - name: Rights
    description: >-
      A right is a named permission to use a feature or perform an action. Users
      never hold rights directly: a right lists the ACLs that grant it, and
      users receive it through the ACLs of their groups. Create, read, search,
      update and delete rights, including rights scoped to particular metadata
      definitions, workflows and actions.
  - name: SAML
    description: >-
      Sign in through a SAML 2.0 identity provider configured for the tenant, an
      organization or a group. Start the sign-in, which redirects to the
      identity provider; the provider posts the result back to the callback,
      which either sets the session cookie or redirects to your client with a
      one-time code that you exchange for a login token. Download the service
      provider metadata to register Circularo with the identity provider.
  - name: SCIM
    description: >-
      Provision users and groups automatically from an identity provider over
      SCIM 2.0 (RFC 7643 and RFC 7644). Create, read, replace, patch and
      deprovision accounts and groups within your organization, and discover the
      supported schemas, resource types and service provider configuration. SCIM
      clients authenticate with a SCIM API key in an `Authorization: Bearer`
      header, SCIM must be enabled for the tenant, and errors follow the SCIM
      format instead of the common error body.
  - name: Search
    description: >-
      Search and analyze documents. Select documents with a structured query of
      filter, must, should and must-not clauses, and add aggregations, which are
      written in Elasticsearch syntax; page through results with an offset or a
      scroll, count documents for several searches at once, or locate the page a
      document is on. Run the stored dashboards for chart-ready analytics, or
      build reports that pair each document with its transaction across the
      organization.
  - name: Settings
    description: >-
      Settings configure the behaviour and appearance of Circularo at a chosen
      scope — tenant, organization, role, group or user. A value not set at one
      scope is inherited from the scope above it, down to the shipped defaults.
      Read the settings in force for you, the settings of one scope or what it
      inherits, and write them whole or property by property; tailor the e-mails
      sent at a scope and send a trial one; replace the single sign-on signing
      keys; and try out a language model configuration before saving it.
  - name: Share
    description: >-
      A share sends a document to one recipient — an internal user or an
      external person without a Circularo account — to view, edit, sign,
      approve, review or accept it; the shares of a document together form its
      transaction. As the sender, send a document to its recipients in parallel
      or in a set order, then edit, remind, search or call off the shares, or
      get the document's permanent public link. As a recipient, open the share
      with its share token — plus a one-time password where the share is
      protected by an SMS or e-mail code, a password or an identity check — then
      read and download the document, sign it or complete your action, comment
      on it, reject it, or delegate it to somebody else.
  - name: Stamps
    description: >-
      A stamp is a reusable visual mark — a design of shape, frame, colours and
      lines of text, rendered into an image — that is placed on documents during
      signing. A stamp is either personal, belonging to one user, or shared
      across an organization. Create, read, search, edit and delete stamps;
      deleting a stamp does not affect the documents already stamped with it.
  - name: Static
    description: >-
      Download the client-side installers that hardware signature capture
      requires: the Wacom tablet driver and the Wacom SigCaptX signature capture
      tool for Windows.
  - name: Stripe
    description: >-
      Self-service billing through Stripe for organization administrators. List
      the subscription products on sale, start paying for a new subscription,
      change what it holds or stop it from renewing, read its billing summary,
      and open the billing portal. Stripe itself reports payment events through
      the webhook endpoint.
  - name: Subscriptions
    description: >-
      A subscription holds what an organization or a user is entitled to — the
      limits of its plan, the usage consumed against them, its period and its
      commercial details. Create, read, search and edit subscriptions and search
      their recorded history; this is mostly administrative, and organization
      administrators may edit only the commercial details. Any user can ask the
      sales team about a larger plan.
  - name: Support
    description: >-
      Send a support ticket — a technical problem, a question, a feature request
      or a subscription inquiry — to the support address of your environment,
      with optional attachments. Replies come back to you by e-mail.
  - name: Tags
    description: >-
      Tags label documents for categorization and filtering. A private tag is
      visible only to the user who set it; a public tag is visible to everyone
      who can see the document and can be searched for. List the tags in use,
      and add, remove or replace tags on many documents at once. Tagging
      requires only read access to a document.
  - name: Templates
    description: >-
      A template is a reusable starting point for documents — a document
      together with recipient roles, the fields placed for each of them, and
      share settings — from which a transaction can be started again and again.
      Create, search, update and delete templates, share them with other users
      and groups, and export or import them, previewing an import file before it
      is applied.
  - name: Users
    description: >-
      A user is an account in the tenant. Create, search, update and delete
      accounts, in bulk where needed; manage their group membership, signing
      certificates, linked external identities, and signature, initials and
      profile images; and list the rights a user holds. The account flows that
      run before sign-in — self-registration, activation and password reset —
      belong here as well. A deleted account is kept as a historical record.
  - name: Verify
    description: >-
      Verify the signatures, seals and timestamps on a document — looked up by
      its identifier or by a signature identifier, or uploaded as a file, in
      which case the result also tells whether the file is known to Circularo
      and whether it has been modified. Verification works with or without
      signing in and can include the detailed validation reports of the DSS
      (Digital Signature Service).
  - name: Webhooks
    description: >-
      A webhook notifies an external system of document events in real time —
      such as a document being created, edited or deleted, a signature being
      requested, delegated, rejected or cancelled, and a document being signed
      or completed. Register a callback URL for your tenant or organization,
      secured by Basic authentication or a signing secret, and list, update or
      delete webhooks. Each event is delivered once, without retries.
  - name: WOPI
    description: >-
      Web Application Open Platform Interface (WOPI) endpoints through which an
      online office editor — Microsoft Office Online or Collabora Online — opens
      and edits files directly in the browser. Issue a token for the editor and
      list the file types it can open; the editor itself then reads the file
      information and content, manages locks, and writes the edited content back
      to Circularo.
  - name: WS
    description: >-
      Pass messages between a user's devices in real time over a WebSocket
      connection — for example, a phone sending a photo or a hand-drawn
      signature to the browser session where the user is working. The browser
      opens the connection with a session token, or with a share token and
      one-time password, and receives a connection token; the other device sends
      messages into the connection with that token alone.
paths:
  /definitions/documents/replaceable:
    put:
      tags:
        - Definitions
      summary: Check whether a metadata definition can be replaced
      description: >-
        `PUT /definitions/documents/replaceable`


        Runs the compatibility check that `PUT /definitions/documents` would
        run, and changes nothing. Call it before offering a replacement to a
        user: a success means the swap goes through cleanly, a rejection means
        it would only go through by force and at the cost of the existing
        documents.


        The check is about the documents that already exist. It objects to
        dropping a field, to changing a field's type or its option set, and to
        moving the type onto a different workflow. The rejection reports only
        that the definition is incompatible - which field caused it is not in
        the response.


        ---


        **Token authorization:** Authorize using a token — either a session
        token obtained from login or an API key — to call this endpoint.


        **Required user role:** `admin`
      operationId: requestDefinitionsPutMetadataReplaceable
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/requestDefinitionsPutMetadataReplaceable'
      responses:
        '200':
          description: >-
            The candidate definition would replace the current one without
            breaking existing documents.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseGenericStatus'
        '400':
          description: >-
            The definition is invalid, no definition of that name exists, or the
            replacement is not compatible with the documents already created
            from it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              example:
                status: 400
                type: VALIDATION:INPUT_INVALID
                message: Invalid input
                requestId: 3fa85f6457174562b3fc2c963f66afa6
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              example:
                status: 401
                type: AUTH:UNAUTHORIZED
                message: Authentication failed
                requestId: 3fa85f6457174562b3fc2c963f66afa6
        '403':
          description: The caller lacks the required role.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              example:
                status: 403
                type: AUTH:ACCESS_DENIED
                message: Access denied
                requestId: 3fa85f6457174562b3fc2c963f66afa6
      security:
        - Token: []
components:
  schemas:
    requestDefinitionsPutMetadataReplaceable:
      type: object
      properties:
        definition:
          allOf:
            - $ref: '#/components/schemas/requestDefinitionsMetadata'
          description: >-
            The candidate definition to test; its `name` picks the definition it
            would replace.
    responseGenericStatus:
      type: object
      properties:
        status:
          type: string
          description: Outcome of the operation, reported as a status type constant.
          example: SUCCESS
    error:
      type: object
      description: The error response returned for all unsuccessful (non-2xx) requests.
      properties:
        status:
          type: integer
          description: The HTTP status code of the error.
          example: 404
        type:
          type: string
          description: >-
            Machine-readable error type in `NAMESPACE:CODE` form, intended for
            programmatic handling. The set of types is not exhaustive and may
            grow over time.
          example: RESOURCE:NOT_FOUND
        message:
          type: string
          description: Human-readable description of the error.
          example: Resource not found
        requestId:
          type: string
          description: >-
            Unique identifier of the request; include it when contacting
            support.
          example: 3fa85f6457174562b3fc2c963f66afa6
        details:
          type: object
          additionalProperties: true
          description: >-
            Optional structured details about the error. Present only for errors
            that carry them; the shape depends on the error type.
      required:
        - status
        - type
        - message
        - requestId
    requestDefinitionsMetadata:
      type: object
      properties:
        backendHtmlRendering:
          type: boolean
          description: >-
            Whether the HTML of a generated document is rendered on the server.
            Switched off, the client renders it instead, and field formulas are
            left to the client as well.
          nullable: true
        barcode:
          type: string
          nullable: true
        barcodeType:
          type: string
          description: >-
            Symbology of the barcode generated into documents of this type. Left
            empty, no barcode is produced.
          example: qrcode
          nullable: true
        category:
          type: string
          description: >-
            Group the document type is filed under when a user picks what to
            create, so related types are offered together.
          example: Contracts
          nullable: true
        composePreview:
          type: boolean
          description: >-
            Whether composing a document of this type ends with a preview step
            before it is sent or signed.
          nullable: true
        contentFields:
          type: array
          items:
            type: string
          description: >-
            Fields whose text makes up the searchable content of documents of
            this type. The server derives the list from the `isFulltext` flag of
            `fields`, so a submitted value is overwritten.
          example:
            - D_DEFAULT_DESCRIPTION
          nullable: true
        contextAttachments:
          type: string
          description: >-
            Where the attachment area sits while a document is composed —
            `aside` in the side panel, `top` above the form, `bottom` below it.
          example: bottom
          nullable: true
        contextFileChooser:
          type: boolean
          description: >-
            Whether the folder and file chooser is offered inside the compose
            form itself rather than in its usual place.
          nullable: true
        defaultMode:
          type: string
          description: >-
            Compose view that opens first when both `formMode` and `inlineMode`
            are available — `formMode` or `inlineMode`.
          example: formMode
          nullable: true
        definitionSkin:
          type: string
          nullable: true
        definitionType:
          type: array
          items:
            type: string
          description: >-
            Kinds of document the definition can produce: `edoc` for a document
            generated from the definition's own template and form, `ext` for one
            built around an uploaded file. At least one has to be listed.
          example:
            - ext
          nullable: true
        description:
          type: string
          description: >-
            Description of the document type, maintained by administrators as
            rich text.
          example: Standard contract for external partners.
          nullable: true
        detectSignFields:
          type: boolean
          description: >-
            Whether signature fields are looked for in the uploaded file by
            default. A request that does not say either way follows this flag.
          nullable: true
        displayName:
          type: array
          items:
            $ref: '#/components/schemas/entityDocumentDefinitionsDisplayName'
          description: >-
            Localized names of the document type. With no entry for the reader's
            language the type falls back to its translation key.
          nullable: true
        dualMode:
          type: boolean
          nullable: true
        embedDocIdOnSign:
          type: boolean
          description: >-
            Whether the first signature on a document of this type has to carry
            an annotation with the document's identifier. The signature request
            is refused when it does not.
          nullable: true
        expertMode:
          type: boolean
          description: >-
            Whether administrators may edit the definition's HTML template
            directly instead of only through the visual form editor.
          nullable: true
        fields:
          type: array
          items:
            $ref: '#/components/schemas/entityDocumentDefinitionsField'
          description: >-
            Metadata schema of the document type — every field its documents
            carry, with its kind, its validation and where it is shown. The
            kinds also decide how the values are indexed and searched.
          nullable: true
        form:
          type: array
          items:
            $ref: '#/components/schemas/entityDocumentDefinitionsForm'
          description: >-
            Layout of the metadata form: one entry per section, each naming the
            fields it shows and how wide they are.
          nullable: true
        formMode:
          type: boolean
          description: >-
            Whether the classic form view is offered for composing documents of
            this type. It cannot be turned off together with `inlineMode`.
          nullable: true
        formulaFallback:
          type: boolean
          description: >-
            Whether field formulas are left to the client instead of being
            resolved on the server. They are left to it in any case when
            `backendHtmlRendering` is off.
          nullable: true
        hasStrictFolderPlacement:
          type: boolean
          description: >-
            Whether documents of this type are filed where the type dictates. A
            create request that names a target folder is then refused.
          nullable: true
        htmlFallback:
          type: boolean
          description: >-
            Whether a failed server-side rendering is tolerated and the HTML
            left to the client. Without it the whole operation fails instead.
          nullable: true
        inlineMode:
          type: boolean
          description: >-
            Whether the inline view — the rendered document with its fields
            editable in place — is offered for composing documents of this type.
          nullable: true
        inlineStyle:
          type: string
          description: >-
            Stylesheet placed into the compose and inline views of this document
            type. It is taken as it stands, so the selectors it uses decide what
            it reaches.
          example: '.tpage-part { font-size: 12px; }'
          nullable: true
        isPrivateByDefault:
          type: boolean
          description: >-
            Whether documents of this type start out private, invisible to
            everybody the creator does not share them with. A creator who
            belongs to an organization gets a private document regardless.
          nullable: true
        language:
          type: string
          description: >-
            Language the document type is authored in. Its documents keep it,
            and it decides which of the localized labels administrators edit.
          example: en
          nullable: true
        mobileFriendly:
          type: boolean
          nullable: true
        name:
          type: string
          description: >-
            Identifier of the document type. It is what documents created from
            the definition carry as their type, the suffix of the per-type
            `read_` and `edit_` rights, and the stem of the definition's
            translation keys.
          example: d_default
        organization:
          type: array
          items:
            type: string
          description: >-
            Organizations whose members may use the document type. Somebody
            inside an organization reaches it only when their organization is
            listed, while a user outside every organization is not restricted by
            it; a `system` definition is available either way.
          example:
            - acme_org
          nullable: true
        previewMode:
          type: string
          description: >-
            How a document of this type is presented in the preview pane.
            `normal` shows the document itself, `list` shows its metadata as a
            read-only form for as long as the document is unsigned.
          example: normal
          nullable: true
        sectionMode:
          type: boolean
          description: >-
            Whether the metadata form is broken into sections the user steps
            through instead of one form.
          nullable: true
        showStepNumber:
          type: boolean
          description: >-
            Whether each section heading is numbered. It only means anything
            together with `sectionMode`.
          nullable: true
        signType:
          type: string
          description: >-
            Signature kind documents of this type fall back to: `image` for a
            drawn or uploaded signature image, `signature` for a cryptographic
            signature made with a token or a card. It settles the kind only when
            neither the document nor the signature request does.
          example: image
          nullable: true
        supportsBarcode:
          type: boolean
          description: >-
            Whether the compose screen offers the barcode of the document for
            this type.
          nullable: true
        supportsSignature:
          type: boolean
          nullable: true
        system:
          type: boolean
          description: >-
            Whether the document type is a built-in one. Everybody may see and
            use it, whatever their organization and their per-type rights.
          nullable: true
        template:
          allOf:
            - $ref: '#/components/schemas/entityDocumentDefinitionsTemplate'
          description: >-
            HTML a generated document is built from, split into the header, the
            body and the footer.
          nullable: true
        templateFile:
          type: string
          description: >-
            Hash of an uploaded file every new document of this type starts
            from. The file must not belong to anything else yet — it is claimed
            by the definition on save.
          example: 5gxo31ldfut9ljmnhdb2oxvajf7qndd4vgamt5sla8iwxie0tvtsgu6ksrfpr3e4
          nullable: true
        workflow:
          type: string
          description: >-
            Name of the workflow definition driving documents of this type. A
            document type runs exactly one workflow.
          example: wf_archive
          nullable: true
      required:
        - name
    entityDocumentDefinitionsDisplayName:
      type: object
      properties:
        language:
          type: string
          description: >-
            Language the text belongs to, as a language code. The code may carry
            a suffix naming which text of the element it holds —
            `en.placeholder`, `en.placeholder2` or `en.description` — so a
            single list keeps the label and every secondary text of the element
            together.
          example: en
          nullable: true
        value:
          type: string
          description: >-
            Text shown for the language and role its code selects. English is
            used when the reader's language has no entry, and the element's
            translation key when neither has one.
          example: Expiration date
          nullable: true
    entityDocumentDefinitionsField:
      type: object
      properties:
        allowGroups:
          type: boolean
          nullable: true
        barcodeType:
          type: string
          nullable: true
        class:
          type: string
          nullable: true
        defaultValue:
          type: string
          description: >-
            Value the field starts with. It is a template of the same shape as
            `formula`, resolved by the client once while a new document is being
            set up and only for as long as the field is still empty. A field
            holding several values keeps its whole value here as JSON.
          example: PENDING
          nullable: true
        description:
          type: string
          description: >-
            Explanatory text of the field. For most kinds it only switches on
            the tooltip next to the label, whose text comes from `displayName`
            under the `.description` suffix; a `statictext` field renders that
            text as its body, and an `image` field keeps the hash of the picture
            to show here instead.
          nullable: true
        disabled:
          type: boolean
          description: >-
            Whether the field is read-only. On its own it locks the field for
            good; together with `disabledCondition` it locks it only while that
            condition holds.
          nullable: true
        disabledCondition:
          type: string
          description: >-
            Expression narrowing `disabled` down to the cases where it evaluates
            true. The client evaluates it against the document being filled in,
            where `model.<field>` reaches the value of another field; it means
            nothing unless `disabled` is set.
          example: model.GF_STATUS === 'closed'
          nullable: true
        displayName:
          type: array
          items:
            $ref: '#/components/schemas/entityDocumentDefinitionsDisplayName'
          description: >-
            Localized texts of the field — its label, and under the suffixed
            language codes its placeholders and its explanatory text as well.
            With no entry for the reader's language the field falls back to its
            translation key.
          nullable: true
        dynamic:
          type: boolean
          description: >-
            Whether a `list` field lets the user add a record to the enumeration
            it offers, straight from the select.
          nullable: true
        formula:
          type: string
          description: >-
            Template computing the field's value: literal text mixed with `{{
            }}` expressions over the document, where `model.<field>` reaches
            another field and values such as `date`, `sysdate`, `user` and `id`
            are available alongside helpers such as `translate` or
            `selectFromList`. It is resolved over and over until the values
            settle, and it never overwrites a field the user has filled in by
            hand.
          example: '{{ (''documents:'' + form.name) | translate }} #{{id}}'
          nullable: true
        formulaRefreshCondition:
          type: array
          items:
            type: string
            nullable: true
          description: >-
            Ways of opening an existing document in which the formula may still
            overwrite the stored value — `edit`, `rework`, `clone`, `signClone`
            or `sign`. Opened any other way, the stored value stands and the
            field counts as filled in by hand.
          example:
            - edit
            - rework
          nullable: true
        groupFilter:
          type: string
          description: >-
            Expression whose result narrows a `select_user` field down to the
            members of the groups it names.
          nullable: true
        inline:
          type: boolean
          description: >-
            Whether a `checkbox` or `radio` field lays its options out in a
            single row instead of stacking them.
          nullable: true
        inlineStyle:
          type: string
          description: >-
            CSS properties applied to the field, written as a JSON object in a
            string.
          example: '{"color":"#ff0000","font-weight":"bold"}'
          nullable: true
        isContentDependent:
          type: boolean
          description: >-
            Whether the field belongs to what the signatures cover. Changing it
            on a document that is signed or waiting for signatures counts as
            changing the document itself, which cancels the share links already
            handed out and has the document rendered again.
          nullable: true
        isExportable:
          type: boolean
          description: >-
            Whether the field becomes a column when documents of this type are
            exported into a spreadsheet. Only some of the field kinds are
            exported at all, so switching this on does not put every field into
            the export.
          nullable: true
        isFulltext:
          type: boolean
          description: >-
            Whether the field's text belongs to the searchable content of the
            document. The server gathers the marked fields into the definition's
            `contentFields`, and fulltext search matches and highlights them.
          nullable: true
        isGlobal:
          type: boolean
          description: >-
            Whether the field is an instance of a global field from the shared
            catalogue rather than one owned by this definition. Such a field
            keeps the catalogue's `GF_` name and is set up with the enumeration,
            the validation and the multi-value setting the catalogue holds for
            it.
          nullable: true
        isIndex:
          type: boolean
          description: >-
            Whether a document cannot be stored while the field is empty. It has
            that effect only together with `required`.
          nullable: true
        isQuery:
          type: boolean
          nullable: true
        isRole:
          type: boolean
          description: >-
            Whether the field holds users who are to be recorded among the
            document's users, next to its owner and its creator.
          nullable: true
        listKey:
          type: string
          description: >-
            Property of the offered enumeration's records that a `list` field
            stores and shows as the option.
          example: priority
          nullable: true
        listName:
          type: string
          description: >-
            Enumeration whose records a `list` field offers. Exporting the
            definition takes the enumeration along.
          example: priorities
          nullable: true
        listTooltip:
          type: string
          description: >-
            Second property of the same enumeration's records, shown as the
            secondary line under each offered option. It names a property; it is
            not the text itself.
          example: description
          nullable: true
        maskRegex:
          type: string
          description: >-
            Input mask of the field, as a JSON object in a string naming the
            mask and its options. Setting it also turns a numeric field into a
            masked text input.
          example: '{"selectedMask":"decimal","alias":"decimal","digits":2}'
          nullable: true
        maskResult:
          type: string
          description: >-
            What a masked field stores: `masked` and `none` keep the mask
            characters, `unmasked` strips them, and any other value serves as
            the replacement of a regular-expression replace over the typed
            value. Left empty, a masked field stores the same as `unmasked`.
          example: unmasked
          nullable: true
        maxDate:
          type: string
          description: >-
            Latest date a `date` or `date_range` field accepts, as an expression
            or as a plain date. The result is taken to the end of that day.
          example: '2026-12-31'
          nullable: true
        maxValue:
          type: number
          nullable: true
        minDate:
          type: string
          description: >-
            Earliest date a `date` or `date_range` field accepts, as an
            expression or as a plain date. The result is taken to the start of
            that day.
          example: '{{ sysdate }}'
          nullable: true
        minValue:
          type: number
          nullable: true
        multiselect:
          type: boolean
          description: Whether a `list` or `select_user` field takes more than one value.
          nullable: true
        name:
          type: string
          description: >-
            Identifier of the field and the key its value is stored under. A
            field from the global catalogue keeps its `GF_` name; any other is
            uppercased and prefixed with the definition's name on save, apart
            from the system fields `documentTitle`, `documentId`, `createName`
            and `createDate`, which are left alone.
          example: D_DEFAULT_DESCRIPTION
          nullable: true
        options:
          type: array
          items:
            type: string
            nullable: true
          description: >-
            Choices a `checkbox` or `radio` field offers, and the two captions
            of a `toggle` field, the off one first. A `list` field takes its
            choices from `listName` instead.
          example:
            - low
            - medium
            - high
          nullable: true
        order:
          type: integer
          nullable: true
        placeholder:
          type: string
          description: >-
            Placeholder of the field. It mostly acts as a switch — the text
            shown comes from `displayName` under the `.placeholder` suffix —
            while the search form and a `richtext` field build a translation key
            out of the value itself.
          example: Document title
          nullable: true
        placeholder2:
          type: string
          description: >-
            The same for the closing input of a field offered as a range — a
            `date_range` field, and a `date` field in the search form — whose
            text comes from `displayName` under the `.placeholder2` suffix.
          example: Valid until
          nullable: true
        predefinedDateRanges:
          type: array
          items:
            $ref: '#/components/schemas/entityDocumentDefinitionsPredefinedDateRanges'
          description: >-
            Ranges offered as quick picks beside the calendar of a `date_range`
            field.
          nullable: true
        prefill:
          type: string
          nullable: true
        prefilled:
          type: boolean
          nullable: true
        regex:
          type: string
          nullable: true
        regexValue:
          type: string
          nullable: true
        required:
          type: boolean
          description: >-
            Whether the definition treats a value for the field as mandatory.
            The platform holds a document back over it only together with
            `isIndex`; what marks the field mandatory in the form is a
            `required` rule in `validation`.
          nullable: true
        role:
          type: string
          nullable: true
        searchType:
          type: string
          description: >-
            Type the value is indexed under for searching. The server derives it
            from `type`, so a submitted value is overwritten, and it is left out
            for the system fields, which are stored outside the document's own
            metadata.
          example: date
          nullable: true
        showInDetail:
          type: boolean
          description: Whether the field is shown in the document's detail panel.
          nullable: true
        showInDetailCondition:
          type: string
          description: >-
            Expression deciding whether the field appears in the detail panel,
            on top of `showInDetail`. The client evaluates it against the
            document, where `model.<field>` reaches the value of another field;
            left empty, the field is always shown.
          example: model.D_DEFAULT_DESCRIPTION
          nullable: true
        showInIndex:
          type: boolean
          description: >-
            Whether the field is part of the document form — the form a document
            is composed, edited and filled in through.
          nullable: true
        showInIndexCondition:
          type: string
          description: >-
            Expression deciding whether the field appears in the document form,
            on top of `showInIndex`. The client evaluates it against the
            document being filled in, where `model.<field>` reaches the value of
            another field; left empty, the field is always shown.
          example: model.D_DEFAULT_CATEGORY === 'invoice'
          nullable: true
        showInQuery:
          type: boolean
          description: Whether the field is offered as a filter in advanced search.
          nullable: true
        showInQueryCondition:
          type: string
          description: >-
            Expression deciding whether the field is offered in the search form,
            on top of `showInQuery`. The client evaluates it the same way as the
            other conditions; left empty, the field is always offered.
          nullable: true
        showInTemplate:
          type: boolean
          nullable: true
        showLabel:
          type: boolean
          description: >-
            Whether the field's label is rendered above it. A `statictext` and
            an `image` field never carry one.
          nullable: true
        showLabelInTemplate:
          type: boolean
          nullable: true
        type:
          type: string
          description: >-
            Kind of the field, deciding both the control the user gets and how
            the value is indexed: `text`, `richtext`, `keyword`, `number`,
            `integer`, `date`, `date_range`, `checkbox`, `radio`, `toggle`,
            `list`, `select_user`, `image`, `statictext`, or `empty` for a
            spacer that holds no value.
          example: date
          nullable: true
        userFilter:
          type: string
          description: >-
            Expression whose result narrows a `select_user` field down to the
            users with the e-mail addresses it names.
          nullable: true
        validation:
          type: array
          items:
            $ref: '#/components/schemas/entityDocumentDefinitionsValidation'
          description: >-
            Rules the client checks the value against while the form is filled
            in.
          nullable: true
    entityDocumentDefinitionsForm:
      type: object
      properties:
        displayName:
          type: array
          items:
            $ref: '#/components/schemas/entityDocumentDefinitionsDisplayName'
          description: >-
            Localized headings of the section. With no entry for the reader's
            language the section falls back to its translation key.
          nullable: true
        fields:
          type: array
          items:
            $ref: '#/components/schemas/entityDocumentDefinitionsFormField'
          description: Fields the section shows, in the order they are laid out.
          nullable: true
        inlineStyle:
          type: string
          description: >-
            CSS properties applied to the section, written as a JSON object in a
            string.
          example: '{"background-color":"#f5f5f5","padding":"12px"}'
          nullable: true
        name:
          type: string
          description: >-
            Identifier of the section within the definition, and the stem of its
            translation key. On save it is lowercased and prefixed with the
            definition's name unless it already starts with it.
          example: d_default_section_0
          nullable: true
        showInIndex:
          type: boolean
          description: Whether the section is part of the document form at all.
          nullable: true
        showInIndexCondition:
          type: string
          description: >-
            Expression deciding whether the section is shown, on top of
            `showInIndex`. The client evaluates it against the document being
            filled in, where `model.<field>` reaches the value of a field; left
            empty, the section is always shown.
          example: model.D_DEFAULT_CATEGORY === 'invoice'
          nullable: true
        showLabel:
          type: boolean
          description: Whether the section's heading is rendered above its fields.
          nullable: true
    entityDocumentDefinitionsTemplate:
      type: object
      properties:
        content:
          type: string
          description: >-
            Body of the generated document, as HTML rendered on its first page.
            Its inputs are tied to the definition's fields through
            `data-model="model.<field>"`, and the placeholder `[[DOC_ID]]` is
            replaced with the identifier of the document being created.
          example: >-
            <div class="tpage-part"><div
            class="col-lg-12"><strong>Title</strong>: <input type="text"
            data-model="model.documentTitle"/></div></div>
          nullable: true
        footer:
          type: string
          description: >-
            HTML rendered at the bottom of every page of the generated document,
            typically the letterhead's footer image.
          nullable: true
        header:
          type: string
          description: >-
            HTML rendered at the top of every page of the generated document,
            typically the letterhead's header image.
          nullable: true
    entityDocumentDefinitionsPredefinedDateRanges:
      type: object
      properties:
        endDate:
          type: string
          description: Date the offered range ends on.
          example: '2025-12-31'
          nullable: true
        name:
          type: string
          description: >-
            Label of the button that offers the range. It is resolved as a
            translation key first, so a plain text is shown as it stands when
            nothing matches it.
          example: Fiscal year 2025
          nullable: true
        startDate:
          type: string
          description: Date the offered range starts on.
          example: '2025-01-01'
          nullable: true
    entityDocumentDefinitionsValidation:
      type: object
      properties:
        message:
          type: string
          description: Translation key of the message belonging to the rule.
          example: required_standard
          nullable: true
        parameter:
          type: string
          description: >-
            Argument of the rule, always written as a string — the length for
            `minLength`, the bound for `greaterThan` and `lessThan`, the pattern
            for `regexp`. Rules taking no argument leave it empty.
          example: ^[A-Z]{2}[0-9]{6}$
          nullable: true
        type:
          type: string
          description: >-
            Rule applied to the value. The built-in editor produces `required`,
            `required2` for the closing end of a date range, `minLength`,
            `regexp`, `numeric`, `integer`, `greaterThan`, `lessThan` and
            `notEqual`, and a field taken from the global catalogue may bring a
            rule of a kind of its own. The rules guide the client while the form
            is filled in; the platform stores them as they come and does not
            enforce them on the stored document.
          example: regexp
          nullable: true
    entityDocumentDefinitionsFormField:
      type: object
      properties:
        name:
          type: string
          description: >-
            Field placed at this position, named as in the definition's
            `fields`.
          example: D_DEFAULT_DESCRIPTION
        size:
          type: integer
          minimum: 1
          maximum: 12
          description: >-
            Width the field takes in the section's twelve-column row — three
            fields of `4` fill one row, a field of `12` takes a row of its own.
          example: 12
      required:
        - name
        - size
  securitySchemes:
    Token:
      type: apiKey
      in: query
      name: token
      description: >-
        Standard authorization for most API calls. This token identifies the
        logged-in user and their permissions. It is obtained either as a
        temporary token after a successful login or as a long-term API key.

````

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