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

# Upload a file

> `POST /files`

Uploads a file to Circularo and returns an identifier you can reference wherever a file is needed — for example when creating a document. Upload a file once and reuse its identifier as often as you need.

Files are uploaded as `multipart/form-data`. A file is stored on its own and only takes on a role once you reference it from another resource.

When the file is a PDF you can include signature anchors to have Circularo locate text in it and return the positions where signature fields should be placed — a convenient alternative to computing coordinates yourself.



## OpenAPI

````yaml /api-v2/openapi.json post /files
openapi: 3.0.3
info:
  title: Circularo API v2
  description: >-
    Circularo API v2 gives programmatic access to Circularo, the platform for
    intelligent document management, electronic and digital signing, and the
    signing and approval processes that move your documents forward.


    Use this API to embed Circularo directly into your own products and systems:
    automate the document lifecycle end to end, send documents out to be signed
    and approved, collect the evidence of what happened, manage users and
    access, and stay in sync through real-time events.


    ## Capabilities


    * **Documents:** Create, organize, and search documents, then seal or
    annotate them, clone them, and create a shareable view link — with a
    tamper-proof audit trail behind every one.

    * **Transactions:** Send a document to one or more recipients to be signed,
    approved, reviewed, or accepted — in parallel or in a set order, with
    identity verification for recipients who have no Circularo account — or sign
    it yourself. Track a running transaction, remind, replace or remove its
    recipients, and cancel it.

    * **Templates:** Start a transaction from a template prepared in the
    Circularo web app, with its placed fields and recipient roles already laid
    out for you.

    * **Files, folders & metadata:** Upload reusable files, describe documents
    with metadata definitions, and organize them into personal or shared
    folders.

    * **Exports:** Download a document together with its audit trail and
    certificate of fulfillment, or have a whole folder tree, a filtered set of
    documents, or your own account data archived in the background.

    * **Administration:** Provision and manage the members of your organization,
    control who belongs to which group, and review a complete audit log of
    activity.

    * **Reporting:** Read organization-wide reports and predefined analytics
    dashboards.

    * **Real-time events:** Subscribe to webhooks to react the moment a document
    is created, signed, or completed.


    ## Authentication


    Authenticate every request with a long-lived API key. Create your first key
    from the Circularo web app, then create, list, and revoke additional keys
    through this API. Read `GET /me` to see which account a key belongs to and
    what it is allowed to do.
  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/v2
security:
  - ApiKey: []
