{
  "info": {
    "_postman_id": "bdf73098-abf2-4892-bc71-8f4a79b207d6",
    "name": "Blue Lantern Security Postman Collection",
    "description": "### Welcome to Blue Lantern Security's Postman Collection\n\nThis collection should help you understand how to automate various SAAS related requests for Blue Lantern Security, including:\n\n- Starting an analysis run for emails, malware, urls or cloud permissions\n    \n- Checking on account information\n    \n- Fetching results from previous runs\n    \n- Provisioning new licenses automatically for on-premises tool kits\n    \n\nAll requests can be run with a provisioned blue lantern API key passed as the Authorization header (no bearer). Requests can also be passed as auth tokens if you've signed in previously with username and password and want to use temporary credentials.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_exporter_id": "51488895",
    "_collection_link": "https://go.postman.co/collection/51488895-bdf73098-abf2-4892-bc71-8f4a79b207d6?source=collection_link"
  },
  "item": [
    {
      "name": "Start run",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "pm.test(\"Successful POST request\", function () {",
              "    pm.expect(pm.response.code).to.be.oneOf([200, 201]);",
              "});",
              ""
            ],
            "type": "text/javascript",
            "packages": {},
            "requests": {}
          }
        }
      ],
      "request": {
        "auth": {
          "type": "apikey",
          "apikey": [
            {
              "key": "value",
              "value": "{{API_KEY}}",
              "type": "string"
            },
            {
              "key": "key",
              "value": "Authorization",
              "type": "string"
            },
            {
              "key": "in",
              "value": "header",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"checkCost\":false,\n    \"url\":\"https://google.com\",\n    \"tool\":\"URLDETONATOR\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{BASE_URL}}/runs",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "runs"
          ]
        },
        "description": "This is a POST request, submitting data to an API via the request body. This request submits JSON data OR form data to submit files.\n\nA successful POST request typically returns a `200 OK` or `201 Created` response code.\n\nTools to run:\n\nURLDETONATOR\n\nSTATICMALWAREANALYZER\n\nEMAILANALYZER"
      },
      "response": []
    },
    {
      "name": "Get Account Info",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "pm.test(\"Successful POST request\", function () {",
              "    pm.expect(pm.response.code).to.be.oneOf([200, 201]);",
              "});",
              ""
            ],
            "type": "text/javascript",
            "packages": {},
            "requests": {}
          }
        }
      ],
      "request": {
        "auth": {
          "type": "apikey",
          "apikey": [
            {
              "key": "value",
              "value": "{{API_KEY}}",
              "type": "string"
            },
            {
              "key": "key",
              "value": "Authorization",
              "type": "string"
            },
            {
              "key": "in",
              "value": "header",
              "type": "string"
            }
          ]
        },
        "method": "GET",
        "header": [
          {
            "key": "",
            "value": "",
            "type": "text",
            "disabled": true
          }
        ],
        "url": {
          "raw": "{{BASE_URL}}/account",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "account"
          ]
        },
        "description": "This is a GET request for getting information about the active account."
      },
      "response": []
    },
    {
      "name": "Get Stripe Products",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "pm.test(\"Successful POST request\", function () {",
              "    pm.expect(pm.response.code).to.be.oneOf([200, 201]);",
              "});",
              ""
            ],
            "type": "text/javascript",
            "packages": {},
            "requests": {}
          }
        }
      ],
      "request": {
        "auth": {
          "type": "apikey",
          "apikey": [
            {
              "key": "value",
              "value": "{{API_KEY}}",
              "type": "string"
            },
            {
              "key": "key",
              "value": "Authorization",
              "type": "string"
            },
            {
              "key": "in",
              "value": "header",
              "type": "string"
            }
          ]
        },
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{BASE_URL}}/credit-store",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "credit-store"
          ]
        },
        "description": "This is a GET request to fetch available credit purchase options and their pricing."
      },
      "response": []
    },
    {
      "name": "Get Transactions",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "pm.test(\"Successful POST request\", function () {",
              "    pm.expect(pm.response.code).to.be.oneOf([200, 201]);",
              "});",
              ""
            ],
            "type": "text/javascript",
            "packages": {},
            "requests": {}
          }
        }
      ],
      "request": {
        "auth": {
          "type": "apikey",
          "apikey": [
            {
              "key": "value",
              "value": "{{API_KEY}}",
              "type": "string"
            },
            {
              "key": "key",
              "value": "Authorization",
              "type": "string"
            },
            {
              "key": "in",
              "value": "header",
              "type": "string"
            }
          ]
        },
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{BASE_URL}}/transactions",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "transactions"
          ]
        },
        "description": "This is a GET request to fetch transactions run from your user account."
      },
      "response": []
    },
    {
      "name": "Get Tools",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "pm.test(\"Successful POST request\", function () {",
              "    pm.expect(pm.response.code).to.be.oneOf([200, 201]);",
              "});",
              ""
            ],
            "type": "text/javascript",
            "packages": {},
            "requests": {}
          }
        }
      ],
      "request": {
        "auth": {
          "type": "apikey",
          "apikey": [
            {
              "key": "value",
              "value": "{{API_KEY}}",
              "type": "string"
            },
            {
              "key": "key",
              "value": "Authorization",
              "type": "string"
            },
            {
              "key": "in",
              "value": "header",
              "type": "string"
            }
          ]
        },
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{BASE_URL}}/tools",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "tools"
          ]
        },
        "description": "This is a GET request to fetch available SAAS tooling."
      },
      "response": []
    },
    {
      "name": "Accept Terms and Conditions",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "pm.test(\"Successful POST request\", function () {",
              "    pm.expect(pm.response.code).to.be.oneOf([200, 201]);",
              "});",
              ""
            ],
            "type": "text/javascript",
            "packages": {},
            "requests": {}
          }
        }
      ],
      "request": {
        "auth": {
          "type": "apikey",
          "apikey": [
            {
              "key": "value",
              "value": "{{API_KEY}}",
              "type": "string"
            },
            {
              "key": "key",
              "value": "Authorization",
              "type": "string"
            },
            {
              "key": "in",
              "value": "header",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{BASE_URL}}/accept-terms",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "accept-terms"
          ]
        },
        "description": "This is a POST request to accept terms and conditions via the API."
      },
      "response": []
    },
    {
      "name": "Get Runs Info",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "pm.test(\"Successful POST request\", function () {",
              "    pm.expect(pm.response.code).to.be.oneOf([200, 201]);",
              "});",
              ""
            ],
            "type": "text/javascript",
            "packages": {},
            "requests": {}
          }
        }
      ],
      "request": {
        "auth": {
          "type": "apikey",
          "apikey": [
            {
              "key": "value",
              "value": "{{API_KEY}}",
              "type": "string"
            },
            {
              "key": "key",
              "value": "Authorization",
              "type": "string"
            },
            {
              "key": "in",
              "value": "header",
              "type": "string"
            }
          ]
        },
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{BASE_URL}}/runs/{{JOB ID}}",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "runs",
            "{{JOB ID}}"
          ]
        },
        "description": "This is a GET request to fetch information related to any analysis runs.\n\nIf you pass the ID of a job as a PATH parameter then it will fetch just the status of the specific JOB ID."
      },
      "response": []
    },
    {
      "name": "Get Results By Job ID",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "pm.test(\"Successful POST request\", function () {",
              "    pm.expect(pm.response.code).to.be.oneOf([200, 201]);",
              "});",
              ""
            ],
            "type": "text/javascript",
            "packages": {},
            "requests": {}
          }
        }
      ],
      "request": {
        "auth": {
          "type": "apikey",
          "apikey": [
            {
              "key": "value",
              "value": "{{API_KEY}}",
              "type": "string"
            },
            {
              "key": "key",
              "value": "Authorization",
              "type": "string"
            },
            {
              "key": "in",
              "value": "header",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [
          {
            "key": "Accept",
            "value": "image/png",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"jobId\": \"{{JOB ID}}\",\n    \"fetchScreenshot\":true\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{BASE_URL}}/results",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "results"
          ]
        },
        "description": "Fetches the report generated from a specific analysis run (EMAILANALYZER, URLDETONATOR, STATICMALWAREANALYZER).\n\nYou need to pass the JOB ID in the JSON body of the request.\n\nFor URLDETONATOR analysis runs if you pass the fetchScreenshot: true JSON key value pair then just the resulting screenshot will be returned."
      },
      "response": []
    },
    {
      "name": "Get API Key",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{TOKEN}}",
              "type": "string"
            }
          ]
        },
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{BASE_URL}}/api-keys",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "api-keys"
          ]
        },
        "description": "GET request to fetch if there are any active API keys for the account. Accounts may have only 1 active API key. This does not return the API key itself, just the expiration of any active keys."
      },
      "response": []
    },
    {
      "name": "Get Cloud Permissions Data",
      "request": {
        "auth": {
          "type": "apikey",
          "apikey": [
            {
              "key": "value",
              "value": "{{API_KEY}}",
              "type": "string"
            },
            {
              "key": "key",
              "value": "Authorization",
              "type": "string"
            },
            {
              "key": "in",
              "value": "header",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\n    \"permission\": \"accessapproval.requests.list\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{BASE_URL}}/cloud-permissions-context",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "cloud-permissions-context"
          ]
        },
        "description": "This POST request fetches context on cloud permissions if they exist."
      },
      "response": []
    },
    {
      "name": "Create API Key",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{TOKEN}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\"expiration_timestamp\": \"2030-02-05T00:00:00.000Z\"}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{BASE_URL}}/api-keys",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "api-keys"
          ]
        },
        "description": "Creates an API key for an account via POST request. The user can submit the desired expiration time (up to 1 year). Only one API key can be active at a time."
      },
      "response": []
    },
    {
      "name": "Create On-Prem_License",
      "request": {
        "auth": {
          "type": "apikey",
          "apikey": [
            {
              "key": "value",
              "value": "{{API_KEY}}",
              "type": "string"
            },
            {
              "key": "key",
              "value": "Authorization",
              "type": "string"
            },
            {
              "key": "in",
              "value": "header",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [],
        "body": {
          "mode": "raw",
          "raw": "{\"requested_credits\": 400}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{BASE_URL}}/on-premises-license",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "on-premises-license"
          ]
        },
        "description": "This POST request generates an on-premises license with the desired amount of credits."
      },
      "response": []
    },
    {
      "name": "Get On Prem Agent Download Link",
      "request": {
        "auth": {
          "type": "apikey",
          "apikey": [
            {
              "key": "value",
              "value": "{{API_KEY}}",
              "type": "string"
            },
            {
              "key": "key",
              "value": "Authorization",
              "type": "string"
            },
            {
              "key": "in",
              "value": "header",
              "type": "string"
            }
          ]
        },
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{BASE_URL}}/on-premises-agent",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "on-premises-agent"
          ]
        },
        "description": "This GET request provides the download link for the current version of the on-prem agent."
      },
      "response": []
    },
    {
      "name": "Delete API Key",
      "request": {
        "auth": {
          "type": "bearer",
          "bearer": [
            {
              "key": "token",
              "value": "{{TOKEN}}",
              "type": "string"
            }
          ]
        },
        "method": "DELETE",
        "header": [],
        "url": {
          "raw": "{{BASE_URL}}/api-keys",
          "host": [
            "{{BASE_URL}}"
          ],
          "path": [
            "api-keys"
          ]
        },
        "description": "This request deletes an API key."
      },
      "response": []
    }
  ]
}