CG Scanning API V2
latest
  • latest
  • 5.2.0
HomeDocs
HomeDocs
latest
  • latest
  • 5.2.0
  1. Scans
  • Getting Started
  • Authentication
  • Common Error Responses
  • Filtering Data
  • Authentication
    • User Confirmation
      • Confirm a User
      • Show confirmation form
    • User Invitation
      • Accept an invitation
      • Pre-Accept invitation check
    • Password Reset
      • Forgot Password
      • Reset Password
    • Impersonation
      • Impersonate user
      • Impersonate user
    • MFA
      • Check 2fa
      • Send SMS OTP
    • Sign in authentication
      POST
    • Sign in with recovery code
      POST
    • Sign out authentication
      DELETE
  • Targets
    • List targets
      GET
    • Create Target
      POST
    • Show a target
      GET
    • Updates a target
      PUT
    • Delete a target
      DELETE
    • Delete targets
      DELETE
  • Scans
    • Scan Histories
      • List of history for a scan
      • History details for a scan
    • Scan Hosts
      • List of hosts for a scan
      • Host details for a scan
    • Scan Vulnerabilities
      • List of vulnerabilities for a scan
      • Show vulnerability details
      • Statistics for a scan
    • List scans
      GET
    • Create Scan
      POST
    • Show a scan
      GET
    • Updates a scan
      PUT
    • Delete a scan
      DELETE
    • Delete scans
      DELETE
    • Start a scan
      POST
    • Stop a scan
      POST
    • List upcoming scans
      GET
    • List recent scans that have been completed
      GET
    • List of the running scans
      GET
    • Create Scan from Wizard
      POST
  • Reports
    • List Reports
    • Show a report
    • Delete a report
    • Delete reports
    • Generates a report file
    • Downloads a report file
    • Check if a report file exists
  • Vulnerabilities
    • List of vulnerabilities
    • Vulnerability details
    • Total Vulnerabilities (widget)
    • Top Vulnerabilities (widget)
    • PCI Compliant (widget)
    • (AI) Send prompt about a given Vulnerability
    • (AI) Chat history about a given Vulnerability
  • Exceptions
    • List Exceptions
    • Create Exception
    • Update Exception
    • Show an exception
    • Delete an exception
    • Show exception details
    • Delete exceptions
    • Activate exceptions
    • Reset exceptions
    • Show the exceptions statistics
  • Schedules
    • List Schedules
    • Create Schedule
    • Updates a schedule
    • Show a schedule
    • Delete a schedule
    • Delete schedules
    • Calculate First Time Schedule Date
    • Calculate Next Schedule Dates
  • Webhooks
    • Deliveries
      • List all deliveries for a webhook
      • Get a delivery for a webhook
    • List all webhooks
    • Create a webhook
    • Show a webhook
    • Update a webhook
    • Delete a webhook
    • Activate a webhook
    • Deactivate a webhook
  • Advanced Reports
    • List Advanced Reports
    • Create an advanced report
    • Show an advanced report
    • Update an advanced report
    • Delete an advanced report
    • Delete advanced reports
    • Generates an advanced report file
    • Downloads an advanced report file
  • Audit
    • Get all events
    • Get event by id
  • Notifications
    • List Notifications
    • Show a notification
    • Delete a notification
    • Mark as read a notification
    • Mark as seen a notification
    • Mark as read all notifications
    • Mark as seen all notifications
  • Hosts
    • List of hosts
    • Host details
    • List of most vulnerable hosts
  • Scanners
    • List scanners
    • Create scanner
    • Show scanner
    • Update scanner
    • Delete scanner
    • List activated scanners
    • Activate scanner
    • Deactivate scanner
    • Update scanner app type
    • Assign a scanner to an organization
    • Verify a scanner
  • Port Lists
    • List port lists
    • Create a port list
    • Show a port list
    • Update a port list
    • Delete a port list
    • List activated port lists
    • Add a port range to a port list
    • Delete a port range to a port list
    • Activate a port list
    • Deactivate a port list
    • Updates the app_type of a port list
    • Sync the a port lists
  • User
    • User 2FA
      • Enable 2FA
      • Verify 2FA installation
      • Disable 2FA
      • Lookup phone number
      • Default 2FA method
      • Generate Recovery Codes
      • Get Recovery Codes
    • User Preferences
      • Get users notification preferences
      • Change users product
      • Enable user's event notification preference
      • Disable user's event notification preference
    • Get current user
    • Update current user
    • Change current user password
    • Get current user active plans (Not implemented yet)
    • Get organization members
    • Get current user products
    • Get current organization
    • Update current organization
    • Get subscriptions history
    • Change users product
    • Checks if authorization token is valid
    • Get current user permissions
    • Check if the user can be deleted
    • Delete my account
    • Generates a new access token
    • Revokes the current access token
    • (Admin) Transfers all the resources from the user to another user
  • Organizations
    • Organization Subscriptions
      • Retrieves all subscriptions of organization
      • Retrieves all active subscriptions of organization
      • Show a subscription of organization
      • 'Update organization's subscription'
      • Assign features to a subscription
      • Revoke features from a subscription
    • Subscribe to a plan
    • List organizations
    • Create Organization
    • List dependent subscriptions
    • Retrieve an organization
    • Update an organization
    • Delete an organization
    • Subscribe an organization to a plan
    • Unsubscribe an organization from a plan
    • Change users Organization
    • Export organizations
  • Users
    • List Users
    • Create User
    • Show User
    • Update User
    • Delete a User
    • Create Customer
    • Invite User
    • Resend Confirmation Instructions
    • Import Users
    • Check if a user can be deleted
    • Inherit all the resources from a user
    • Export all users to a CSV file
    • Set partner
    • Unset partner
  • Whitelabel Settings
    • Show the white label settings
    • Show the white label settings
    • Update white label settings
  1. Scans

