---
title: "Create company documents from uploaded files"
method: POST
path: "/api/company-documents/bulk-create"
tags: ["Company Documents"]
---

# Create company documents from uploaded files

`POST /api/company-documents/bulk-create`

Turns files the caller has uploaded into company documents, filed on `companyId` (default: the caller's own company), which must be in the caller's network — else 404. `shareWithCompanyId`, also in the network, auto-approves a share of every new document with that company. The caller becomes the owner. Files the caller did not upload are skipped rather than failing the batch, so the response can hold fewer documents than were sent, or none. `isPublic` is honoured as sent. Responds 201 with the stored documents as a bare array, not wrapped in { data, metadata }: both frontends read it that way. `fileUrl` is a read-only signed link valid for an hour and `originalFileUrl` is the storage key. Publishes a created event per document, and a cascade-tracing event when any is of a node-mapping type.

## Request body

- object
  - `companyId` string, nullable
  - `shareWithCompanyId` string
  - `documents` object[], required
    - `fileId` string, required
    - `isPublic` boolean, required
    - `documentTypeId` string, nullable
    - `name` string, nullable

## Response `201`

Default Response

- object[]
  - `id` string, required
  - `companyId` string, nullable, required
  - `ownerCompanyId` string, nullable, required
  - `name` string, required
  - `documentTypeId` string, nullable, required
  - `fileId` string, nullable, required
  - `fileUrl` string, nullable, required
  - `originalFileUrl` string, nullable, required
  - `fileType` string, nullable, required
  - `fileContentType` string, nullable, required
  - `isPublic` union, required
    - boolean
    - number
  - `type` string, nullable, required
  - `createdAt` string, date-time, nullable, required
  - `updatedAt` string, date-time, nullable, required

## Other responses

- `400` — Default Response
- `401` — Default Response
- `403` — Default Response
- `404` — Default Response

## Changes

> 56 revisions in range; 1 not diffed.

- **2026-09-30** `92d9b9ebe5ad` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/retraced/apis/api-reference/changes/api/company-documents/bulk-create/post.md)

---

[API](https://skmtc.dev/retraced/apis/api-reference.md) · [All operations](https://skmtc.dev/retraced/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc.dev/retraced/apis/api-reference/revisions/43a47823848e?raw)
