Skip to main content
GET
https://api.keywordsai.co
/
automation
/
conditions
List Conditions
curl --request GET \
  --url https://api.keywordsai.co/automation/conditions/ \
  --header 'Authorization: Bearer <token>'
{
  "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.

Authentication

All endpoints require API key authentication:
Authorization: Bearer YOUR_API_KEY
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.

Query Parameters

ParameterTypeDescription
pageintegerPage number for pagination (default: 1)
page_sizeintegerNumber of items per page (default: 20)
searchstringSearch conditions by name or slug
condition_typestringFilter 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())

With Pagination

params = {
    "page": 1,
    "page_size": 10
}

response = requests.get(url, headers=headers, params=params)
print(response.json())

Search Conditions

params = {
    "search": "success",
    "condition_type": "single_log"
}

response = requests.get(url, headers=headers, params=params)
print(response.json())

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

FieldTypeDescription
idstringUnique condition identifier (save this for creating automations)
namestringDisplay name of the condition
condition_slugstringURL-friendly identifier
condition_typestringType of condition ("single_log")
descriptionstringDescription of the condition
condition_policyobjectThe condition policy with rules and connector
unique_organization_idstringOrganization identifier
created_atstringISO timestamp of creation
updated_atstringISO timestamp of last update

Pagination Object

FieldTypeDescription
countintegerTotal number of conditions
previousstringURL for previous page (null if first page)
nextstringURL for next page (null if last page)
filters_dataobjectCurrently applied filters
Note: Save the 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"
}