Create Scan from Wizard

POST
/v2/scans/wizard_create
Scans
Last modified:2025-04-24 10:59:46
This endpoint allows you to streamline the process of setting up a scan by creating a target,
a scan for that target, and an optional schedule, all in a single request.
Instead of making three separate API calls to create a target, associate a scan with that target,
and set up a schedule for the scan, you can use this endpoint to simplify and accelerate the workflow.

Request

Body Params application/json
scan
object 
optional
name
string 
required
The scan name
Example:
My Scan
comment
string 
optional
The scan comment
Example:
My comment
run_now
boolean 
optional
If true, runs the scan after creation
Example:
true
target_id
string <uuid>
required
The target uuid
target
object 
optional
schedule_id
string <uuid>
optional
The schedule uuid.
schedule
object 
optional
config_id
string <uuid>
optional
The config uuid
scanner_id
string <uuid>
optional
The scanner uuid
Example
{
    "scan": {
        "name": "My Scan",
        "comment": "My comment",
        "run_now": true,
        "target_id": "d3bcdc92-4191-401b-ad0c-42056c6efab9",
        "target": {
            "name": "My Target",
            "hosts": "155.168.1.0/24",
            "exclude_hosts": "155.168.1.55",
            "comment": "my comment"
        },
        "schedule_id": "8929bb67-0da1-406c-99d2-5447376a4f58",
        "schedule": {
            "name": "My Schedule",
            "comment": "My comment",
            "period": 4,
            "period_unit": "day",
            "first_time": "2023-11-25 19:21:14 UTC",
            "timezone": "UTC",
            "bymonthday": "1",
            "byday": "1SU"
        },
        "config_id": "d1d31429-d888-4f1c-b9c1-4e842f9bce5b",
        "scanner_id": "43593f58-da3f-45f0-a7bf-8763ef29bdf1"
    }
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/v2/scans/wizard_create' \
--header 'Content-Type: application/json' \
--data-raw '{
    "scan": {
        "name": "My Scan",
        "comment": "My comment",
        "run_now": true,
        "target_id": "d3bcdc92-4191-401b-ad0c-42056c6efab9",
        "target": {
            "name": "My Target",
            "hosts": "155.168.1.0/24",
            "exclude_hosts": "155.168.1.55",
            "comment": "my comment"
        },
        "schedule_id": "8929bb67-0da1-406c-99d2-5447376a4f58",
        "schedule": {
            "name": "My Schedule",
            "comment": "My comment",
            "period": 4,
            "period_unit": "day",
            "first_time": "2023-11-25 19:21:14 UTC",
            "timezone": "UTC",
            "bymonthday": "1",
            "byday": "1SU"
        },
        "config_id": "d1d31429-d888-4f1c-b9c1-4e842f9bce5b",
        "scanner_id": "43593f58-da3f-45f0-a7bf-8763ef29bdf1"
    }
}'

Responses

🟢201Created
application/json
Scan created
Body
object {0}
Example
{
    "content": {
        "application/json": {
            "schema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string",
                                "format": "uuid"
                            },
                            "type": {
                                "type": "string"
                            },
                            "attributes": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "string",
                                        "format": "uuid"
                                    },
                                    "name": {
                                        "type": "string",
                                        "description": "Name of the scan"
                                    },
                                    "comment": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "nullable": true,
                                        "description": "Comment about the scan"
                                    },
                                    "creation_time": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "modification_time": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "editable": {
                                        "type": "bool",
                                        "description": "True if scan can be modified"
                                    },
                                    "app_type": {
                                        "type": "string"
                                    },
                                    "status": {
                                        "type": "string",
                                        "description": "Status of the scan"
                                    },
                                    "schedule_next_time": {
                                        "type": "string",
                                        "description": "Next time the scan will run",
                                        "nullable": true
                                    },
                                    "target": {
                                        "type": "object",
                                        "description": "Target of the scan",
                                        "properties": {
                                            "id": {
                                                "type": "string",
                                                "format": "uuid"
                                            },
                                            "name": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "scan_enabled": {
                                        "type": "bool",
                                        "description": "True if scan is enabled"
                                    },
                                    "end_time": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date-time",
                                        "nullable": true
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
🟠401Unauthorized
🟠422Parameter Error
Modified at 2025-04-24 10:59:46
Previous
List of the running scans
Next
List Reports
Built with