tags:
  - name: API Keys
    description: >-
      An API key is the long-lived, secret credential your integration uses to
      authenticate with Circularo. A key stays valid as long as it is in regular
      use; store it securely, and revoke any key that is no longer needed or may
      have been exposed.
  - name: Audit Logs
    description: >-
      The audit log is the record of actions taken across your organization —
      who did what, to which entity, and when. Search and page through it,
      filtering by actor, activity, target and time range, with an offset for
      shallow access or an opaque cursor for deep traversal and exports.
  - name: Dashboards
    description: >-
      Dashboards are your organization's predefined analytics — document and
      transaction metrics aggregated for reporting and visualization. List the
      dashboards your account can access, then run one to read back its labeled,
      chart-ready data series.
  - name: Documents
    description: >-
      A document combines a main file with metadata, custom fields, and optional
      attachments — the central object you create, search, and manage in
      Circularo. Act on a document directly by sealing or annotating it, clone
      it, read the text of its main file, or create a shareable view link, and
      organize it into folders. Every document carries a transaction identifier
      for tracking its signing or approval process.
  - name: Exports
    description: >-
      An export job packages your documents, folders, or account data into a
      downloadable ZIP archive in the background. Create an export from the
      respective resource, poll it here until it completes, then download the
      resulting archive by its file identifier.
  - name: Files
    description: >-
      A file is a reusable binary you upload once and then reference by its
      identifier wherever a file is needed — as a document's main file, an
      attachment, or an image placed on a page. Upload files and download them
      again; for PDFs, you can also locate signature anchors at upload time.
  - name: Folders
    description: >-
      A folder organizes your documents into a tree — your personal tree, which
      is yours alone, or your organization's shared tree. Nest folders under one
      another, move them within their tree, and search across them to build and
      navigate the structure that fits your workflow.
  - name: Groups
    description: >-
      A group bundles the permissions and access granted to its members —
      including your organization itself, which is represented as a group.
      Browse the groups in your organization and manage who belongs to them.
      Both require organization administrator permissions.
  - name: Me
    description: >-
      The account that your API key belongs to — your identity, role, granted
      permissions, locale preferences, and account status. Read it to discover
      which account a key is connected to and what it is allowed to do.
  - name: Metadata Definitions
    description: >-
      A metadata definition describes the structure of a document — the metadata
      fields it accepts — so you know which metadata to supply when creating or
      working with documents. Browse the definitions available to your account.
  - name: Ping
    description: >-
      Check that Circularo API v2 is reachable and responding. Use it from your
      monitoring or before an integration run to verify connectivity. No
      authentication is required.
  - name: Reports
    description: >-
      A report is an organization-wide view over your documents and their
      transactions — each row pairs a document with the status, timing, activity
      counts and recipients of its transaction, for auditing signing activity,
      tracking processing times, and feeding compliance and analytics tooling.
      Filter by creation time, transaction status, metadata definition,
      category, creator and owner, and page through results with an offset or an
      opaque cursor.
  - name: Templates
    description: >-
      A template is a reusable blueprint for creating transactions, prepared in
      the Circularo web app. Every template carries document defaults — a source
      file, a name and a metadata definition; a signing template additionally
      carries the placed fields and defines the recipient roles and their
      routing. Browse the templates available to your account, then create a
      transaction from one by referencing it and casting recipients into its
      roles.
  - name: Transactions
    description: >-
      A transaction gets a document signed, approved, reviewed or accepted — by
      other people, by yourself, or both. Start one on an existing document or
      create the document in the same call; send it to recipients, defining who
      takes part, what each of them is asked to do, and optional verification
      for recipients without a Circularo account — or sign it yourself, which
      completes the transaction immediately. Once it is running, track its
      progress, remind recipients, update or reassign them, and cancel it when
      it is no longer needed. Transactions have no separate search — find them
      by searching your documents, each of which carries its transaction's
      status and pending recipients.
  - name: Users
    description: >-
      A user is a member of your organization. What they may do is set through
      their role, while the organization is assigned automatically.
      Provisioning, updating, and removing members requires organization
      administrator permissions.
  - name: Webhooks
    description: >-
      A webhook subscribes your systems to document events in your organization.
      Register an HTTPS callback URL to receive real-time notifications when
      documents are created, signed or completed; each payload can optionally
      carry a signature so you can verify it originates from Circularo. Managing
      webhooks requires organization administrator permissions.
externalDocs:
  description: Guides
  url: https://developers.circularo.com/latest/guides
paths:
  /files:
    post:
      tags:
        - Files
      summary: Upload a file
      description: >-
        `POST /files`


        Uploads a file to Circularo and returns an identifier you can reference
        wherever a file is needed — for example when creating a document. Upload
        a file once and reuse its identifier as often as you need.


        Files are uploaded as `multipart/form-data`. A file is stored on its own
        and only takes on a role once you reference it from another resource.


        When the file is a PDF you can include signature anchors to have
        Circularo locate text in it and return the positions where signature
        fields should be placed — a convenient alternative to computing
        coordinates yourself.
      operationId: uploadFile
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/uploadFile'
      responses:
        '201':
          description: >-
            The file was uploaded. Returns the file's identifier and metadata,
            plus any calculated signature anchor positions.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/uploadedFile'
        '400':
          description: No file was provided or the request was malformed.
          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
        '402':
          description: Storage or subscription capacity exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              example:
                status: 402
                type: SUBSCRIPTION:NOT_ACTIVE
                message: Subscription not active
                requestId: 3fa85f6457174562b3fc2c963f66afa6
        '403':
          description: Your account lacks the permission required to upload files.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              example:
                status: 403
                type: AUTH:ACCESS_DENIED
                message: Access denied
                requestId: 3fa85f6457174562b3fc2c963f66afa6
        '429':
          description: >-
            Rate limit exceeded; retry after the delay indicated in the
            `Retry-After` header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              example:
                status: 429
                type: SYSTEM:RATE_LIMIT_EXCEEDED
                message: Rate limit exceeded
                requestId: 3fa85f6457174562b3fc2c963f66afa6
      security:
        - ApiKey: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: |-
            curl --request POST \
              --url https://sandbox.circularo.com/api/v2/files \
              --header 'Authorization: Bearer <token>' \
              --form 'convertToPdfA=false' \
              --form 'file=@document.pdf' \
              --form 'fileName=Client agreement' \
              --form 'signatureAnchors[0][id]=signature-1' \
              --form 'signatureAnchors[0][regexp]=Signature:\s*$' \
              --form 'signatureAnchors[0][text]=PREPARED BY:'
