# Upload Contact CSV Part

App-only: store a numbered CSV file part in the private staged upload. File bytes do not enter model context; creates no contacts.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "uploadId": {
      "type": "string",
      "description": "Opaque ID returned when upload began"
    },
    "part": {
      "type": "integer",
      "description": "Zero-based sequential part number",
      "minimum": 0
    },
    "contentBase64": {
      "type": "string",
      "description": "At most 256 KiB of file bytes as base64",
      "maxLength": 349528
    },
    "accountId": {
      "type": [
        "null",
        "integer"
      ],
      "description": "User ID of the account; omit for the account of the access token",
      "default": null,
      "minimum": 1
    }
  },
  "required": [
    "uploadId",
    "part",
    "contentBase64"
  ],
  "additionalProperties": false
}
```

## Output schema:

```json
{
  "type": "object",
  "required": [
    "accountId",
    "uploadId",
    "importId",
    "status",
    "nextTool",
    "beforeNextTool",
    "fileName",
    "headers",
    "examples",
    "headerRows",
    "delimiter",
    "enclosure",
    "mappingOptions",
    "rows",
    "chunks",
    "progress",
    "appUrl",
    "html"
  ],
  "properties": {
    "accountId": {
      "type": "integer"
    },
    "uploadId": {
      "type": [
        "string",
        "null"
      ]
    },
    "importId": {
      "type": [
        "integer",
        "null"
      ]
    },
    "status": {
      "type": "string"
    },
    "nextTool": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "get-contact-import-upload-preview",
        "prepare-contact-import",
        "get-contact-import",
        "import-contacts",
        null
      ],
      "description": "Exact tool name to call only after beforeNextTool is satisfied; null when no tool follows automatically. Never authorizes an import."
    },
    "beforeNextTool": {
      "type": "string",
      "description": "What must happen before nextTool may be called, including user confirmation of mapping or explicit import approval."
    },
    "fileName": {
      "type": [
        "string",
        "null"
      ]
    },
    "headers": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "examples": {
      "type": "array",
      "items": {
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    },
    "headerRows": {
      "type": [
        "integer",
        "null"
      ],
      "description": "0 for no header, 1 for column labels, 2 for a KlickTipp export with a second hash header. These rows are excluded from validation and import."
    },
    "delimiter": {
      "type": [
        "string",
        "null"
      ]
    },
    "enclosure": {
      "type": [
        "string",
        "null"
      ],
      "description": "Quote character used for CSV text, double by default; the UI also permits single quote."
    },
    "mappingOptions": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "subscriptionFields",
            "customFieldLookupTool",
            "manualTagLookupTool",
            "tagCreationAllowed",
            "tagNameSeparators",
            "identifierFieldIds",
            "ignoreByOmission"
          ],
          "properties": {
            "subscriptionFields": {
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "id",
                  "label",
                  "formats"
                ],
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "formats": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            },
            "customFieldLookupTool": {
              "type": "string",
              "description": "Find account and global field IDs with search-custom-fields; map each as type custom."
            },
            "manualTagLookupTool": {
              "type": "string",
              "description": "Find existing manual tag IDs with search-tags; map type tag, whose nonempty cell assigns that tag."
            },
            "tagCreationAllowed": {
              "type": "boolean",
              "description": "Whether this account may map a CSV column as type tag-create, id tag-create (requires administrator permission); missing names are created when import starts."
            },
            "tagNameSeparators": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "For tag-create, the required format is the separator between tag names in each cell."
            },
            "identifierFieldIds": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "At least one of these subscription targets must be mapped to identify a contact."
            },
            "ignoreByOmission": {
              "type": "boolean",
              "description": "A CSV column not listed in prepare-contact-import mapping is ignored."
            }
          }
        },
        {
          "type": "null"
        }
      ]
    },
    "rows": {
      "type": [
        "integer",
        "null"
      ]
    },
    "chunks": {
      "type": [
        "integer",
        "null"
      ]
    },
    "progress": {
      "type": [
        "object",
        "null"
      ]
    },
    "appUrl": {
      "type": [
        "string",
        "null"
      ]
    },
    "html": {
      "type": "string"
    }
  }
}
```

