api.documents.upload
POST /documents— ACPortal
Python
api.documents.upload(*, job_display_id: str, file_path: str | Path, document_type: DocumentType | int, document_type_description: str | None = None, shared: int = 0, tags: list[str] | None = None, job_items: list[str] | None = None, rfq_id: int | None = None, filename: str | None = None) -> DocumentUploadResponse
CLI
ab documents upload [--job-display-id ...] [--file-path ...] [--document-type ...] [--document-type-description ...] [--shared ...] [--tags ...] [--job-items ...] [--rfq-id ...] [--filename ...]
POST /documents — upload a single document of any type (multipart).
The accompanying form fields are validated through
- class:
~ab.api.models.documents.DocumentUploadRequestand the file is streamed as thefilepart. This is the canonical upload primitive;- meth:
upload_item_photois a thin wrapper that fills in the item-photo specifics.
Args:
job_display_id: Job display ID the document belongs to.
file_path: Path to the file to upload.
document_type: Document type; see :class:~ab.api.models.enums.DocumentType.
document_type_description: Optional human-readable type label.
shared: Sharing bitmask (0 = private).
tags: Optional tags to attach.
job_items: Item UUID(s) to associate (used for item photos).
rfq_id: Optional RFQ ID to associate.
filename: Override the multipart filename (defaults to the file’s name).
Returns: DocumentUploadResponse: The parsed upload result.
Request body — DocumentUploadRequest
Field |
Type |
Required |
Description |
|---|---|---|---|
|
|
yes |
Job display ID the document belongs to (e.g. ‘2000000’). |
|
|
yes |
Document type ID; see DocumentType (6 = Item Photo). |
|
|
no |
Human-readable label for the document type. |
|
|
no |
Sharing bitmask (0 = private); controls portal visibility. |
|
|
no |
Free-form tags to attach to the document. |
|
|
no |
Item UUID(s) to associate the document with (required for item photos). |
|
|
no |
RFQ ID to associate the document with, if applicable. |
Response
Returns DocumentUploadResponse.
Field |
Type |
Required |
Description |
|---|---|---|---|
|
|
no |
Whether the upload succeeded. |
|
|
no |
Human-readable status or error message. |
|
|
no |
Per-file results for the upload. |
|
|
no |
Document ID when a single file was uploaded. |
|
|
no |
Stored file name when a single file was uploaded. |