components:
  schemas:
    uploadFile:
      type: object
      properties:
        convertToPdfA:
          type: boolean
          description: >-
            Convert the uploaded file to PDF/A for long-term archiving; a file
            that is not a PDF is converted to PDF first. A PDF that already
            carries a signature is left unconverted, because converting it would
            destroy that signature. The conversion may slightly change the
            file's visual appearance.
          example: false
          default: false
        file:
          type: string
          format: binary
          description: The file to upload, sent as `multipart/form-data`.
        fileName:
          type: string
          maxLength: 255
          description: >-
            Name for the file, without extension. If omitted, the uploaded
            file's name is used. Markup-like text, such as a tag in angle
            brackets, and characters not allowed in file names, such as `/` or
            `:`, are removed.
          example: Client agreement
          nullable: true
        signatureAnchors:
          type: array
          items:
            $ref: '#/components/schemas/fileAnchor'
          maxItems: 100
          description: >-
            Anchors that locate text in the uploaded file and return the
            positions where signature fields should be placed. Use these
            positions later when you place signature fields for a transaction.
            Anchors are located only in a PDF — an uploaded PDF, or a file
            converted with `convertToPdfA`; in any other file they find no
            positions. Send them as indexed form fields, one per property —
            `signatureAnchors[0][id]`, `signatureAnchors[0][text]`,
            `signatureAnchors[0][offset][x]` and so on.
      description: The file to upload and optional processing options.
    uploadedFile:
      type: object
      properties:
        anchorPositions:
          type: array
          items:
            $ref: '#/components/schemas/anchorPosition'
          description: >-
            Calculated signature field positions — one entry for each anchor you
            supplied, in the same order. Empty when no anchors were provided.
        checksum:
          type: string
          description: >-
            SHA-512 hash (hex) of the file's contents. Compute it over your
            local file to verify the upload was not corrupted, or to recognize a
            file you have already uploaded.
          example: >-
            f898ee89406adbb65fffcf08bc19e3b70d27ae189510077c394d382c578ee074a26a3ca24a35f3bd8898ac0951ae63e5e0e3654184b956d86707c925d697f730
          nullable: true
        createdAt:
          type: string
          format: date-time
          description: When the file was uploaded.
          example: '2024-11-02T09:15:30.000Z'
          nullable: true
        createdBy:
          allOf:
            - $ref: '#/components/schemas/person'
          description: >-
            The person who uploaded the file. Null when it was not uploaded by a
            person.
          nullable: true
        fileName:
          type: string
          description: Name of the file.
          example: Client agreement
          nullable: true
        hasPassword:
          type: boolean
          description: >-
            Whether the file is a password-protected PDF. Null when this could
            not be determined.
          example: false
          nullable: true
        id:
          type: string
          pattern: ^[a-z0-9]+$
          minLength: 1
          description: Unique identifier of the file.
          example: s1pss1atbzli272pinbt48n2ssy96ax2pwgqrz5qyzklwxg1kl0tq6anvz1p97xj
        mimeType:
          type: string
          description: Media type of the file.
          example: application/pdf
          nullable: true
        pageCount:
          type: integer
          description: >-
            Number of pages, when the file is a PDF. Null for a file that has no
            pages.
          example: 12
          nullable: true
        size:
          type: integer
          description: Size of the file in bytes.
          example: 248173
          nullable: true
      required:
        - anchorPositions
        - checksum
        - createdAt
        - createdBy
        - fileName
        - hasPassword
        - id
        - mimeType
        - pageCount
        - size
      description: >-
        A freshly uploaded file: its identifier and metadata, plus any
        calculated signature anchor positions.
    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
    fileAnchor:
      type: object
      properties:
        id:
          type: string
          description: >-
            Identifier you assign to this anchor so you can match it to its
            calculated positions in the response.
          example: signature-1
        offset:
          allOf:
            - $ref: '#/components/schemas/anchorOffset'
          description: >-
            Where the signature field is placed relative to the matched anchor
            text.
        regexp:
          type: string
          maxLength: 500
          description: >-
            Regular expression matched against each line of text in the uploaded
            file. Matching is single-line, and letter case is ignored for the
            unaccented letters A to Z only. An expression is rejected when a
            counted repetition such as `{2,5}` has a bound above 1000, when the
            bounds of counted repetitions nested inside one another multiply to
            more than 100000, or when it takes too long to evaluate. Exactly one
            of `regexp` and `text` must be provided.
          example: Signature:\s*$
          nullable: true
        text:
          type: string
          description: >-
            Exact text matched against each line of text in the uploaded file.
            Matching is case-sensitive and single-line. Exactly one of `regexp`
            and `text` must be provided.
          example: 'PREPARED BY:'
          nullable: true
      required:
        - id
        - offset
      description: >-
        An anchor that places a signature field by locating text in the document
        instead of using fixed coordinates.
    anchorPosition:
      type: object
      properties:
        id:
          type: string
          description: >-
            Identifier of the anchor, matching the one you supplied in the
            request.
          example: signature-1
        matches:
          type: array
          items:
            $ref: '#/components/schemas/anchorMatch'
          description: >-
            Every location where the anchor's text was found, with the
            calculated signature field position. Empty when the text was not
            found anywhere in the document.
      required:
        - id
        - matches
      description: The calculated signature field positions for one requested anchor.
    person:
      type: object
      properties:
        email:
          type: string
          description: >-
            The person's email address. In a record of a past event it is the
            address the person had at that time; elsewhere it is their current
            address. Null when it is not known.
          example: jane.doe@example.com
          nullable: true
        fullname:
          type: string
          description: >-
            The person's full name. Null when it is not known, or when the
            person is outside your organization and not among your contacts.
          example: Jane Doe
          nullable: true
        userId:
          type: string
          description: >-
            Identifier of the person's Circularo account, the `id` of the user.
            Treat it as an opaque value: even where it looks like an email
            address, it is not one. Null for a party without a Circularo
            account.
          example: jane.doe@example.com
          nullable: true
      required:
        - email
        - fullname
        - userId
      description: >-
        A person the resource refers to: their Circularo account, if they have
        one, their email address and their name.
    anchorOffset:
      type: object
      properties:
        height:
          type: number
          minimum: 0
          maximum: 1
          description: Height of the signature field as a fraction of the page height.
          example: 0.05
        width:
          type: number
          minimum: 0
          maximum: 1
          description: Width of the signature field as a fraction of the page width.
          example: 0.2
        x:
          type: number
          minimum: -1
          maximum: 1
          description: >-
            Horizontal offset of the signature field from the anchor text, as a
            fraction of the page width. Positive moves right, negative moves
            left.
          example: 0
        'y':
          type: number
          minimum: -1
          maximum: 1
          description: >-
            Vertical offset of the signature field from the anchor text, as a
            fraction of the page height. Positive moves down, negative moves up.
          example: -0.03
      required:
        - x
        - 'y'
      description: >-
        Where the signature field is placed relative to the matched anchor text,
        and how large it is.
    anchorMatch:
      type: object
      properties:
        page:
          type: integer
          description: Page the anchor text was found on.
          example: 1
        position:
          allOf:
            - $ref: '#/components/schemas/signaturePosition'
          description: Calculated position where the signature field should be placed.
      required:
        - page
        - position
      description: >-
        A single place where an anchor's text was found, with the calculated
        signature field position.
    signaturePosition:
      type: object
      properties:
        height:
          type: number
          description: >-
            Height of the field as a fraction of the page height. Null when no
            size is known, as for an anchor that carries none.
          example: 0.07
          nullable: true
        width:
          type: number
          description: >-
            Width of the field as a fraction of the page width. Null when no
            size is known, as for an anchor that carries none.
          example: 0.25
          nullable: true
        x:
          type: number
          description: >-
            Horizontal position of the field's top-left corner as a fraction of
            the page width. A position calculated from an anchor may fall
            outside the 0–1 range; clamp it before placing a field there.
          example: 0.11764706
          nullable: true
        'y':
          type: number
          description: >-
            Vertical position of the field's top-left corner as a fraction of
            the page height. A position calculated from an anchor may fall
            outside the 0–1 range; clamp it before placing a field there.
          example: 0.6826886
          nullable: true
      required:
        - height
        - width
        - x
        - 'y'
      description: >-
        The position and size of a field on a page, expressed as fractions of
        the page dimensions.
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      description: >-
        Authorize using an API key. Send it in the `Authorization: Bearer
        <api-key>` header. Only API keys are accepted — session tokens are
        rejected. Create your first API key in the Circularo web app; further
        keys can be managed through this API.

````

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