zap_target_import
Import OpenAPI/Swagger, GraphQL, or SOAP definitions into ZAP to prepare API endpoints for security testing.
Instructions
Import an OpenAPI/Swagger definition, GraphQL schema, or SOAP WSDL to prepare API endpoints for testing. Use when you have an API definition; use zap_crawl_start to discover ordinary web pages. Requires a reachable, configured ZAP instance with the matching OpenAPI, GraphQL, or SOAP add-on. Import changes the current ZAP session and may send requests to the definition source and API targets; use only authorized targets. It does not start an active scan: after reviewing import messages, call zap_attack_start with the API target URL when active testing is needed. Returns plain text containing definition type, source kind, source, and ZAP import messages or job IDs when provided, not findings or a structured JSON result. Review warnings before proceeding. Invalid inputs, blocked URLs, and ZAP API failures raise errors.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | Required HTTP(S) definition URL reachable by ZAP and allowed by server URL policy, or a file path readable inside the ZAP host/container (for example /zap/wrk/openapi.yaml). File contents are not accepted here. | |
| sourceKind | Yes | Required source mode: url for a definition ZAP downloads, or file for a definition on ZAP's filesystem. Case-insensitive. | |
| endpointUrl | No | Required for graphql: HTTP(S) API endpoint to test, for example https://api.example.com/graphql; must be reachable by ZAP and allowed by server URL policy. Ignored for openapi and soap. | |
| hostOverride | No | Optional OpenAPI target override allowed by server URL policy: a full HTTP(S) URL or authority/path with an explicit host, for example https://api.example.com/v1 or api.example.com:9090/v1. Scheme-only and path-only overrides are rejected; use a full URL instead. Omit or leave blank only for trusted definition-derived targets constrained by ZAP egress controls. Ignored for graphql and soap. | |
| definitionType | Yes | Required definition format: openapi (OpenAPI/Swagger), graphql (GraphQL schema), or soap (WSDL). Case-insensitive. |