Skip to content

upsertDocument

WRITE

Upsert document.

POST /api/v1/documents/upsertDocument
curl -X POST '<your-host>/api/v1/documents/upsertDocument' \
  -H 'Authorization: Bearer <api-key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "string",
    "readGroups": [],
    "writeGroups": [],
    "_operation": "create"
  }'
Response
{
  "active": true,
  "companyId": "string",
  "createdAt": "string",
  "createdBy": "string",
  "description": "string",
  "extension": "string",
  "id": "string",
  "name": "string",
  "path": "string",
  "readGroups": [
    "string"
  ],
  "size": 0,
  "sourceDocument": "Sales Invoice",
  "sourceDocumentId": "string",
  "type": "Other",
  "updatedAt": "string",
  "updatedBy": "string",
  "writeGroups": [
    "string"
  ]
}

Parameters

ParameterType

Required. 'create' inserts a new record, 'update' modifies the existing record with this id.

"create""update"
min length 3max length 50
min items 1
min items 1
"Job""Gauge Calibration Record""Issue""Purchase Order""Purchase Invoice""Quote""Request for Quote""Purchasing Request for Quote""Supplier Quote""Sales Order""Sales Invoice""Sales Return Order""Purchase Return Order""Shipment""Supplier""Customer""Part""Material""Tool""Consumable""Service"

Input schema

schema
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 3,
      "maxLength": 50
    },
    "extension": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "labels": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 50
      }
    },
    "readGroups": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "writeGroups": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "path": {
      "type": "string"
    },
    "size": {
      "type": "number"
    },
    "sourceDocument": {
      "type": "string",
      "enum": [
        "Job",
        "Gauge Calibration Record",
        "Issue",
        "Purchase Order",
        "Purchase Invoice",
        "Quote",
        "Request for Quote",
        "Purchasing Request for Quote",
        "Supplier Quote",
        "Sales Order",
        "Sales Invoice",
        "Sales Return Order",
        "Purchase Return Order",
        "Shipment",
        "Supplier",
        "Customer",
        "Part",
        "Material",
        "Tool",
        "Consumable",
        "Service"
      ]
    },
    "sourceDocumentId": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "_operation": {
      "type": "string",
      "enum": [
        "create",
        "update"
      ],
      "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."
    }
  },
  "required": [
    "name",
    "readGroups",
    "writeGroups",
    "_operation"
  ]
}