Skip to content

LegalOn API (1.3.1)

API documentation for LegalOn services

Languages
Servers
The server URL is `{api_base_url}/rest/v1`. You can construct the server URL using the value of `api_base_url` provided in the response when obtaining an access token.
https://{api_base_url_without_scheme}/rest/v1

Users

Operations about user

Operations

User Groups

Operations about user group

Operations

Workspaces

Operations about all tenant workspaces/folders regardless of the user's access permissions.

Operations

Departments

Operations about department

Operations

Contracts(Files)

Operations to create, retrieve, update, and delete contracts. For operations that target a workspace, specify a workspace_id obtained via the common Workspaces endpoint (GET /workspaces).

Operations

Matters

Operations to create, retrieve, update, and delete matters. Matter operations require an API credential owned by a user with a Matter Management Pro license.

Operations

Files

Operations to create and manage files for LegalOn resources.

Operations

Upload a file

Request

Overview

Uploads a generic file to the specified workspace and returns its file ID.

Supported files

File formats not listed under "Unsupported" in "Formats that can be imported into Matter Management cases from email" under "Supported file formats" in LegalOn's operating environment are in scope.

Constraints

The filename comes from the multipart file part.

  • The file must be 100 MiB or smaller.
  • The filename must be 200 characters or fewer, include an extension, contain no line breaks, and must not start or end with a period.

Processing notes

  • After upload, the file is checked against denied extensions and detected media types. If either is denied, the file is deleted, even if this API has already returned 201.
  • This operation does not support an idempotency key. If the response is lost after processing, retrying may create another file.

Response

The returned created_at is the time when the API completed file creation and prepared the response. It may differ from the persistence timestamp by a few seconds.

Related API

The file is not linked to a contract or matter. Link it to a contract with POST /contracts/{document_id}/related-file-links or to a matter with POST /matters/{matter_id}/related-file-links. The same file can be linked to both.

Security
OAuth2ClientCredentials
Bodymultipart/form-datarequired

Generic file upload request.

workspace_idstring(uuid)required

Destination workspace ID.

filestring(binary)required

File content. The filename is read from this part. If supplied, its Content-Type must be a syntactically valid media type. An invalid Content-Type returns 415.

curl -i -X POST \
  'https://{api_base_url_without_scheme}/rest/v1/files' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: multipart/form-data' \
  -F workspace_id=00000000-0000-0000-0000-000000000003 \
  -F 'file=<binary file content>'

Responses

Created

Bodyapplication/json
file_idstring(uuid)required

LegalOn-generated file ID.

file_namestringnon-emptyrequired

File name.

mime_typestringnon-emptyrequired

MIME type of the file.

created_atstring(date-time)required

Time when the API completed file creation and prepared the response. This may differ from the persistence timestamp by a few seconds.

Response
application/json
{ "file_id": "00000000-0000-0000-0000-000000000040", "file_name": "nda.pdf", "mime_type": "application/pdf", "created_at": "2026-08-18T00:00:00Z" }

Move files to another workspace

Request

Moves the specified files to the destination workspace. Each file ID is returned in succeeded_file_ids or failed_file_ids depending on whether the move succeeded.

Security
OAuth2ClientCredentials
Bodyapplication/jsonrequired
destination_workspace_idstring(uuid)required

Destination workspace ID

file_idsArray of strings(uuid)required

File IDs to move

curl -i -X POST \
  'https://{api_base_url_without_scheme}/rest/v1/files:move' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "destination_workspace_id": "00000000-0000-0000-0000-000000000003",
    "file_ids": [
      "00000016-0000-0000-0001-100000000001",
      "00000016-0000-0000-0001-100000000002"
    ]
  }'

Responses

The request was processed. File IDs are separated by result; this response does not include failure reasons.

Bodyapplication/json
succeeded_file_idsArray of strings(uuid)required

File IDs that were moved successfully.

failed_file_idsArray of strings(uuid)required

File IDs that could not be moved.

Response
application/json
{ "succeeded_file_ids": [ "00000016-0000-0000-0001-100000000001" ], "failed_file_ids": [ "00000016-0000-0000-0001-100000000002" ] }

Delete a file

Request

Deletes the specified file, including when it is referenced by another resource.

Security
OAuth2ClientCredentials
Path
file_idstring(uuid)required

File ID

curl -i -X DELETE \
  'https://{api_base_url_without_scheme}/rest/v1/files/{file_id}' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

Responses

Deleted

Response
No content

Workspaces

Workspaces/folders are the common units used to store and organize resources such as contracts.

Operations