{
  "openapi": "3.0.1",
  "info": {
    "title": "New Zealand Visa Processing Time Monitor",
    "description": "Look up and monitor Immigration New Zealand's official published visa processing times (50th/80th percentile working days) per visa type, with a recurring monitor mode that flags whenever Immigration NZ updates its own figures.",
    "version": "0.1",
    "x-build-id": "DWgcdHZ7BfnDVDU6b"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nerolabs~nz-visa-processing-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nerolabs-nz-visa-processing-monitor",
        "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/nerolabs~nz-visa-processing-monitor/runs": {
      "post": {
        "operationId": "runs-sync-nerolabs-nz-visa-processing-monitor",
        "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/nerolabs~nz-visa-processing-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-nerolabs-nz-visa-processing-monitor",
        "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": {
          "visaName": {
            "title": "Visa name (single lookup)",
            "type": "string",
            "description": "The visa's name as Immigration NZ publishes it, e.g. 'Skilled Migrant Category Resident Visa'. Matched case-insensitively, exact match first, then a unique substring match. Don't know the exact name? Run once with 'List all available visas' turned on instead, or use 'Visa ID' below if you already have the numeric ID from a previous run."
          },
          "visaId": {
            "title": "Visa ID (single lookup, optional)",
            "type": "string",
            "description": "The numeric ID Immigration NZ uses internally for this visa (returned by 'List all available visas', or by a previous lookup's visaId field). Takes priority over 'Visa name' above if both are given, and skips the name-matching step entirely."
          },
          "targets": {
            "title": "Targets (bulk lookup / Monitor mode)",
            "type": "array",
            "description": "A list of visas to check, one per line, each either a visa name (matched the same way as 'Visa name' above) or a numeric visa ID. Required for Monitor mode (that's what gives each visa a stable identity to track over time). Also the fastest way to check many visas in one run. Don't know the exact names? Run once with 'List all available visas' turned on first.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "monitorMode": {
            "title": "Monitor mode (watch for processing-time changes over time)",
            "type": "boolean",
            "description": "When true, the Actor remembers each visa's last-seen 50th/80th percentile processing times and reports only what changed since the last check, or a cheap no-change confirmation. Schedule this Actor to run monthly with the same targets and watchlistId (Immigration NZ updates these figures roughly monthly). Requires visaName, visaId and/or targets.",
            "default": false
          },
          "watchlistId": {
            "title": "Watchlist ID (optional, Monitor mode only)",
            "type": "string",
            "description": "Only needed if you're running more than one independent monitored watchlist from the same Apify account (e.g. one per client) and want their change history kept separate. Leave as default otherwise.",
            "default": "default"
          },
          "listAvailableVisas": {
            "title": "List all available visas (free reference lookup)",
            "type": "boolean",
            "description": "When true, ignores every other input and instead returns the full current list of every visa Immigration NZ publishes a processing time for (130+), with its exact name and numeric ID, so you can find what to use above. This reference lookup is never charged.",
            "default": false
          },
          "clients": {
            "title": "Client tracking (your caseload, with dates)",
            "type": "array",
            "description": "Track your own caseload: one row per client with their visa and application date. Ignores every other input when used. Returns the current percentile figures plus the same estimated decision-date window Immigration NZ's own tool shows you, worked out from the application date you give (a plain working-days calculation, weekends excluded; NZ public holidays are not accounted for, so treat the window as a close estimate, not exact). Each row: {\"clientLabel\": \"your own reference, e.g. a name or file number\", \"visaName\": \"Skilled Migrant Category Resident Visa\" (or use \"visaId\" instead if known), \"applicationDate\": \"2026-03-01\"}.",
            "default": []
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}