---
search:
  tags:
    - offline-sync
    - POST
seo:
  description: >-
    Upload bytes for a new document or document version. Reference for the POST
    /api/v1/sync/matters/{id}/documents endpoint in the Basenet Public API.
sidebar:
  label: Upload bytes for a new document or document version
  badge: POST
title: Upload bytes for a new document or document version
type: openapi-operation
---
Endpoint: `POST /api/v1/sync/matters/{id}/documents`

Authentication: `bearerAuth` (Scoped API token (bnx\_…). Required scopes are noted per operation.)

Parameters:
- `id` (in path, string, required)
- `relativePath` (in query, string, required)
- `documentId` (in query, string, optional)

Request body (`application/octet-stream`): string

Responses:
- `200`: Updated existing document
- `201`: Created new document
- `400`: Invalid request
- `401`: Unauthenticated
- `403`: Forbidden (missing scope or permission)
- `413`: File too large
- `429`: Rate limited

Response 200 body (`application/json`):
- `contractVersion` (one of `"v1"`, required)
- `documentId` (string, required)
- `checksum` (string, required)

Response 201 body (`application/json`):
- `contractVersion` (one of `"v1"`, required)
- `documentId` (string, required)
- `checksum` (string, required)
