Skip to content

LegalOn API (1.2.0)

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 files for use by LegalOn resources.

Operations

Upload a file

Request

Uploads a generic file to the specified workspace and returns its file ID. 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. The original filename and media type are read from the multipart file part. The file must be 100 MiB or smaller. Supported extensions are .pdf, .doc, .docx, .xls, .xlsx, .csv, .ppt, .pptx, .eml, .msg, .png, .gif, .jpg, and .jpeg. Supported media types are application/pdf, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, text/csv, application/vnd.ms-powerpoint, application/vnd.openxmlformats-officedocument.presentationml.presentation, message/rfc822, application/vnd.ms-outlook, image/png, image/gif, and image/jpeg. The media type must match the extension. For compatibility, an omitted media type or application/octet-stream is inferred from the extension; application/zip is also accepted for .docx, .xlsx, and .pptx, and application/vnd.ms-excel is accepted for .csv. The filename must be 200 characters or fewer, include an extension, contain no line breaks, and must not start or end with a period. 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. This operation does not support an idempotency key. If the response is lost after processing, retrying may create another file.

Security
OAuth2ClientCredentials
Bodymultipart/form-datarequired

Generic file upload request.

workspace_idstring(uuid)required

Destination workspace ID.

filestring(binary)required

File content. The filename and Content-Type are read from this multipart file part; separate file_name and mime_type fields are not used.

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

File MIME type.

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" }

Workspaces

Workspaces/folders are the common units used to store and organize resources such as contracts. This endpoint returns the workspaces/folders the calling user has access to, as a tree. For operations that target a workspace (e.g., the Contract API), specify the workspace_id obtained here. To manage workspaces across the tenant (creation, permissions, etc.), see the admin workspace operations (/spaces).

Operations