---
agentTools:
  projectIndex: https://cargodocs-customer.readme.io/llms.txt
---

# Upload Document

This endpoint allows a partner to push a new PDF based encoded document against any existing shipment.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "version": "3.0.0",
    "title": "CargoDocs Customer  API",
    "description": "This API have endpoints  For Tankers, Liner Cos, NVOCCs & future Warehouses wishing to create/issue original electronic bills of lading.",
    "termsOfService": "https://www.essdocs.com/policies/",
    "contact": {
      "name": "CargoDocs API Team",
      "email": "api@essdocs.com",
      "url": "https://www.essdocs.com"
    }
  },
  "servers": [
    {
      "description": "Sandbox API",
      "url": "https://api-test.cargodocs.com/v3/"
    },
    {
      "description": "UAT API",
      "url": "https://api-uat.cargodocs.com/api/v3/"
    },
    {
      "description": "Production API",
      "url": "https://api.cargodocs.com/api/v3/"
    }
  ],
  "externalDocs": {
    "description": "Find out more about essCargoDocs",
    "url": "https://cargodocs-issuer.readme.io"
  },
  "tags": [
    {
      "name": "Import data to CargoDocs",
      "description": "Endpoints under this category is for exporters or multi-national-corporations, including oil terminals, refineries and independent storage terminals."
    }
  ],
  "paths": {
    "/parcels/actions/{set_id}/uploadDocument": {
      "post": {
        "description": "This endpoint allows a partner to push a new PDF based encoded document against any existing shipment.",
        "summary": "Upload Document",
        "operationId": "uploadDocument",
        "tags": [
          "Import data to CargoDocs"
        ],
        "security": [
          {
            "Authorization": []
          }
        ],
        "parameters": [
          {
            "name": "set_id",
            "in": "path",
            "description": "GUID based Set id against which the PDF documents needs to be uploaded",
            "required": true,
            "example": "52792116-dd88-4a85-bd53-74b60900385a",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/uploadDocumentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Document has been successfully uploaded"
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden  access denied  config issue"
          },
          "500": {
            "description": "Internal Server Error"
          },
          "503": {
            "description": "Service Unavailable"
          },
          "default": {
            "description": "unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "Authorization": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "uploadDocumentRequest": {
        "required": [
          "pdfDocuments"
        ],
        "properties": {
          "pdfDocuments": {
            "type": "array",
            "properties": {
              "documentName": {
                "type": "string",
                "example": "APIUploadedDoc",
                "description": "PDF Document name"
              },
              "value": {
                "type": "string",
                "example": "JVBERi0xLjUNCjUgMCBvYmoNCjw8L1R5cGUgL1BhZ2UvUGFyZW50IDMgMCBSL0NvbnRlbnRzIDYgMCBSL01lZGlhQm94IFswIDAgNTk1LjM1IDg0MS43XT4+DQplbmRvYmoNCjYgMCBvYmoNCjw8L0xlbmd0aCAyOCAwIFIvRmlsdGVyIC9GbGF0ZURlY29kZT4+c3RyZWFtDQp4nO1d63PcthGnZSmWnU4c2/JDVh3Tdv2IatEESfCRPpOmr49JPNN+8Ld22k5Hbqf90n+/C2B38eAJOCk+6U5BbiLf4pY/AuDit7skAIqyhs+RgD9jJ6qh/Mv78j+l0KWilD2UtL0qPNLf69J+Oy5lO1a9dL8CRDv1IBslFv9R/qn8FwDXGqHWh3SjqCbpfm3qqp9GkGv71Rz5jVMp/lFX9ayIX70t3/zuS/jvD6UYy7d/Q3joCSEbOHQsRV+NY1e+Neh1+d+/l6+KreJqsV3sFB8V1+D/3eI6fL/6efn2n+U4VnUragXz9q+geUOXvio+Lq7hNyr5UfGuFhIO/QQgdoqbuvi3b6GR33gN1V04DHU1Tae4BG1XDXXHl4BFv9lf/aYUtdfsupyqqZ8WthdajHX/CP+9wq2iEtUXN6C1pnXUpv8g2Le/L+tqkOX/lFS18O09f7MXDsXvgustmqru9fWG6nsVboSu8CvoypvFp/C5FdTqdnEnKPmk2CvuFveK+8UD+HcfW6a737OxtmrHPnrOveIhtPYgwP9x8aj4bNY3d8w1/3RWnUfF46BshCs2sBnBEerj2ohjIUM14vh0616bgk5Wjal41+lv+h/46c2fRfn1v0+yNz1klza3fmorO+BJCoztj6Gx4QUXbVUPocVZ03EsoK/q5Ua8EFU3TXrE81eujXcdW+g4fR23Fncu2MBQyWlY1VnVZ/GZj9oKxvEETcZLq4ZOM3WiWfgNus2MHD3C3rvCMbAZVHAuQi1rU2GtzOI/yr8d6rocAV02Uv3TKExPPDYcOcxlNVI1DuqzTA6AmqhaqKtkBhiZyRRQ0lh1dWv6y/DuNlDmNnDvLvy9jow66z9Vm1aaYWAr7jdD1bptgOJ94Xs14Ddfxxrguo5drjw4CP1v24LZSBr16CK2gGcNs22hm1D+ZPbBX24ptjsB/rSQJ5ziJoAr+twNwNWpwxMait0Hkjzwflkw0ND8sq2jqZAX3TQDv+l4YDKDLfCIui3WLXp2EFBuUwkm+mwJHNds62jzlhPPbOG/e/DLbRiS2+tmLPGGGXZ4UHwaNEfzBZjMQfHI+8WxlkURJQeU+nrXik4bcN0US4aHUJ+Y41zpmKSTERRAN0BbStON9vsxfk+c/",
                "description": "PDF encoded document"
              }
            }
          }
        }
      },
      "Error": {
        "required": [
          "code",
          "message"
        ],
        "properties": {
          "code": {
            "type": "integer",
            "format": "int32",
            "example": 404
          },
          "message": {
            "type": "string",
            "example": "Invalid object found in parameters"
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 102,
      "1": 38,
      "2": 76,
      "3": 5,
      "4": 41,
      "5": 177,
      "6": 28,
      "7": 0,
      "8": 24,
      "9": 70,
      "10": 39,
      "11": 242
    }
  }
}
```