Skip to main content
POST
/
partner
/
commenda-os
/
companies
/
{companyId}
/
documents
Create a company document
curl --request POST \
  --url https://api.prod.commenda.io/api/v1/partner/commenda-os/companies/{companyId}/documents \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "fileName": "passport.pdf",
  "fileUrl": "https://commenda-bucket.s3.amazonaws.com/77/uuid/passport.pdf",
  "mimeType": "application/pdf",
  "fileSize": 382144,
  "documentSubType": "Other",
  "documentName": "Passport scan",
  "businessEntityId": 44,
  "personId": 12
}
'
{
  "file": {
    "fileId": 456,
    "fileName": "passport.pdf",
    "mimeType": "application/pdf",
    "fileSize": 382144,
    "documentSubType": "Other",
    "companyId": 77,
    "documentName": "Passport scan",
    "businessEntityId": 44,
    "personId": 12
  }
}
Create a Commenda company document from a signed-upload hostedUrl and receive a reusable fileId. Use this endpoint after uploading file bytes directly to S3 with Create a document upload URL. Pass the upload.hostedUrl returned by that endpoint as fileUrl. Commenda verifies that the S3 object exists before creating the document record. The created file is scoped to the company. You may optionally link it to one reusable Commenda OS resource:
  • Use personId to link the file to a key person.
  • Use businessEntityId to link the file to a business entity.
  • Omit both fields to keep the file company-scoped only.
Do not send both personId and businessEntityId in the same request. For incorporation, save the returned file.fileId, register it with POST /partner/incorporation/{incorporationId}/files, then link it as a typed participant document with POST /partner/incorporation/{incorporationId}/documents.

Example

curl --request POST \
  --url 'https://api.prod.commenda.io/api/v1/partner/commenda-os/companies/77/documents' \
  --header 'content-type: application/json' \
  --header 'x-api-key: <partner_api_key>' \
  --data '{
    "fileName": "passport.pdf",
    "fileUrl": "https://commenda-bucket.s3.amazonaws.com/77/uuid/passport.pdf",
    "mimeType": "application/pdf",
    "fileSize": 382144,
    "personId": 12,
    "documentName": "Passport scan"
  }'
{
  "file": {
    "fileId": 456,
    "fileName": "passport.pdf",
    "mimeType": "application/pdf",
    "fileSize": 382144,
    "documentSubType": "Other",
    "documentName": "Passport scan",
    "companyId": 77,
    "personId": 12
  }
}

Authorizations

x-api-key
string
header
required

Path Parameters

companyId
integer
required

Commenda company identifier accessible to the authenticated partner.

Body

application/json
fileName
string
required
Example:

"passport.pdf"

fileUrl
string<uri>
required

Hosted URL returned by the signed upload URL endpoint after the client uploads bytes directly to S3. The object must exist before the document can be created.

Example:

"https://commenda-bucket.s3.amazonaws.com/77/uuid/passport.pdf"

mimeType
string
required

MIME type of the uploaded file. Incorporation document requirements validate against this value.

Example:

"application/pdf"

fileSize
integer

Optional file size in bytes.

Example:

382144

documentSubType
string

Optional Commenda document subtype. Defaults to Other when omitted.

Example:

"Other"

documentName
string

Human-readable document name. Used as the explicit document type when documentSubType is Other.

Example:

"Passport scan"

businessEntityId
integer

Optional business entity to link this uploaded file to. Do not provide together with personId.

Example:

44

personId
integer

Optional key person to link this uploaded file to. Do not provide together with businessEntityId.

Example:

12

Response

Company document created successfully

file
object
required