Update Trigger

Update an existing trigger's conditions.

Endpoint

PUT https://enterprise.guardis.io/v1/triggers/update

Authentication

Include your API key in the X-API-Key header.

X-API-Key: your_api_key_here

Request Body

{
  "trigger_id": "my-unique-trigger-001",
  "conditions": [
    {
      "field": "total_volume_usd",
      "operator": "gt",
      "value": "250000"
    },
    {
      "field": "number_of_buys",
      "operator": "gt",
      "value": "1000"
    }
  ]
}
Field
Type
Required
Description

trigger_id

string

Yes

The unique identifier of the trigger to update

conditions

array

Yes

New conditions to replace the existing ones

Condition Object

Field
Type
Required
Description

field

string

Yes

The pool metric to monitor

operator

string

Yes

Comparison operator: gt (greater than) or lt (less than)

value

string

Yes

Threshold value for the condition

Available Fields

Field
Type
Description

sol_amount

decimal

Amount of SOL currently in the pool

token_amount

decimal

Amount of tokens currently in the pool

number_of_buys

integer

Total buy transactions on the pool

number_of_sells

integer

Total sell transactions on the pool

buy_volume_usd

decimal

Cumulative buy volume in USD

sell_volume_usd

decimal

Cumulative sell volume in USD

total_volume_usd

decimal

Total trading volume in USD


Example Request

curl -X PUT "https://enterprise.guardis.io/v1/triggers/update" \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "trigger_id": "my-unique-trigger-001",
    "conditions": [
      {
        "field": "total_volume_usd",
        "operator": "gt",
        "value": "250000"
      },
      {
        "field": "number_of_buys",
        "operator": "gt",
        "value": "1000"
      }
    ]
  }'

Response

Success (200 OK)

{
  "trigger_id": "my-unique-trigger-001",
  "pair_address": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
  "conditions": [
    {
      "field": "total_volume_usd",
      "operator": "gt",
      "value": "250000"
    },
    {
      "field": "number_of_buys",
      "operator": "gt",
      "value": "1000"
    }
  ],
  "status": "active",
  "created_at": "2025-01-15T14:32:08.000Z",
  "updated_at": "2025-01-15T16:45:22.000Z"
}

Example Usage

JavaScript:

const response = await fetch("https://enterprise.guardis.io/v1/triggers/update", {
  method: "PUT",
  headers: {
    "X-API-Key": "your_api_key_here",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    trigger_id: "my-unique-trigger-001",
    conditions: [
      { field: "total_volume_usd", operator: "gt", value: "250000" },
      { field: "number_of_buys", operator: "gt", value: "1000" }
    ]
  })
});

const trigger = await response.json();
console.log(`Trigger updated: ${trigger.trigger_id}`);
console.log(`Updated at: ${trigger.updated_at}`);

Python:

import requests

response = requests.put(
    "https://enterprise.guardis.io/v1/triggers/update",
    headers={
        "X-API-Key": "your_api_key_here",
        "Content-Type": "application/json"
    },
    json={
        "trigger_id": "my-unique-trigger-001",
        "conditions": [
            {"field": "total_volume_usd", "operator": "gt", "value": "250000"},
            {"field": "number_of_buys", "operator": "gt", "value": "1000"}
        ]
    }
)

trigger = response.json()
print(f"Trigger updated: {trigger['trigger_id']}")
print(f"Updated at: {trigger['updated_at']}")

Error Responses

Status Code
Description

400

Invalid request body or missing required fields

401

Missing or invalid API key

404

Trigger not found

422

Invalid field name, operator, or value format

500

Internal server error

{
  "code": 404,
  "message": "Trigger with ID 'my-unique-trigger-001' not found"
}
{
  "code": 422,
  "message": "Invalid operator 'gte'. Valid operators: gt, lt"
}

Last updated