Actions

Created:
February 7, 2024
Updated:
November 29, 2024

Actions are automated tasks you can set up for your API. They can be triggered by specific events or scheduled to run at set times. You can choose between custom actions using your own integrations, or managed actions provided by FireTail.

Create an action

  1. Navigate to the APIs tab on the dashboard.
  2. Select the API you want to create the action against.
  3. Click Actions. Then click Create Action.
  4. Select to create an Event Driven Action or a Scheduled Action.

Create an Event Driven Action

Fill out the Event Driven Action form:

  1. Name: Enter a name for the action.
  2. Description: Enter a description for the action.
  3. Events: Select which event or events will trigger the action.
  4. Integration Type: Chose from Custom or Managed:
    • Custom: Select from a previously created Lambda or Webhook integration. Alternatively, click Create to create a new one.
      • Context: Add Key/Value pairs for your actions environment.
    • Managed: Select an out-of-the-box integration provided by FireTail. Learn more about Managed Actions.
  5. API Contract Testing (if selected):
    • Use event specification:
      • Toggle on to use the specification generated from the triggering event for validation.
      • Toggle off to use a predefined API specification.
    • API Specification:The API specification to be used during contract testing. This will be used when Use Event Specification is toggled off, or if no event specification exists.
  6. Auth Provider. - Select a previously created Auth Provider, or click Create to set up a new one. Learn more about Auth Providers.
  7. API URL/Endpoint - The API base URL or Endpoint to test.
  8. Click Submit.

Create a Scheduled Action

Set up an Action to trigger on a schedule. Fill out the Scheduled Action form:

  1. Name: Enter a name for the action.
  2. Description: Enter a description for the action.
  3. Scheduled rate minutes: The rate in minutes at which the action should be run.
  4. Integration Type: Chose from Custom or Managed:
    • Custom: Select from a previously created Lambda or Webhook integration. Alternatively, click Create to create a new one.
      • Use the Context field to add key/value pairs that define specific parameters or settings required for the action.
    • Managed: Select an out-of-the-box integration provided by FireTail. Learn more about Managed Actions.
      • Enter the API Endpoint that the managed action will interact with.
  5. API Contract Testing (if applicable):
    • Use event specification:
      • Toggle on to use the specification generated from the triggering event for validation.
      • Toggle off to use a predefined API specification.
    • API Specification:The API specification to be used during contract testing. This will be used when Use Event Specification is toggled off, or if no event specification exists.
  6. Auth Provider. - Select a previously created Auth Provider, or click Create to set up a new one. Learn more about Auth Providers.
  7. API URL/Endpoint - The API base URL or Endpoint to test.
  8. Click Submit.

Custom integration example

Below is a FireTail actions event payload. See the GitHub Repo for details on how to call back to FireTail with your own findings.


{
    'api_details': {
        'UUID': 'ded296d8-daed-450c-b83f-b4b8d89cbe95',
        'api_appUUID': 'cca39d04-7b6e-4727-9688-3f908492b620',
        'api_orgUUID': '665002ee-0066-435f-9654-20eb209cdd18',
        'api_type': 'rest',
        'createdBy': 'example@example.com',
        'dateAddedInMicroSeconds': 1710854022659491,
        'g_apiUUID': 'ded296d8-daed-450c-b83f-b4b8d89cbe95',
        'g_appUUID': 'cca39d04-7b6e-4727-9688-3f908492b620',
        'g_orgUUID': '665002ee-0066-435f-9654-20eb209cdd18',
        'name': 'api name'
    },
    'action_type': 'api_schedule_action',
    'invoke_epoch_time': 1712227639,
    'jwt_token': 'example.example.example',
    'action_details': {
        'UUID': '13eec790-73a7-4612-ab09-c122240b52b7',
        'actionType': 'api_schedule_action',
        'actionVersion': 'v0.0.1',
        'action_apiUUID': 'ded296d8-daed-450c-b83f-b4b8d89cbe95',
        'action_appUUID': 'cca39d04-7b6e-4727-9688-3f908492b620',
        'action_orgUUID': '665002ee-0066-435f-9654-20eb209cdd18',
        'createdBy': 'example@example.com',
        'dateAddedInMicroSeconds': 1711050404116639,
        'description': '',
        'enabled': True,
        'g_orgUUID': '665002ee-0066-435f-9654-20eb209cdd18',
        'integrationType': 'custom',
        'integrationUUID': 'd0b7faa9-6ec6-41dd-ae58-e6f528908252',
        'itemType': 'action',
        'name': 'lambda function',
        'scheduledRate': 15,
    },
    'context': {
        'inputs': {
            'api_endpoint': 'https://example.com/health'
        }
    },
    'callback_url': 
    'https://api.saas.eu-west-1.prod.firetail.app
    /organisations/665002ee-0066-435f-9654-20eb209cdd18/
    actions/13eec790-73a7-4612-ab09-c122240b52b7/callback'
}