API documentation for LegalOn services
LegalOn API (1.3.1)
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
Request
Uploads a generic file to the specified workspace and returns its file ID.
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.
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.
- 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.
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.
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
Generic file upload request.
- 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/files
- cURL
- JavaScript
- Python
- Java
- Go
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>'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" }
- 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/files:move
- cURL
- JavaScript
- Python
- Java
- Go
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"
]
}'Response
application/json
{ "succeeded_file_ids": [ "00000016-0000-0000-0001-100000000001" ], "failed_file_ids": [ "00000016-0000-0000-0001-100000000002" ] }
- 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/files/{file_id}
- cURL
- JavaScript
- Python
- Java
- Go
curl -i -X DELETE \
'https://{api_base_url_without_scheme}/rest/v1/files/{file_id}' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>'