> ## 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.

# Create a workflow definition

> `POST /definitions/workflows`

Defines a new workflow: the states a document can be in, the actions and requests that move it between them, and which state it starts, cancels and reworks in. A metadata definition then points at it by name to put its document type on that lifecycle.

The workflow is stored as given; nothing checks that every `stateId` an action refers to actually exists among the states, so a definition can be saved into a shape that strands documents. Transitions can be put behind rights afterwards with `PUT /definitions/workflows/{name}/restrict`.

---

**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 post /definitions/workflows
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/workflows:
    post:
      tags:
        - Definitions
      summary: Create a workflow definition
      description: >-
        `POST /definitions/workflows`


        Defines a new workflow: the states a document can be in, the actions and
        requests that move it between them, and which state it starts, cancels
        and reworks in. A metadata definition then points at it by name to put
        its document type on that lifecycle.


        The workflow is stored as given; nothing checks that every `stateId` an
        action refers to actually exists among the states, so a definition can
        be saved into a shape that strands documents. Transitions can be put
        behind rights afterwards with `PUT
        /definitions/workflows/{name}/restrict`.


        ---


        **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: requestDefinitionsPostWorkflow
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/requestDefinitionsPostWorkflow'
      responses:
        '200':
          description: The workflow definition was created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseGenericStatus'
        '400':
          description: >-
            The request body is invalid - a missing name, a duplicate state or
            transition id, for example.
          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
        '409':
          description: A workflow of that name already exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              example:
                status: 409
                type: RESOURCE:STATE_CONFLICT
                message: Resource state conflict
                requestId: 3fa85f6457174562b3fc2c963f66afa6
      security:
        - Token: []
