{
  "openapi": "3.0.1",
  "info": {
    "title": "Encrypted Data Integration",
    "description": "Encrypted Data Integration encrypts sensitive Apify data before export or automation. It supports selected fields, full records, or full payload encryption with AES-GCM, manifests, fingerprints, and dataset or key-value store output.",
    "version": "0.0",
    "x-build-id": "KuAtERK0QVq4xrE69"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sovanza.inc~encrypted-data-integration/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sovanza.inc-encrypted-data-integration",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/sovanza.inc~encrypted-data-integration/runs": {
      "post": {
        "operationId": "runs-sync-sovanza.inc-encrypted-data-integration",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/sovanza.inc~encrypted-data-integration/run-sync": {
      "post": {
        "operationId": "run-sync-sovanza.inc-encrypted-data-integration",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "sourceMode": {
            "title": "Source mode",
            "enum": [
              "dataset",
              "kv_store",
              "json_records",
              "json_text"
            ],
            "type": "string",
            "description": "Where the input records come from.",
            "default": "json_records"
          },
          "sourceDatasetId": {
            "title": "Source dataset ID",
            "type": "string",
            "description": "Dataset ID to read records from if sourceMode=dataset.",
            "default": ""
          },
          "sourceDatasetName": {
            "title": "Source dataset name",
            "type": "string",
            "description": "Optional dataset name to read records from if sourceMode=dataset.",
            "default": ""
          },
          "sourceKvStoreKey": {
            "title": "Source key-value store key",
            "type": "string",
            "description": "Key-value store key to read from if sourceMode=kv_store.",
            "default": ""
          },
          "sourceJsonText": {
            "title": "Source JSON text",
            "type": "string",
            "description": "Raw JSON array/object text (or CSV) when sourceMode=json_text. May contain sensitive plaintext — stored as a secret input."
          },
          "sourceJsonRecords": {
            "title": "Source JSON records",
            "type": "array",
            "description": "Direct JSON records when sourceMode=json_records. May contain sensitive plaintext — stored as a secret input."
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum number of input records to process.",
            "default": 1000
          },
          "encryptionScope": {
            "title": "Encryption scope",
            "enum": [
              "selected_fields",
              "full_record",
              "full_payload"
            ],
            "type": "string",
            "description": "Choose whether to encrypt selected fields, each full record, or the full exported payload.",
            "default": "selected_fields"
          },
          "fieldsToEncrypt": {
            "title": "Fields to encrypt",
            "type": "array",
            "description": "List of field names or dotted paths to encrypt when encryptionScope=selected_fields.",
            "items": {
              "type": "string"
            }
          },
          "preserveFields": {
            "title": "Preserve fields",
            "type": "array",
            "description": "Fields to always leave plaintext for indexing or operational visibility.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "removePlaintextAfterEncryption": {
            "title": "Remove plaintext after encryption",
            "type": "boolean",
            "description": "Whether to remove original plaintext field after encrypted version is created.",
            "default": true
          },
          "outputEncryptedFieldSuffix": {
            "title": "Encrypted field suffix",
            "type": "string",
            "description": "Suffix for field-level encrypted outputs.",
            "default": "_encrypted"
          },
          "algorithm": {
            "title": "Algorithm",
            "enum": [
              "aes_gcm",
              "fernet"
            ],
            "type": "string",
            "description": "Preferred encryption implementation. AES-GCM is the secure default.",
            "default": "aes_gcm"
          },
          "keyMode": {
            "title": "Key mode",
            "enum": [
              "passphrase",
              "raw_key_base64"
            ],
            "type": "string",
            "description": "How the encryption key material is supplied.",
            "default": "passphrase"
          },
          "passphrase": {
            "title": "Passphrase",
            "type": "string",
            "description": "Secret passphrase for key derivation. Change this in production — the prefilled value is for demo runs only."
          },
          "rawKeyBase64": {
            "title": "Raw key (base64)",
            "type": "string",
            "description": "Raw symmetric key in base64 form. Stored as a secret input."
          },
          "keyDerivation": {
            "title": "Key derivation",
            "enum": [
              "pbkdf2_sha256",
              "scrypt"
            ],
            "type": "string",
            "description": "Key derivation function used when keyMode=passphrase.",
            "default": "pbkdf2_sha256"
          },
          "iterations": {
            "title": "Iterations / cost",
            "minimum": 1,
            "maximum": 2000000,
            "type": "integer",
            "description": "KDF iterations for PBKDF2 or cost-like tuning for scrypt.",
            "default": 200000
          },
          "includeManifest": {
            "title": "Include manifest",
            "type": "boolean",
            "description": "Include encryption metadata per record or payload.",
            "default": true
          },
          "includeHashFingerprint": {
            "title": "Include hash fingerprints",
            "type": "boolean",
            "description": "Include deterministic SHA-256 fingerprints for configured fields or records. Fingerprints are not encryption.",
            "default": true
          },
          "fingerprintFields": {
            "title": "Fingerprint fields",
            "type": "array",
            "description": "Optional fields to fingerprint before encryption.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeRecordId": {
            "title": "Include record ID",
            "type": "boolean",
            "description": "Include a normalized recordId field in the encrypted output when available.",
            "default": true
          },
          "recordIdField": {
            "title": "Record ID field",
            "type": "string",
            "description": "Field name or dotted path used to derive recordId in output rows.",
            "default": "id"
          },
          "outputMode": {
            "title": "Output mode",
            "enum": [
              "dataset",
              "kv_store",
              "both"
            ],
            "type": "string",
            "description": "Where to write encrypted output.",
            "default": "dataset"
          },
          "outputKvStoreKey": {
            "title": "Output key-value store key",
            "type": "string",
            "description": "Key used when saving encrypted output to the default key-value store.",
            "default": "ENCRYPTED_OUTPUT"
          },
          "chunkSize": {
            "title": "Chunk size",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Number of records to process per batch during loading and encryption.",
            "default": 100
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum number of records processed concurrently within each batch.",
            "default": 5
          },
          "failOnMissingFields": {
            "title": "Fail on missing fields",
            "type": "boolean",
            "description": "If true, stop the run when a configured field to encrypt is missing.",
            "default": false
          },
          "failOnInvalidRecords": {
            "title": "Fail on invalid records",
            "type": "boolean",
            "description": "If true, stop the run when a record is not a valid JSON object for the chosen mode.",
            "default": false
          },
          "includeDebugFields": {
            "title": "Include debug fields",
            "type": "boolean",
            "description": "Include safe debug metadata such as which fields were encrypted, but never plaintext or secrets.",
            "default": false
          },
          "redactLogs": {
            "title": "Redact logs",
            "type": "boolean",
            "description": "Force strict redaction of sensitive values in logs.",
            "default": true
          },
          "deterministicFingerprintSalt": {
            "title": "Fingerprint salt",
            "type": "string",
            "description": "Optional secret salt used only for fingerprints, not for encryption."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}