Launch a scan
curl --request POST \
--url https://app.gecko.security/api/v1/scans \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "Paperbaum",
"gitlabUrl": "https://gitlab.com/gecko-security/Paperbaum/-/tree/main"
}
'import requests
url = "https://app.gecko.security/api/v1/scans"
payload = {
"name": "Paperbaum",
"gitlabUrl": "https://gitlab.com/gecko-security/Paperbaum/-/tree/main"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Paperbaum',
gitlabUrl: 'https://gitlab.com/gecko-security/Paperbaum/-/tree/main'
})
};
fetch('https://app.gecko.security/api/v1/scans', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.gecko.security/api/v1/scans",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Paperbaum',
'gitlabUrl' => 'https://gitlab.com/gecko-security/Paperbaum/-/tree/main'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.gecko.security/api/v1/scans"
payload := strings.NewReader("{\n \"name\": \"Paperbaum\",\n \"gitlabUrl\": \"https://gitlab.com/gecko-security/Paperbaum/-/tree/main\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.gecko.security/api/v1/scans")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Paperbaum\",\n \"gitlabUrl\": \"https://gitlab.com/gecko-security/Paperbaum/-/tree/main\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gecko.security/api/v1/scans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Paperbaum\",\n \"gitlabUrl\": \"https://gitlab.com/gecko-security/Paperbaum/-/tree/main\"\n}"
response = http.request(request)
puts response.read_body{
"version": "v1",
"data": {
"scanId": "f5d35de5-8fc8-4a01-8e28-3bae5d6d26ad",
"name": "Paperbaum",
"status": "launched",
"repository": {
"fullName": "gecko-security/Paperbaum",
"branch": "main",
"instance": "gitlab.com"
},
"taskArn": "arn:aws:ecs:eu-west-2:123456789012:task/gecko/1234567890abcdef"
}
}Scans
Launch a scan
Starts a new scan for a GitLab repository that the team can access. This route requires a key whose role includes the scans.run permission, a configured team GitLab integration, and available scan capacity on the current plan. Gecko resolves the target branch in this order: request branch, branch in the GitLab URL, then the repository default branch.
POST
/
api
/
v1
/
scans
Launch a scan
curl --request POST \
--url https://app.gecko.security/api/v1/scans \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "Paperbaum",
"gitlabUrl": "https://gitlab.com/gecko-security/Paperbaum/-/tree/main"
}
'import requests
url = "https://app.gecko.security/api/v1/scans"
payload = {
"name": "Paperbaum",
"gitlabUrl": "https://gitlab.com/gecko-security/Paperbaum/-/tree/main"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Paperbaum',
gitlabUrl: 'https://gitlab.com/gecko-security/Paperbaum/-/tree/main'
})
};
fetch('https://app.gecko.security/api/v1/scans', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.gecko.security/api/v1/scans",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Paperbaum',
'gitlabUrl' => 'https://gitlab.com/gecko-security/Paperbaum/-/tree/main'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.gecko.security/api/v1/scans"
payload := strings.NewReader("{\n \"name\": \"Paperbaum\",\n \"gitlabUrl\": \"https://gitlab.com/gecko-security/Paperbaum/-/tree/main\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.gecko.security/api/v1/scans")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Paperbaum\",\n \"gitlabUrl\": \"https://gitlab.com/gecko-security/Paperbaum/-/tree/main\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gecko.security/api/v1/scans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Paperbaum\",\n \"gitlabUrl\": \"https://gitlab.com/gecko-security/Paperbaum/-/tree/main\"\n}"
response = http.request(request)
puts response.read_body{
"version": "v1",
"data": {
"scanId": "f5d35de5-8fc8-4a01-8e28-3bae5d6d26ad",
"name": "Paperbaum",
"status": "launched",
"repository": {
"fullName": "gecko-security/Paperbaum",
"branch": "main",
"instance": "gitlab.com"
},
"taskArn": "arn:aws:ecs:eu-west-2:123456789012:task/gecko/1234567890abcdef"
}
}Authorizations
Team-scoped Gecko API key. Keys start with gk_.
Body
application/json
Was this page helpful?
⌘I