components:
  schemas:
    requestDefinitionsPostWorkflow:
      type: object
      properties:
        actions:
          type: array
          items:
            $ref: '#/components/schemas/requestDefinitionsWorkflowAction'
          description: >-
            Moves a recipient carries out themselves, each one taking the
            document from the state it is offered in to the state it names. This
            is also the only kind of transition that can archive the document.
        cancelStateId:
          type: integer
          minimum: 0
          description: >-
            State a document is moved into when it is cancelled, which also
            archives it and hands it back to whoever cancelled it. Leave it out
            and the workflow simply cannot be cancelled.
        name:
          type: string
          minLength: 1
          description: >-
            Name the workflow is known by. It identifies the definition, a
            metadata definition binds its documents to it by this name, and the
            rights that gate its transitions are named after it - so renaming a
            workflow leaves both the documents and the rights pointing at
            something that is no longer there.
          example: wf_archive
        requests:
          type: array
          items:
            $ref: '#/components/schemas/requestDefinitionsWorkflowRequest'
          description: >-
            Moves a recipient raises for somebody else to answer, rather than
            completing a step themselves. They are recorded in the document's
            history as requests, and each counts as having been sent out unless
            its script says otherwise.
        reworkStateId:
          type: integer
          minimum: 0
          description: >-
            State a document returns to once a rework request has been answered,
            together with the recipient who raised that request. It is only of
            use alongside a request marked for rework.
        scheduledTransition:
          allOf:
            - $ref: >-
                #/components/schemas/requestDefinitionsWorkflowScheduledTransition
          description: >-
            Accepted but not stored - a scheduled transition belongs to an
            individual state, so set it on the entry in `states` that should
            advance on its own.
        startStateId:
          type: integer
          minimum: 0
          description: >-
            State a document lands in when it is created, and the one it is put
            back into when its workflow is reset. It is also the state whose
            moves are listed when a client asks what is possible without naming
            one.
        states:
          type: array
          items:
            $ref: '#/components/schemas/requestDefinitionsWorkflowState'
          description: >-
            Every state a document running this workflow can sit in. A state is
            named by its own identifier, and two states may share neither that
            identifier nor their name.
      required:
        - name
        - startStateId
        - states
    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
    requestDefinitionsWorkflowAction:
      type: object
      properties:
        allowedAddressingGroups:
          type: boolean
          description: Whether the client offers groups among the recipients of this move.
          example: true
          default: true
          nullable: true
        allowedAddressingUsers:
          type: boolean
          description: >-
            Whether the client offers individual accounts among the recipients
            of this move.
          example: true
          default: true
          nullable: true
        allowedGroups:
          type: array
          items:
            type: string
          description: List of groups which can be addressed in this request.
          nullable: true
        allowedUsers:
          type: array
          items:
            type: string
            pattern: ^[A-Za-z0-9.@_+-]+$
            minLength: 1
            example: john.doe+member@example.com
          description: List of users who can be addressed in this request.
          nullable: true
        allowExternal:
          type: boolean
          description: >-
            Lets the client offer contacts and plain e-mail addresses as
            recipients, not only accounts of the platform. It shapes what is
            offered rather than what is accepted.
          nullable: true
        archive:
          type: boolean
          description: >-
            Closes the document's workflow: it is marked archived, its
            recipients are cleared and whoever started the workflow is told it
            has finished. An archiving action need name no recipient, whatever
            `recipient` says.
        autoSign:
          type: boolean
          description: >-
            Signs the document on the caller's behalf as the move runs, from the
            signature or initials stored on their profile, instead of asking
            them for signature data. Only fields left open for automatic signing
            are filled, and only those of the earliest round still outstanding;
            a caller whose profile carries no such image is refused.
          nullable: true
        commentForbidden:
          type: boolean
          description: >-
            Tells the client to carry the move out straight away rather than
            asking for a comment first. It takes hold only where no recipient
            has to be named; otherwise the client still has to ask, and merely
            leaves the comment box out.
          nullable: true
        commentRequired:
          type: boolean
          description: Refuses the move unless a comment comes with it.
          nullable: true
        composeTemplate:
          type: array
          items:
            type: string
            nullable: true
          description: >-
            Turns the move into a way of starting a new document linked back to
            this one: choosing it opens the composer first, and the move is
            carried out once that document has been submitted. Naming a single
            metadata definition takes the author straight into it, `#all` offers
            every definition, a name prefixed with `@` offers a whole definition
            type, and several entries offer a choice.
          example:
            - d_invoice
          nullable: true
        following:
          type: string
          description: >-
            Free-form label stored on the action. It is copied onto a document's
            last-action summary when the action is performed, so changing it
            here reaches a document only on its next workflow event. Nothing in
            the backend acts on its value.
          nullable: true
        groupFilter:
          type: string
          description: >-
            The same for groups: an expression the client evaluates against the
            document to narrow the groups it offers as recipients.
          nullable: true
        id:
          type: integer
          minimum: 0
          description: >-
            Handle a caller names to carry this move out, and what the
            document's history records it as. It has to be unique across the
            workflow's actions and requests together, not only within its own
            list - nothing checks that, and a clash leaves one of the two
            unreachable.
        important:
          type: boolean
          description: >-
            Gives the move a button of its own rather than a place in the
            overflow menu. A move the client can single out as the answer to an
            open request takes precedence over it, and a lone move is given a
            button whether or not it asks for one.
          example: false
          default: false
        multipleReceivers:
          type: boolean
          description: >-
            Lets the client offer more than one recipient when this move is
            carried out. It shapes what is offered rather than what is accepted.
          nullable: true
        multipleSignFieldUsers:
          type: boolean
          description: >-
            Lets a sign field placed with this move be assigned to several
            signers instead of one.
          nullable: true
        name:
          type: string
          description: >-
            Name the move is shown and recorded under in the document's history.
            It is also what the endpoints that restrict and unrestrict a
            transition address it by, and they match on it alone - so two
            transitions of the same kind sharing a name are restricted together.
        nextState:
          type: integer
          minimum: 0
          description: >-
            State the document is moved into. A transition script may name a
            different one instead, but between the two there has to be an answer
            - a move that ends up with no next state is refused when it runs.
        order:
          type: integer
          description: >-
            Where the move sits among the others offered at the same time; the
            buttons and the overflow menu are each ordered by it on their own.
        predefinedReceiver:
          type: boolean
          description: Does this action have predefined receiver?
          nullable: true
        receiver:
          type: string
          description: Name of receivers.
          nullable: true
        recipient:
          type: boolean
          description: >-
            Whether the move has to name somebody to hand the document on to.
            Without it the document is addressed back to whoever carried the
            move out; with it and nobody named, the move is refused - unless it
            archives, which waives the requirement.
        rights:
          type: string
          description: >-
            Right a caller has to hold to use this move; left empty, anyone
            reaching the document may use it. It is not a free label - it has to
            name a right seeded for this workflow, and one that does not exist
            can be granted to nobody, which puts the move out of everyone's
            reach.
        send:
          type: boolean
          description: >-
            Records the move in the history as having been sent out, and marks
            the document unread for everybody again so that it shows up as new.
          nullable: true
        sentiment:
          type: string
          description: Sentiment (meaning) of the action.
          enum:
            - positive
            - negative
            - neutral
            - hidden
          example: neutral
          default: neutral
        signAction:
          type: boolean
          description: >-
            Makes the move a signing step: signature data has to come with it,
            and the move is refused without any. It is what lets the signer
            place their signature themselves.
          nullable: true
        signFields:
          type: boolean
          description: >-
            Marks the move as one that deals with sign fields, which lets it
            sign a document whose state does not otherwise allow signing, and
            sends the client into its signing screen.
          nullable: true
        stateId:
          type: integer
          minimum: 0
          description: >-
            State the move is offered in. Nothing checks that such a state
            exists, so a typo simply leaves the move unreachable.
        transitionAction:
          type: string
          description: >-
            Script run when the move is carried out. It can override most of
            what is declared here - the next state, the recipients, whether the
            document is archived or sent, whether it is signed - and can reach
            further than the declarations do: writing document fields and
            re-rendering the file, sending mail and SMS, granting rights, filing
            the document, assigning sign fields, linking documents and sealing.
        userFilter:
          type: string
          description: >-
            Expression the client evaluates against the document to work out
            which accounts to offer as recipients, so that the choice can depend
            on what the document holds.
          nullable: true
      required:
        - archive
        - id
        - name
        - nextState
        - recipient
        - stateId
    requestDefinitionsWorkflowRequest:
      type: object
      properties:
        allowedAddressingGroups:
          type: boolean
          description: >-
            Whether the client offers groups among the recipients of this
            request.
          example: true
          default: true
          nullable: true
        allowedAddressingUsers:
          type: boolean
          description: >-
            Whether the client offers individual accounts among the recipients
            of this request.
          example: true
          default: true
          nullable: true
        allowedGroups:
          type: array
          items:
            type: string
          description: List of groups which can be addressed in this request.
          nullable: true
        allowedUsers:
          type: array
          items:
            type: string
            pattern: ^[A-Za-z0-9.@_+-]+$
            minLength: 1
            example: john.doe+member@example.com
          description: List of users who can be addressed in this request.
          nullable: true
        allowExternal:
          type: boolean
          description: >-
            Lets the client offer contacts and plain e-mail addresses as
            recipients, not only accounts of the platform. It shapes what is
            offered rather than what is accepted.
          nullable: true
        autoSign:
          type: boolean
          description: >-
            Signs the document on the caller's behalf as the request is raised,
            from the signature or initials stored on their profile, instead of
            asking them for signature data. Only fields left open for automatic
            signing are filled, and only those of the earliest round still
            outstanding; a caller whose profile carries no such image is
            refused.
        commentForbidden:
          type: boolean
          description: >-
            Tells the client to raise the request straight away rather than
            asking for a comment first. It takes hold only where no recipient
            has to be named; otherwise the client still has to ask, and merely
            leaves the comment box out.
          nullable: true
        commentRequired:
          type: boolean
          description: Refuses the request unless a comment comes with it.
          nullable: true
        composeTemplate:
          type: array
          items:
            type: string
            nullable: true
          description: >-
            Turns the request into a way of starting a new document linked back
            to this one: choosing it opens the composer first, and the request
            is carried out once that document has been submitted. Naming a
            single metadata definition takes the author straight into it, `#all`
            offers every definition, a name prefixed with `@` offers a whole
            definition type, and several entries offer a choice.
          nullable: true
        groupFilter:
          type: string
          description: >-
            The same for groups: an expression the client evaluates against the
            document to narrow the groups it offers as recipients.
        id:
          type: integer
          minimum: 0
          description: >-
            Handle a caller names to raise this request, and what the document's
            history records it as. It has to be unique across the workflow's
            actions and requests together, not only within its own list -
            nothing checks that, and a clash with an action leaves the request
            unreachable.
        important:
          type: boolean
          description: >-
            Gives the request a button of its own rather than a place in the
            overflow menu. A move the client can single out as the answer to an
            open request takes precedence over it, and a lone move is given a
            button whether or not it asks for one.
          example: false
          default: false
        multipleReceivers:
          type: boolean
          description: >-
            Lets the client offer more than one recipient when this request is
            raised. It shapes what is offered rather than what is accepted.
          nullable: true
        multipleSignFieldUsers:
          type: boolean
          description: >-
            Lets a sign field placed with this request be assigned to several
            signers instead of one.
          nullable: true
        name:
          type: string
          description: >-
            Name the request is shown and recorded under in the document's
            history. It is also what the endpoints that restrict and unrestrict
            a transition address it by, and they match on it alone - so two
            transitions of the same kind sharing a name are restricted together.
        order:
          type: integer
          description: >-
            Where the request sits among the other moves offered at the same
            time; the buttons and the overflow menu are each ordered by it on
            their own.
        predefinedReceiver:
          type: boolean
          description: Does this action have predefined receiver?
          nullable: true
        receiver:
          type: string
          description: Name of receiver.
          nullable: true
        recipient:
          type: boolean
          description: Whether raising this request needs somebody to address it to.
          nullable: true
        resolvedBy:
          type: integer
          minimum: 0
          description: >-
            Id of the action that answers this request. It is what the rights of
            the answering action are looked up through, so that the requester
            can be told who is able to resolve it.
          nullable: true
        revertSignatures:
          type: boolean
          description: >-
            Discards the signatures on the document, putting its file back to
            the state recorded in its current revision. It is refused in a state
            that is read only, and does nothing where the revision already holds
            the same file.
        rework:
          type: boolean
          description: >-
            Marks the request as a call to rework the document. Answering it
            sends the document back to the workflow's rework state and to
            whoever raised the request, so it is only of use where that state is
            set.
          example: false
          default: false
        rights:
          type: string
          description: >-
            Right a caller has to hold to raise this request; left empty, anyone
            reaching the document may raise it. It is not a free label - it has
            to name a right seeded for this workflow, and one that does not
            exist can be granted to nobody, which puts the request out of
            everyone's reach.
        sentiment:
          type: string
          description: Sentiment (meaning) of the action.
          enum:
            - positive
            - negative
            - neutral
            - hidden
          example: neutral
          default: neutral
        signAction:
          type: boolean
          description: >-
            Makes the request a signing step: signature data has to come with
            it, and it is refused without any. It is what lets the signer place
            their signature themselves.
          nullable: true
        signFields:
          type: boolean
          description: >-
            Marks the request as one that deals with sign fields, which lets it
            sign a document whose state does not otherwise allow signing, and
            sends the client into its signing screen.
          nullable: true
        stateId:
          type: integer
          minimum: 0
          description: >-
            State the request can be raised in. Nothing checks that such a state
            exists, so a typo simply leaves it unreachable.
        transitionAction:
          type: string
          description: >-
            Script run when the request is raised. It can override most of what
            is declared here - the next state, the recipients, whether the
            document is sent, whether it is signed - and can reach further than
            the declarations do: writing document fields and re-rendering the
            file, sending mail and SMS, granting rights, filing the document,
            assigning sign fields, linking documents and sealing.
        userFilter:
          type: string
          description: >-
            Expression the client evaluates against the document to work out
            which accounts to offer as recipients, so that the choice can depend
            on what the document holds.
      required:
        - id
        - name
        - stateId
    requestDefinitionsWorkflowScheduledTransition:
      type: object
      properties:
        actionId:
          type: number
          description: >-
            Move to carry out when the time comes. It runs as the single
            recipient then holding the document - a document addressed to a
            group, or to more than one person, is passed over instead.
          example: 3
        after:
          type: number
          description: >-
            How long to wait, in seconds, counted from the moment the document
            entered the state. It takes precedence over `when`.
          example: 86400
        when:
          type: string
          description: >-
            Field of the document holding the date to act on, used when no fixed
            delay is given. A name beginning with `GF_` is taken as a global
            field; any other name is resolved within the document's own metadata
            definition. The field is watched rather than read once, so editing
            the date later moves the schedule with it.
          example: dueDate
    requestDefinitionsWorkflowState:
      type: object
      properties:
        isAutomatic:
          type: boolean
          description: >-
            Marks a state the document does not come to rest in: on entering it
            the server carries out the one move leading away from it, with
            nobody being asked. Exactly one move may lead out of such a state,
            and these states chain, so a document can pass through several
            before it stops.
        isEditable:
          type: boolean
          description: >-
            Whether a document standing in this state may have its content and
            title changed. It has to be granted explicitly - a state that says
            nothing about it does not allow editing.
          nullable: true
        isReadOnly:
          type: boolean
          description: >-
            Freezes a document standing in this state: it can be neither edited
            nor renamed nor signed, and a transition that would change its
            signatures is refused.
          nullable: true
        isSignable:
          type: boolean
          description: >-
            Whether signatures, annotations and images may be added to a
            document standing in this state. Like editing, it has to be granted
            explicitly. A transition that is itself a signing step is allowed
            through regardless.
          nullable: true
        reconstructSignatures:
          type: boolean
          description: >-
            For a document the platform renders itself: keeps the annotations
            and images already placed on it and puts them back once the file has
            been regenerated - whether by an edit or by a transition - instead
            of losing them. A transition that would have to rebuild a document
            carrying real signatures, initials or stamps is refused instead.
          nullable: true
        scheduledTransition:
          allOf:
            - $ref: >-
                #/components/schemas/requestDefinitionsWorkflowScheduledTransition
          description: >-
            A move to carry out on its own once the document has been sitting
            here long enough. It is armed every time a document enters the state
            - and a state that declares none clears whatever was pending.
        stateId:
          type: integer
          minimum: 0
          description: >-
            Identifier of the state, unique within the workflow. It is what the
            document stores to say where it stands, and what every transition
            names to say where it applies.
        stateName:
          type: string
          minLength: 1
          description: >-
            Name the state is shown and searched under, and the key its
            translation is looked up by. It is copied onto the document as it
            enters the state, so renaming a state does not rewrite the documents
            already sitting in it.
      required:
        - isAutomatic
        - stateId
        - stateName
  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.