Conditions
List conditions
GET
/
automation
/
conditions
/
List Conditions
curl --request GET \
--url https://api.keywordsai.co/automation/conditions/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.keywordsai.co/automation/conditions/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.keywordsai.co/automation/conditions/', 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://api.keywordsai.co/automation/conditions/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.keywordsai.co/automation/conditions/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.keywordsai.co/automation/conditions/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.keywordsai.co/automation/conditions/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "cond-12345",
"condition_slug": "success_logs",
"name": "Successful Requests",
"condition_type": "single_log",
"description": "Matches logs with HTTP status code 200",
"condition_policy": {
"rules": [
{
"field": "status_code",
"operator": "equals",
"value": 200
}
],
"connector": "AND"
},
"unique_organization_id": "org-abc123",
"created_at": "2025-01-15T10:00:00Z",
"updated_at": "2025-01-15T10:00:00Z"
}
],
"count": 1,
"next": null,
"previous": null,
"filters_data": {}
}
Returns a paginated list of automation conditions for your organization.
Note: Use your API Key (not JWT token) for all requests. You can find your API keys in the Keywords AI platform under Settings > API Keys.
Note: Save the
Authentication
All endpoints require API key authentication:Authorization: Bearer YOUR_API_KEY
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number for pagination (default: 1) |
page_size | integer | Number of items per page (default: 20) |
search | string | Search conditions by name or slug |
condition_type | string | Filter by condition type (e.g., "single_log") |
Examples
Basic List Request
import requests
url = "https://api.keywordsai.co/automation/conditions/"
headers = {
"Authorization": "Bearer YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
print(response.json())
curl -X GET "https://api.keywordsai.co/automation/conditions/" \
-H "Authorization: Bearer YOUR_API_KEY"
With Pagination
params = {
"page": 1,
"page_size": 10
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
curl -X GET "https://api.keywordsai.co/automation/conditions/?page=1&page_size=10" \
-H "Authorization: Bearer YOUR_API_KEY"
Search Conditions
params = {
"search": "success",
"condition_type": "single_log"
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
curl -X GET "https://api.keywordsai.co/automation/conditions/?search=success&condition_type=single_log" \
-H "Authorization: Bearer YOUR_API_KEY"
Response
Status: 200 OK{
"results": [
{
"id": "cond-12345",
"condition_slug": "success_logs",
"name": "Successful Requests",
"condition_type": "single_log",
"description": "Matches logs with HTTP status code 200",
"condition_policy": {
"rules": [
{
"field": "status_code",
"operator": "equals",
"value": 200
}
],
"connector": "AND"
},
"unique_organization_id": "org-abc123",
"created_at": "2025-01-15T10:00:00Z",
"updated_at": "2025-01-15T10:00:00Z"
}
],
"count": 1,
"next": null,
"previous": null,
"filters_data": {}
}
Response Fields
Condition Object
| Field | Type | Description |
|---|---|---|
id | string | Unique condition identifier (save this for creating automations) |
name | string | Display name of the condition |
condition_slug | string | URL-friendly identifier |
condition_type | string | Type of condition ("single_log") |
description | string | Description of the condition |
condition_policy | object | The condition policy with rules and connector |
unique_organization_id | string | Organization identifier |
created_at | string | ISO timestamp of creation |
updated_at | string | ISO timestamp of last update |
Pagination Object
| Field | Type | Description |
|---|---|---|
count | integer | Total number of conditions |
previous | string | URL for previous page (null if first page) |
next | string | URL for next page (null if last page) |
filters_data | object | Currently applied filters |
id field from the response - you’ll need it when creating the automation.
Error Responses
401 Unauthorized
{
"detail": "Authentication credentials were not provided."
}
400 Bad Request
{
"detail": "Invalid page number"
}
Was this page helpful?
⌘I
List Conditions
curl --request GET \
--url https://api.keywordsai.co/automation/conditions/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.keywordsai.co/automation/conditions/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.keywordsai.co/automation/conditions/', 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://api.keywordsai.co/automation/conditions/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.keywordsai.co/automation/conditions/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.keywordsai.co/automation/conditions/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.keywordsai.co/automation/conditions/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"results": [
{
"id": "cond-12345",
"condition_slug": "success_logs",
"name": "Successful Requests",
"condition_type": "single_log",
"description": "Matches logs with HTTP status code 200",
"condition_policy": {
"rules": [
{
"field": "status_code",
"operator": "equals",
"value": 200
}
],
"connector": "AND"
},
"unique_organization_id": "org-abc123",
"created_at": "2025-01-15T10:00:00Z",
"updated_at": "2025-01-15T10:00:00Z"
}
],
"count": 1,
"next": null,
"previous": null,
"filters_data": {}
}