← Detectify + Alpaca integrations

Cancel Order with Alpaca API on New Medium Risk Finding from Detectify API

Pipedream makes it easy to connect APIs for Alpaca, Detectify and 2,700+ other apps remarkably fast.

Trigger workflow on
New Medium Risk Finding from the Detectify API
Next, do this
Cancel Order with the Alpaca API
No credit card required
Intro to Pipedream
Watch us build a workflow
Watch us build a workflow
8 min
Watch now ➜

Trusted by 1,000,000+ developers from startups to Fortune 500 companies

Adyen logo
Appcues logo
Bandwidth logo
Checkr logo
ChartMogul logo
Dataminr logo
Gopuff logo
Gorgias logo
LinkedIn logo
Logitech logo
Replicated logo
Rudderstack logo
SAS logo
Scale AI logo
Webflow logo
Warner Bros. logo
Adyen logo
Appcues logo
Bandwidth logo
Checkr logo
ChartMogul logo
Dataminr logo
Gopuff logo
Gorgias logo
LinkedIn logo
Logitech logo
Replicated logo
Rudderstack logo
SAS logo
Scale AI logo
Webflow logo
Warner Bros. logo

Developers Pipedream

Getting Started

This integration creates a workflow with a Detectify trigger and Alpaca action. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Select this integration
  2. Configure the New Medium Risk Finding trigger
    1. Connect your Detectify account
    2. Configure timer
    3. Select a Domain Token
  3. Configure the Cancel Order action
    1. Connect your Alpaca account
    2. Optional- Configure Paper API
    3. Select a Order Id
  4. Deploy the workflow
  5. Send a test event to validate your setup
  6. Turn on the trigger

Details

This integration uses pre-built, source-available components from Pipedream's GitHub repo. These components are developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

Trigger

Description:Emit new event when a moderate security finding at a medium risk level is recognized.
Version:0.0.1
Key:detectify-new-medium-risk-finding

Detectify Overview

The Detectify API provides a powerful interface for automating and integrating continuous web application security testing into your development cycle. With this API, you can programmatically start scans, fetch scan profiles, retrieve findings, and manage your Detectify domain assets. When leveraged through Pipedream, you can create serverless workflows that trigger actions in other apps based on the results from Detectify, ensuring timely responses to security threats and streamlining your DevSecOps processes.

Trigger Code

import common from "../common/base.mjs";
import sampleEmit from "./test-event.mjs";

export default {
  ...common,
  key: "detectify-new-medium-risk-finding",
  name: "New Medium Risk Finding",
  description: "Emit new event when a moderate security finding at a medium risk level is recognized.",
  version: "0.0.1",
  type: "source",
  dedupe: "unique",
  methods: {
    ...common.methods,
    getResourceFn() {
      return this.detectify.listVulnerabilities;
    },
    getArgs(lastTs) {
      return {
        params: {
          "severity[]": "medium",
          "asset_token[]": this.domainToken,
          "created_after": lastTs,
        },
      };
    },
    getResourceType() {
      return "vulnerabilities";
    },
    generateMeta(vulnerability) {
      return {
        id: vulnerability.uuid,
        summary: `New medium risk finding: ${vulnerability.title}`,
        ts: Date.parse(this.getTs(vulnerability)),
      };
    },
  },
  sampleEmit,
};

Trigger Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
DetectifydetectifyappThis component uses the Detectify app.
N/Adb$.service.dbThis component uses $.service.db to maintain state between executions.
timer$.interface.timer
Domain TokendomainTokenstringSelect a value from the drop down menu.

Trigger Authentication

Detectify uses API keys for authentication. When you connect your Detectify account, Pipedream securely stores the keys so you can easily authenticate to Detectify APIs in both code and no-code steps.

To retrieve your API Key,

  • Navigate to your Detectify account and sign in
  • Click the Team menu on the top left
  • Go to “Account Settings” > “API-Keys”

About Detectify

The External Attack Surface Management platform powered by elite ethical hackers.

Action

Description:Attempts to cancel an open order. If the order is no longer cancelable (example: status=`filled`), the server will reject the request, [See the docs](https://alpaca.markets/docs/api-references/trading-api/orders/#cancel-an-order)
Version:0.0.1
Key:alpaca-cancel-order

Alpaca Overview

Alpaca API allows you to harness the power of automated trading by providing an interface to manage your stock and equity portfolio through simple API calls. It's particularly suited for building trading bots, algorithmic trading strategies, or just automating interactions with your investment portfolio. Whether you're looking to place trades based on specific market conditions, automatically adjust your portfolio in response to certain triggers, or simply streamline your investment activities, Alpaca's trading API offers a robust solution.

Action Code

import app from "../../alpaca.app.mjs";

export default {
  type: "action",
  key: "alpaca-cancel-order",
  version: "0.0.1",
  name: "Cancel Order",
  description: "Attempts to cancel an open order. If the order is no longer cancelable (example: status=`filled`), the server will reject the request, [See the docs](https://alpaca.markets/docs/api-references/trading-api/orders/#cancel-an-order)",
  props: {
    app,
    isPaperAPI: {
      propDefinition: [
        app,
        "isPaperAPI",
      ],
    },
    orderId: {
      propDefinition: [
        app,
        "orderId",
        (configuredProps) => ({
          isPaperAPI: configuredProps.isPaperAPI,
        }),
      ],
    },
  },
  async run ({ $ }) {
    const response = await this.app.cancelOrder({
      $,
      isPaperAPI: this.isPaperAPI,
      orderId: this.orderId,
    });
    $.export("$summary", `Order(ID:${this.orderId}) has been cancelled.`);
    return response;
  },
};

Action Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI.

LabelPropTypeDescription
AlpacaappappThis component uses the Alpaca app.
Paper APIisPaperAPIboolean

Set to true if Paper API is used. Default is false.

Order IdorderIdstringSelect a value from the drop down menu.

Action Authentication

Alpaca uses OAuth authentication. When you connect your Alpaca account, Pipedream will open a popup window where you can sign into Alpaca and grant Pipedream permission to connect to your account. Pipedream securely stores and automatically refreshes the OAuth tokens so you can easily authenticate any Alpaca API.

Pipedream requests the following authorization scopes when you connect your account:

account:writetradingdata

About Alpaca

Commission-Free API First Stock Brokerage

More Ways to Connect Alpaca + Detectify

Cancel All Orders with Alpaca API on New High Risk Finding from Detectify API
Detectify + Alpaca
 
Try it
Cancel Order with Alpaca API on New High Risk Finding from Detectify API
Detectify + Alpaca
 
Try it
Close All Positions with Alpaca API on New High Risk Finding from Detectify API
Detectify + Alpaca
 
Try it
Close Position with Alpaca API on New High Risk Finding from Detectify API
Detectify + Alpaca
 
Try it
Get Account Info with Alpaca API on New High Risk Finding from Detectify API
Detectify + Alpaca
 
Try it
New High Risk Finding from the Detectify API

Emit new event when a severe security finding at high risk level is detected.

 
Try it
New Medium Risk Finding from the Detectify API

Emit new event when a moderate security finding at a medium risk level is recognized.

 
Try it
New Scan Started from the Detectify API

Emit new event as soon as a new security scan on the entered domain commences

 
Try it
Cancel All Orders with the Alpaca API

Attempts to cancel all open orders. A response will be provided for each order that is attempted to be cancelled. If an order is no longer cancelable, the server reject the request, See the docs

 
Try it
Cancel Order with the Alpaca API

Attempts to cancel an open order. If the order is no longer cancelable (example: status=filled), the server will reject the request, See the docs

 
Try it
Close All Positions with the Alpaca API

Closes (liquidates) all of the account’s open long and short positions. A response will be provided for each order that is attempted to be cancelled. If an order is no longer cancelable, the server will reject the request, See the docs

 
Try it
Close Position with the Alpaca API

Closes (liquidates) the account’s open position. Works for both long and short positions, See the docs

 
Try it
Get Account Info with the Alpaca API

Returns the account info, See the docs

 
Try it

Explore Other Apps

1
-
0
of
2,700+
apps by most popular