NAV
shell python javascript

Introduction

Welcome to the Neena API. With the Neena platform API, you can manage your agents, send requests to automate and get live information on automations. Our API provides easy access to Neena’s features, enabling seamless integration into your existing systems.

If you need an API key, sign up for a developer key through our application.

Flow Requests

Flow requests are the starting point to get work done. It is the prompt to get your assistant working.

Based on the flow request your Neena assistant will plan the steps to fulfil your request (i.e., it will generate a Flow) which it can then execute in a Flow Run.

Flow Request Model

Field Type Required Description
id string (UUID) Yes Unique identifier of the flow request.
request_instructions string Yes Instructions or details about the flow request.
request_metadata array of objects No Additional metadata or context for the request.
request_name string No Optional name of the flow request.
flow string (UUID) No Associated flow ID, if applicable.
organization string (UUID) No Organization ID linked to the flow request.
created_date string (date-time) Yes Timestamp when the flow request was created.
modified_date string (date-time) Yes Timestamp when the flow request was last modified.
created_by_email string Yes Email of the user who created the flow request.
modified_by_email string Yes Email of the user who last modified the request.

Create Flow Request

curl -X POST "api.neena.io/flow_requests" \
  -H "api_key: YOUR_API_KEY" \
  -d '{
        "request_instructions": "Process this request.",
        "request_metadata": [{"key": "value"}],
        "request_name": "Sample Request",
        "flow": "uuid-of-flow",
        "organization": "uuid-of-organization"
      }'
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

data = {
    "request_instructions": "Process this request.",
    "request_metadata": [{"key": "value"}],
    "request_name": "Sample Request",
    "flow": "uuid-of-flow",
    "organization": "uuid-of-organization"
}

response = requests.post('api.neena.io/flow_requests', headers=headers, json=data)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/flow_requests';

const headers = {
  'api_key': 'YOUR_API_KEY',
};

const body = {
  request_instructions: 'Process this request.',
  request_metadata: [{"key": "value"}],
  request_name: 'Sample Request',
  flow: 'uuid-of-flow',
  organization: 'uuid-of-organization',
};

fetch(url, {
  method: 'POST',
  headers: headers,
  body: JSON.stringify(body),
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

{
  "request_metadata": [{"key": "value"}],
  "request_instructions": "string",
  "request_name": "string",
  "flow": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "organization": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "created_date": "2024-09-17T15:35:21.360Z",
  "modified_date": "2024-09-17T15:35:21.360Z",
  "created_by_email": "user@example.com",
  "modified_by_email": "user@example.com"
}

This endpoint creates a new flow request in the system.

HTTP Request

POST /flow_requests

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Request Body

Field Type Required Description
request_instructions string Yes Instructions for the flow request.
request_metadata array of objects No Additional metadata.
request_name string No Name of the flow request.
flow string (UUID) No ID of the associated flow.
organization string (UUID) No ID of the organization.

Responses

Status Description
200 Successful Response
403 Authorization Error
422 Validation Error

Update Flow Request

curl -X PUT "api.neena.io/flow_requests" \
  -H "api_key: YOUR_API_KEY" \
  -d '{
        "request_metadata": [{"key": "new_value"}],
        "request_instructions": "string",
        "request_name": "string",
        "flow": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "organization": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
      }'
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

data = {
    "request_metadata": [{"key": "new_value"}],
    "request_instructions": "string",
    "request_name": "string",
    "flow": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "organization": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

response = requests.put('api.neena.io/flow_requests', headers=headers, json=data)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/flow_requests';

const headers = {
  'api_key': 'YOUR_API_KEY',

};

const body = {
  id: 'uuid-of-flow-request',
  request_instructions: 'Updated instructions.',
  request_metadata: [{"key": "new_value"}],
  request_name: 'Updated Request',
  flow: 'uuid-of-new-flow',
  organization: 'uuid-of-organization',
};

fetch(url, {
  method: 'PUT',
  headers: headers,
  body: JSON.stringify(body),
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

{
  "request_metadata": [{"key": "new_value"}],
  "request_instructions": "string",
  "request_name": "string",
  "flow": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "organization": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "created_date": "2024-09-17T15:35:21.360Z",
  "modified_date": "2024-09-17T15:35:21.360Z",
  "created_by_email": "user@example.com",
  "modified_by_email": "user@example.com"
}

This endpoint updates an existing flow request.

HTTP Request

PUT /flow_requests/

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Request Body

Field Type Required Description
id string (UUID) Yes ID of the flow request.
request_instructions string Yes Updated instructions.
request_metadata array of objects No Updated metadata.
request_name string No Updated name.
flow string (UUID) No Updated flow ID.
organization string (UUID) No Updated organization ID.

Responses

Status Description
200 Successful Response
403 Authorization Error
404 Not Found Error
422 Validation Error

Read Flow Request

curl -X GET "api.neena.io/flow_requests/?id=uuid-of-flow-request" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'id': 'uuid-of-flow-request'
}

response = requests.get('api.neena.io/flow_requests', headers=headers, params=params)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/flow_requests/?id=uuid-of-flow-request';

fetch(url, {
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

{
  "request_metadata": [{"key": "new_value"}],
  "request_instructions": "string",
  "request_name": "string",
  "flow": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "organization": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "created_date": "2024-09-17T15:35:21.360Z",
  "modified_date": "2024-09-17T15:35:21.360Z",
  "created_by_email": "user@example.com",
  "modified_by_email": "user@example.com"
}

This endpoint retrieves a single flow request by its ID.

HTTP Request

GET /flow_requests

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Query Parameters

Field Type Required Description
id string Yes The ID of the flow request.

Responses

Status Description
200 Successful Response
403 Authorization Error
404 Not Found Error
422 Validation Error

Remove Flow Request

curl -X DELETE "api.neena.io/flow_requests/?id=uuid-of-flow-request" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'id': 'uuid-of-flow-request'
}

response = requests.delete('api.neena.io/flow_requests', headers=headers, params=params)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/flow_requests/?id=uuid-of-flow-request';

fetch(url, {
  method: 'DELETE',
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

{
  "request_metadata": [{"key": "new_value"}],
  "request_instructions": "string",
  "request_name": "string",
  "flow": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "organization": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "created_date": "2024-09-17T15:35:21.360Z",
  "modified_date": "2024-09-17T15:35:21.360Z",
  "created_by_email": "user@example.com",
  "modified_by_email": "user@example.com"
}

This endpoint deletes a flow request by its ID.

HTTP Request

DELETE /flow_requests/

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Query Parameters

Field Type Required Description
id string Yes The ID of the flow request.

Responses

Status Description
200 Successful Response
403 Authorization Error
404 Not Found Error
422 Validation Error

Read All Flow Requests

curl -X GET "api.neena.io/flow_requests/all?skip=0&limit=100" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'skip': 0,
    'limit': 100
}

response = requests.get('api.neena.io/flow_requests/all', headers=headers, params=params)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/flow_requests/all?skip=0&limit=100';

fetch(url, {
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

[
  {
    "request_metadata": [{"key": "new_value"}],
    "request_instructions": "string",
    "request_name": "string",
    "flow": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "organization": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "created_date": "2024-09-17T15:35:21.360Z",
    "modified_date": "2024-09-17T15:35:21.360Z",
    "created_by_email": "user@example.com",
    "modified_by_email": "user@example.com"
  },
  {
    "request_metadata": [{"key": "new_value"}],
    "request_instructions": "string",
    "request_name": "string",
    "flow": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "organization": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "created_date": "2024-09-17T15:35:21.360Z",
    "modified_date": "2024-09-17T15:35:21.360Z",
    "created_by_email": "user@example.com",
    "modified_by_email": "user@example.com"
  },
]

This endpoint retrieves all flow requests for the user.

HTTP Request

GET /flow_requests/all

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Query Parameters

Field Type Required Description
skip int No Number of records to skip for pagination.
limit int No Maximum number of records to return.

Responses

Status Description
200 Successful Response
403 Authorization Error
422 Validation Error

Flows

Flows represent the blueprint of a workflow, defining the sequence of task operations and their dependencies. They are generated from a Flow Request and can be executed to perform the specified tasks in order.

Flows are essential for structuring complex workflows, allowing you to define tasks, set dependencies, and manage the overall process. Once a flow is executed, it creates a Flow Run that performs the tasks as defined.

Flow Model

Field Type Required Description
name string Yes Name of the flow.
task_operations array of objects Yes List of task operations in the flow.
dependencies array of objects Yes List of dependencies between task operations.
id string (UUID) Yes Unique identifier of the flow.
created_date string (date-time) Yes When the flow was created.
modified_date string (date-time) Yes When the flow was last modified.
created_by_email string (email) Yes Email of the creator.
modified_by_email string (email) Yes Email of the last modifier.

Task Operation Model

Field Type Description
name string Name of the task operation.
task_definition string (UUID) ID of the associated task definition.
instruction string Instructions for the task operation.
x number X-coordinate for UI representation.
y number Y-coordinate for UI representation.
index integer Index of the task operation in the flow.
id string (UUID) Unique identifier of the task operation.
flow string (UUID) ID of the associated flow.

Dependency Model

Field Type Description
instruction string Instructions for the dependency.
source_task_operation integer Index of the source task operation.
target_task_operation integer Index of the target task operation.
id string (UUID) Unique identifier of the dependency.
flow string (UUID) ID of the associated flow.

Create Flow

curl -X POST "api.neena.io/flows" \
  -H "api_key: YOUR_API_KEY" \
  -d '{
        "name": "Example Flow",
        "task_operations": [
          {
            "name": "Task 1",
            "task_definition": "uuid-of-task-definition-1",
            "instruction": "Perform task 1",
            "index": 0
          },
          {
            "name": "Task 2",
            "task_definition": "uuid-of-task-definition-2",
            "instruction": "Perform task 2",
            "index": 1
          }
        ],
        "dependencies": [
          {
            "source_task_operation": 0,
            "target_task_operation": 1,
            "instruction": "Task 2 depends on Task 1"
          }
        ]
      }'
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

data = {
    "name": "Example Flow",
    "task_operations": [
        {
            "name": "Task 1",
            "task_definition": "uuid-of-task-definition-1",
            "instruction": "Perform task 1",
            "index": 0
        },
        {
            "name": "Task 2",
            "task_definition": "uuid-of-task-definition-2",
            "instruction": "Perform task 2",
            "index": 1
        }
    ],
    "dependencies": [
        {
            "source_task_operation": 0,
            "target_task_operation": 1,
            "instruction": "Task 2 depends on Task 1"
        }
    ]
}

response = requests.post('api.neena.io/flows', headers=headers, json=data)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/flows';

const headers = {
  'api_key': 'YOUR_API_KEY',
};

const body = {
  name: 'Example Flow',
  task_operations: [
    {
      name: 'Task 1',
      task_definition: 'uuid-of-task-definition-1',
      instruction: 'Perform task 1',
      index: 0
    },
    {
      name: 'Task 2',
      task_definition: 'uuid-of-task-definition-2',
      instruction: 'Perform task 2',
      index: 1
    }
  ],
  dependencies: [
    {
      source_task_operation: 0,
      target_task_operation: 1,
      instruction: 'Task 2 depends on Task 1'
    }
  ]
};

fetch(url, {
  method: 'POST',
  headers: headers,
  body: JSON.stringify(body),
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

{
  "name": "Example Flow",
  "task_operations": [
    {
      "name": "Task 1",
      "task_definition": "uuid-of-task-definition-1",
      "instruction": "Perform task 1",
      "x": null,
      "y": null,
      "index": 0,
      "sorted_index": null,
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "flow": "uuid-of-flow",
      "created_date": "2024-09-18T10:27:57.149Z",
      "modified_date": "2024-09-18T10:27:57.149Z",
      "created_by_email": "user@example.com",
      "modified_by_email": "user@example.com"
    },
    {
      "name": "Task 2",
      "task_definition": "uuid-of-task-definition-2",
      "instruction": "Perform task 2",
      "x": null,
      "y": null,
      "index": 1,
      "sorted_index": null,
      "id": "4ec2d0f1-1234-5678-9abc-def012345678",
      "flow": "uuid-of-flow",
      "created_date": "2024-09-18T10:27:57.149Z",
      "modified_date": "2024-09-18T10:27:57.149Z",
      "created_by_email": "user@example.com",
      "modified_by_email": "user@example.com"
    }
  ],
  "dependencies": [
    {
      "instruction": "Task 2 depends on Task 1",
      "source_task_operation": 0,
      "target_task_operation": 1,
      "id": "5fd7a7d2-9876-5432-1abc-def012345678",
      "flow": "uuid-of-flow",
      "created_date": "2024-09-18T10:27:57.149Z",
      "modified_date": "2024-09-18T10:27:57.149Z",
      "created_by_email": "user@example.com",
      "modified_by_email": "user@example.com"
    }
  ],
  "id": "uuid-of-flow",
  "created_date": "2024-09-18T10:27:57.149Z",
  "modified_date": "2024-09-18T10:27:57.149Z",
  "created_by_email": "user@example.com",
  "modified_by_email": "user@example.com"
}

This endpoint creates a new flow in the system.

HTTP Request

POST /flows

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Request Body

Field Type Required Description
name string Yes Name of the flow.
task_operations array of objects Yes List of task operations in the flow.
dependencies array of objects Yes List of dependencies between task operations.

Responses

Status Description
200 Successful Response
403 Authorization Error
422 Validation Error

Read Flow

curl -X GET "api.neena.io/flows?id=uuid-of-flow" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'id': 'uuid-of-flow'
}

response = requests.get('api.neena.io/flows', headers=headers, params=params)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/flows?id=uuid-of-flow';

fetch(url, {
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

{
  "name": "Example Flow",
  "task_operations": [
    {
      "name": "Task 1",
      "task_definition": "uuid-of-task-definition-1",
      "instruction": "Perform task 1",
      "x": null,
      "y": null,
      "index": 0,
      "sorted_index": null,
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "flow": "uuid-of-flow",
      "created_date": "2024-09-18T10:27:57.149Z",
      "modified_date": "2024-09-18T10:27:57.149Z",
      "created_by_email": "user@example.com",
      "modified_by_email": "user@example.com"
    },
    {
      "name": "Task 2",
      "task_definition": "uuid-of-task-definition-2",
      "instruction": "Perform task 2",
      "x": null,
      "y": null,
      "index": 1,
      "sorted_index": null,
      "id": "4ec2d0f1-1234-5678-9abc-def012345678",
      "flow": "uuid-of-flow",
      "created_date": "2024-09-18T10:27:57.149Z",
      "modified_date": "2024-09-18T10:27:57.149Z",
      "created_by_email": "user@example.com",
      "modified_by_email": "user@example.com"
    }
  ],
  "dependencies": [
    {
      "instruction": "Task 2 depends on Task 1",
      "source_task_operation": 0,
      "target_task_operation": 1,
      "id": "5fd7a7d2-9876-5432-1abc-def012345678",
      "flow": "uuid-of-flow",
      "created_date": "2024-09-18T10:27:57.149Z",
      "modified_date": "2024-09-18T10:27:57.149Z",
      "created_by_email": "user@example.com",
      "modified_by_email": "user@example.com"
    }
  ],
  "id": "uuid-of-flow",
  "created_date": "2024-09-18T10:27:57.149Z",
  "modified_date": "2024-09-18T10:27:57.149Z",
  "created_by_email": "user@example.com",
  "modified_by_email": "user@example.com"
}

This endpoint retrieves a specific flow by its ID.

HTTP Request

GET /flows

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Query Parameters

Field Type Required Description
id string Yes The ID of the flow.

Responses

Status Description
200 Successful Response
403 Authorization Error
404 Not Found Error
422 Validation Error

Read All Flows

curl -X GET "api.neena.io/flows/all?skip=0&limit=100" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'skip': 0,
    'limit': 100
}

response = requests.get('api.neena.io/flows/all', headers=headers, params=params)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/flows/all?skip=0&limit=100';

fetch(url, {
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

[
  {
    "name": "Example Flow 1",
    "task_operations": [
      {
        "name": "Task A",
        "task_definition": "uuid-of-task-definition-A",
        "instruction": "Perform task A",
        "x": null,
        "y": null,
        "index": 0,
        "sorted_index": null,
        "id": "task-operation-id-A",
        "flow": "uuid-of-flow-1",
        "created_date": "2024-09-18T10:27:57.149Z",
        "modified_date": "2024-09-18T10:27:57.149Z",
        "created_by_email": "user@example.com",
        "modified_by_email": "user@example.com"
      }
    ],
    "dependencies": [],
    "id": "uuid-of-flow-1",
    "created_date": "2024-09-18T10:27:57.149Z",
    "modified_date": "2024-09-18T10:27:57.149Z",
    "created_by_email": "user@example.com",
    "modified_by_email": "user@example.com"
  },
  {
    "name": "Example Flow 2",
    "task_operations": [
      {
        "name": "Task B",
        "task_definition": "uuid-of-task-definition-B",
        "instruction": "Perform task B",
        "x": null,
        "y": null,
        "index": 0,
        "sorted_index": null,
        "id": "task-operation-id-B",
        "flow": "uuid-of-flow-2",
        "created_date": "2024-09-18T10:27:57.149Z",
        "modified_date": "2024-09-18T10:27:57.149Z",
        "created_by_email": "user@example.com",
        "modified_by_email": "user@example.com"
      }
    ],
    "dependencies": [],
    "id": "uuid-of-flow-2",
    "created_date": "2024-09-18T10:27:57.149Z",
    "modified_date": "2024-09-18T10:27:57.149Z",
    "created_by_email": "user@example.com",
    "modified_by_email": "user@example.com"
  }
]

This endpoint retrieves all flows available to the user.

HTTP Request

GET /flows/all

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Query Parameters

Field Type Required Description
skip int No Number of records to skip for pagination.
limit int No Maximum number of records to return.

Responses

Status Description
200 Successful Response
403 Authorization Error
422 Validation Error

Delete Flow

curl -X DELETE "api.neena.io/flows?id=uuid-of-flow" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'id': 'uuid-of-flow'
}

response = requests.delete('api.neena.io/flows', headers=headers, params=params)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/flows?id=uuid-of-flow';

fetch(url, {
  method: 'DELETE',
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

This endpoint deletes a specific flow by its ID.

HTTP Request

DELETE /flows

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Query Parameters

Field Type Required Description
id string Yes The ID of the flow.

Responses

Status Description
200 Successful Response
403 Authorization Error
404 Not Found Error
422 Validation Error

Execute Flow

curl -X POST "api.neena.io/flows/execute?flow_id=uuid-of-flow&flow_request_id=uuid-of-flow-request" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'flow_id': 'uuid-of-flow',
    'flow_request_id': 'uuid-of-flow-request'
}

response = requests.post('api.neena.io/flows/execute', headers=headers, params=params)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/flows/execute?flow_id=uuid-of-flow&flow_request_id=uuid-of-flow-request';

fetch(url, {
  method: 'POST',
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

This endpoint executes a flow by its ID, creating a new flow run.

HTTP Request

POST /flows/execute

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Query Parameters

Field Type Required Description
flow_id string Yes The ID of the flow to execute.
flow_request_id string Yes The ID of the associated flow request.

Responses

Status Description
200 Successful Response
403 Authorization Error
404 Not Found Error
422 Validation Error

Generate Flow from Flow Request

curl -X GET "api.neena.io/flows/generate?flow_request_id=uuid-of-flow-request" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'flow_request_id': 'uuid-of-flow-request'
}

response = requests.get('api.neena.io/flows/generate', headers=headers, params=params)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/flows/generate?flow_request_id=uuid-of-flow-request';

fetch(url, {
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

This endpoint generates a new flow based on an existing flow request.

HTTP Request

GET /flows/generate

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Query Parameters

Field Type Required Description
flow_request_id string Yes The ID of the flow request.

Responses

Status Description
200 Successful Response
403 Authorization Error
404 Not Found Error
422 Validation Error

Integrations

Integrations represent the external services or platforms that can be connected to your workflows in Neena. By setting up integrations, you can automate tasks across different systems, allowing seamless data flow and process automation between Neena and other applications.

Integrations are essential for extending the capabilities of your workflows, enabling tasks like sending emails, creating tickets, updating records, and more in external systems directly from your flows.

If you would like to see certain integrations on the platform, please contact one of our founders to get support

Integration Model

Field Type Required Description
id string (UUID) Yes Unique identifier of the integration.
name string Yes Name of the integration.
short_name string Yes Short name used to reference the integration.
class_name string Yes Class name used internally.
auth_type string Yes Authentication type (e.g., 'oauth2').
created_date string (date-time) Yes When the integration was created.
modified_date string (date-time) Yes When the integration was last modified.

Read All Integrations

curl -X GET "api.neena.io/integrations/all?skip=0&limit=100" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'skip': 0,
    'limit': 100
}

response = requests.get('api.neena.io/integrations/all', headers=headers, params=params)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/integrations/all?skip=0&limit=100';

fetch(url, {
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

[
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "Slack",
    "short_name": "slack",
    "class_name": "SlackIntegration",
    "auth_type": "oauth2",
    "created_date": "2024-09-18T10:27:57.149Z",
    "modified_date": "2024-09-18T10:27:57.149Z"
  },
  {
    "id": "4ec2d0f1-1234-5678-9abc-def012345678",
    "name": "Perplexity",
    "short_name": "perplexity",
    "class_name": "PerplexityIntegration",
    "auth_type": "api_key",
    "created_date": "2024-09-18T10:27:57.149Z",
    "modified_date": "2024-09-18T10:27:57.149Z"
  }
]

This endpoint retrieves all available integrations.

HTTP Request

GET /integrations/all

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Query Parameters

Field Type Required Description
skip int No Number of records to skip for pagination.
limit int No Maximum number of records to return.

Responses

Status Description
200 Successful Response
403 Authorization Error
422 Validation Error

Task Definitions

Task definitions are the blueprints for task operations, which in turn are the core components of a Flow in Neena. They define specific operations or actions within a flow, detailing the necessary inputs and expected outputs. These tasks integrate with external systems and services.

Creating, updating, or deleting task definitions is not possible through the API; they are maintained by the platform but can be viewed and utilized in your flows.

Understanding task definitions helps you identify possible actions for your flows. For instance, when setting up a flow that includes the "Create Trello Card" task, knowing the required parameters (board_id, list_id, card_name) ensures you gather or generate these values beforehand.

If you would like to see certain tasks on the platform, talk to founder to get support.

Task Definition Model

Field Type Description
task_name string Name of the task.
integration string (UUID) ID of the associated integration.
parameters array of objects List of input parameters required for the task.
input_type string Type of input expected by the task.
input_yml string YAML representation of the input parameters.
description string Description of the task's functionality.
python_method_name string Internal Python method name implementing the task.
output_type string Type of output produced by the task.
output_yml string YAML representation of the output parameters.
output_parameters array of objects List of output parameters provided by the task.
output_is_list boolean Indicates whether the output is a list.
id string (UUID) Unique identifier of the task definition.
created_date string (date-time) ISO 8601 formatted date-time when the task was created.
modified_date string (date-time) ISO 8601 formatted date-time when the task was last modified.
created_by_email string (email) Email of the user who created the task definition.
modified_by_email string (email) Email of the user who last modified the task definition.
deleted_at string (date-time) ISO 8601 formatted date-time when the task was deleted, if applicable.
belongs_to_integration object The integration object to which this task definition belongs.

Task Parameter Model

Field Type Description
name string Name of the parameter.
data_type string Data type of the parameter (e.g., 'string', 'int').
position integer Position of the parameter in the parameter list.
doc_string string Description of the parameter.
optional boolean Indicates whether the parameter is optional.

Read All Task Definitions

curl -X GET "api.neena.io/task_definitions/all?skip=0&limit=100" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'skip': 0,
    'limit': 100
}

response = requests.get('api.neena.io/task_definitions/all', headers=headers, params=params)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/task_definitions/all?skip=0&limit=100';

fetch(url, {
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

[
  {
    "task_name": "Send Email",
    "integration": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "parameters": [
      {
        "name": "email_address",
        "data_type": "string",
        "position": 1,
        "doc_string": "The email address to send to.",
        "optional": false
      },
      {
        "name": "subject",
        "data_type": "string",
        "position": 2,
        "doc_string": "The subject of the email.",
        "optional": false
      },
      {
        "name": "body",
        "data_type": "string",
        "position": 3,
        "doc_string": "The body content of the email.",
        "optional": false
      }
    ],
    "input_type": "EmailInput",
    "input_yml": "parameters:\n  - name: email_address\n    data_type: string\n    position: 1\n    doc_string: 'The email address to send to.'\n    optional: false\n  - name: subject\n    data_type: string\n    position: 2\n    doc_string: 'The subject of the email.'\n    optional: false\n  - name: body\n    data_type: string\n    position: 3\n    doc_string: 'The body content of the email.'\n    optional: false",
    "description": "Sends an email using the specified integration.",
    "python_method_name": "send_email",
    "output_type": "EmailOutput",
    "output_yml": "parameters:\n  - name: status\n    data_type: string\n    position: 1\n    doc_string: 'Status of the email sending operation.'\n    optional: false",
    "output_parameters": [
      {
        "name": "status",
        "data_type": "string",
        "position": 1,
        "doc_string": "Status of the email sending operation.",
        "optional": false
      }
    ],
    "output_is_list": false,
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "created_date": "2024-09-18T10:00:00Z",
    "modified_date": "2024-09-18T10:00:00Z",
    "created_by_email": "user@example.com",
    "modified_by_email": "user@example.com",
    "deleted_at": null,
    "belongs_to_integration": {
      "class_name": "EmailIntegration",
      "name": "Email",
      "short_name": "email",
      "auth_type": "api_key",
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "created_date": "2024-09-18T09:00:00Z",
      "modified_date": "2024-09-18T09:00:00Z"
    }
  },
  {
    "task_name": "Create Trello Card",
    "integration": "9b74c989-7b8f-4e4a-8a3e-0b6c0d2e8f06",
    "parameters": [
      {
        "name": "board_id",
        "data_type": "string",
        "position": 1,
        "doc_string": "The ID of the Trello board.",
        "optional": false
      },
      {
        "name": "list_id",
        "data_type": "string",
        "position": 2,
        "doc_string": "The ID of the list on the board.",
        "optional": false
      },
      {
        "name": "card_name",
        "data_type": "string",
        "position": 3,
        "doc_string": "The name of the new card.",
        "optional": false
      }
    ],
    "input_type": "TrelloCardInput",
    "input_yml": "parameters:\n  - name: board_id\n    data_type: string\n    position: 1\n    doc_string: 'The ID of the Trello board.'\n    optional: false\n  - name: list_id\n    data_type: string\n    position: 2\n    doc_string: 'The ID of the list on the board.'\n    optional: false\n  - name: card_name\n    data_type: string\n    position: 3\n    doc_string: 'The name of the new card.'\n    optional: false",
    "description": "Creates a new card in a specified Trello board and list.",
    "python_method_name": "create_trello_card",
    "output_type": "TrelloCardOutput",
    "output_yml": "parameters:\n  - name: card_id\n    data_type: string\n    position: 1\n    doc_string: 'The ID of the created card.'\n    optional: false",
    "output_parameters": [
      {
        "name": "card_id",
        "data_type": "string",
        "position": 1,
        "doc_string": "The ID of the created card.",
        "optional": false
      }
    ],
    "output_is_list": false,
    "id": "9b74c989-7b8f-4e4a-8a3e-0b6c0d2e8f06",
    "created_date": "2024-09-18T11:00:00Z",
    "modified_date": "2024-09-18T11:00:00Z",
    "created_by_email": "admin@neena.io",
    "modified_by_email": "admin@neena.io",
    "deleted_at": null,
    "belongs_to_integration": {
      "class_name": "TrelloIntegration",
      "name": "Trello",
      "short_name": "trello",
      "auth_type": "oauth2",
      "id": "9b74c989-7b8f-4e4a-8a3e-0b6c0d2e8f06",
      "created_date": "2024-09-18T10:30:00Z",
      "modified_date": "2024-09-18T10:30:00Z"
    }
  }
  // Additional task definitions...
]

This endpoint retrieves all task definitions available in the system.

HTTP Request

GET /task_definitions/all

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Query Parameters

Field Type Required Description
skip int No Number of records to skip for pagination.
limit int No Maximum number of records to return.

Responses

Status Description
200 Successful Response
403 Authorization Error
422 Validation Error

Read Task Definition

curl -X GET "api.neena.io/task_definitions/?id=uuid-of-task-definition" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'id': 'uuid-of-task-definition'
}

response = requests.get('api.neena.io/task_definitions/', headers=headers, params=params)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/task_definitions/?id=uuid-of-task-definition';

fetch(url, {
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

{
  "task_name": "Create Trello Card",
  "integration": "9b74c989-7b8f-4e4a-8a3e-0b6c0d2e8f06",
  "parameters": [
    {
      "name": "board_id",
      "data_type": "string",
      "position": 1,
      "doc_string": "The ID of the Trello board.",
      "optional": false
    },
    {
      "name": "list_id",
      "data_type": "string",
      "position": 2,
      "doc_string": "The ID of the list on the board.",
      "optional": false
    },
    {
      "name": "card_name",
      "data_type": "string",
      "position": 3,
      "doc_string": "The name of the new card.",
      "optional": false
    }
  ],
  "input_type": "TrelloCardInput",
  "input_yml": "parameters:\n  - name: board_id\n    data_type: string\n    position: 1\n    doc_string: 'The ID of the Trello board.'\n    optional: false\n  - name: list_id\n    data_type: string\n    position: 2\n    doc_string: 'The ID of the list on the board.'\n    optional: false\n  - name: card_name\n    data_type: string\n    position: 3\n    doc_string: 'The name of the new card.'\n    optional: false",
  "description": "Creates a new card in a specified Trello board and list.",
  "python_method_name": "create_trello_card",
  "output_type": "TrelloCardOutput",
  "output_yml": "parameters:\n  - name: card_id\n    data_type: string\n    position: 1\n    doc_string: 'The ID of the created card.'\n    optional: false",
  "output_parameters": [
    {
      "name": "card_id",
      "data_type": "string",
      "position": 1,
      "doc_string": "The ID of the created card.",
      "optional": false
    }
  ],
  "output_is_list": false,
  "id": "9b74c989-7b8f-4e4a-8a3e-0b6c0d2e8f06",
  "created_date": "2024-09-18T11:00:00Z",
  "modified_date": "2024-09-18T11:00:00Z",
  "created_by_email": "admin@neena.io",
  "modified_by_email": "admin@neena.io",
  "deleted_at": null,
  "belongs_to_integration": {
    "class_name": "TrelloIntegration",
    "name": "Trello",
    "short_name": "trello",
    "auth_type": "oauth2",
    "id": "9b74c989-7b8f-4e4a-8a3e-0b6c0d2e8f06",
    "created_date": "2024-09-18T10:30:00Z",
    "modified_date": "2024-09-18T10:30:00Z"
  }
}

This endpoint retrieves a single task definition by its ID.

HTTP Request

GET /task_definitions/

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Query Parameters

Field Type Required Description
id string Yes The ID of the task definition.

Responses

Status Description
200 Successful Response
403 Authorization Error
404 Not Found Error
422 Validation Error

Flow Runs

Flow runs represent the execution of a Flow that was generated from a Flow Request. Once the flow is created, a flow run performs the steps defined in the flow, transitioning through stages such as pending, in-progress, and completed.

Flow runs are essential for tracking the real-time progress of the workflow, providing key details about the execution of tasks within the flow, such as status updates, when the run was triggered, and task outcomes.

Flow Run Model

Field Type Required Description
flow string (UUID) Yes ID of the associated flow.
id string (UUID) Yes ID of the flow run.
flow_request string (UUID) Yes ID of the associated flow request.
status string Yes Status of the flow run.
approval_status string No Approval status of the flow run.
triggered_time string (date-time) No Time when the flow run was triggered.
end_time string (date-time) No Time when the flow run ended.
triggered_by string No Who triggered the flow run.
task_runs array of objects Yes List of task runs.

Task Run Model

Field Type Description
id string (UUID) Unique identifier of the task run.
task_operation_index integer Index of the task operation within the flow.
status string Status of the task run (e.g., 'pending', 'in_progress', 'completed', 'failed', 'cancelled').
start_time string (date-time) ISO 8601 formatted date-time when the task run started.
end_time string (date-time) ISO 8601 formatted date-time when the task run ended.
flow_run string (UUID) Unique identifier of the associated flow run.
task_prep_prompt object Messages exchanged during task preparation.
task_prep_answer object Parameters provided for the task.

Create Flow Run

curl -X POST "api.neena.io/flow_runs" \
  -H "api_key: YOUR_API_KEY" \
  -d '{
        "flow": "uuid-of-flow",
        "flow_request": "uuid-of-flow-request",
        "status": "pending",
        "approval_status": null,
        "triggered_time": null,
        "end_time": null,
        "triggered_by": null
      }'
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

data = {
    "flow": "uuid-of-flow",
    "flow_request": "uuid-of-flow-request",
    "status": "pending",
    "approval_status": None,
    "triggered_time": None,
    "end_time": None,
    "triggered_by": None
}

response = requests.post('api.neena.io/flow_runs', headers=headers, json=data)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/flow_runs';

const headers = {
  'api_key': 'YOUR_API_KEY',
};

const body = {
  flow: 'uuid-of-flow',
  flow_request: 'uuid-of-flow-request',
  status: 'pending',
  approval_status: null,
  triggered_time: null,
  end_time: null,
  triggered_by: null
};

fetch(url, {
  method: 'POST',
  headers: headers,
  body: JSON.stringify(body),
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

{
  "flow": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "flow_request": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "pending",
  "approval_status": null,
  "triggered_time": null,
  "end_time": null,
  "triggered_by": null,
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "task_runs": []
}

This endpoint creates a new flow run in the system.

HTTP Request

POST /flow_runs

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Request Body

Field Type Required Description
flow string (UUID) Yes ID of the associated flow.
flow_request string (UUID) Yes ID of the associated flow request.
status string Yes Status of the flow run (e.g., 'pending').
approval_status string No Approval status of the flow run.
triggered_time string (date-time) No Time when the flow run was triggered.
end_time string (date-time) No Time when the flow run ended.
triggered_by string No Who triggered the flow run.

Responses

Status Description
200 Successful Response
403 Authorization Error
404 Not Found Error
422 Validation Error

Read Flow Run

curl -X GET "api.neena.io/flow_runs/?id=uuid-of-flow-run" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'id': 'uuid-of-flow-run'
}

response = requests.get('api.neena.io/flow_runs', headers=headers, params=params)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/flow_runs/?id=uuid-of-flow-run';

fetch(url, {
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

{
  "flow": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "flow_request": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "pending",
  "approval_status": null,
  "triggered_time": null,
  "end_time": null,
  "triggered_by": null,
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "task_runs": [
    {
      "task_operation_index": 0,
      "status": "completed",
      "start_time": "2024-09-18T10:00:00Z",
      "task_prep_prompt": {
        "messages": [
          {
            "role": "system",
            "content": "Please provide the necessary input parameters."
          },
          {
            "role": "user",
            "content": "What is the target email address?"
          }
        ]
      },
      "task_prep_answer": {
        "parameters": [
          {
            "name": "email_address",
            "value": "user@example.com",
            "explanation": "The email address to which the report will be sent."
          },
          {
            "name": "include_summary",
            "value": true,
            "explanation": "Indicates whether to include a summary in the report."
          }
        ]
      },
      "end_time": "2024-09-18T10:05:00Z",
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "flow_run": "4ec2d0f1-1234-5678-9abc-def012345678"
    },
    {
      "task_operation_index": 0,
      "status": "completed",
      "start_time": "2024-09-18T10:00:00Z",
      "task_prep_prompt": {
        "messages": [
          {
            "role": "system",
            "content": "Please provide the necessary input parameters."
          },
          {
            "role": "user",
            "content": "What is the target email address?"
          }
        ]
      },
      "task_prep_answer": {
        "parameters": [
          {
            "name": "email_address",
            "value": "user@example.com",
            "explanation": "The email address to which the report will be sent."
          },
          {
            "name": "include_summary",
            "value": true,
            "explanation": "Indicates whether to include a summary in the report."
          }
        ]
      },
      "end_time": "2024-09-18T10:05:00Z",
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "flow_run": "4ec2d0f1-1234-5678-9abc-def012345678"
    }
  ]
}

This endpoint retrieves a single flow run by its ID.

HTTP Request

GET /flow_runs

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Query Parameters

Field Type Required Description
id string Yes The ID of the flow run.

Responses

Status Description
200 Successful Response
403 Authorization Error
404 Not Found Error
422 Validation Error

Read All Flow Runs

curl -X GET "api.neena.io/flow_runs/all?skip=0&limit=100" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'skip': 0,
    'limit': 100
}

response = requests.get('api.neena.io/flow_runs/all', headers=headers, params=params)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/flow_runs/all?skip=0&limit=100';

fetch(url, {
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

[
  {
    "flow": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "flow_request": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "status": "pending",
    "approval_status": null,
    "triggered_time": null,
    "end_time": null,
    "triggered_by": null,
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "task_runs": [
      {
        "task_operation_index": 0,
        "status": "completed",
        "start_time": "2024-09-18T10:00:00Z",
        "task_prep_prompt": {
          "messages": [
            {
              "role": "system",
              "content": "Please provide the necessary input parameters."
            },
            {
              "role": "user",
              "content": "What is the target email address?"
            }
          ]
        },
        "task_prep_answer": {
          "parameters": [
            {
              "name": "email_address",
              "value": "user@example.com",
              "explanation": "The email address to which the report will be sent."
            },
            {
              "name": "include_summary",
              "value": true,
              "explanation": "Indicates whether to include a summary in the report."
            }
          ]
        },
        "end_time": "2024-09-18T10:05:00Z",
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "flow_run": "4ec2d0f1-1234-5678-9abc-def012345678"
      },
      {
        "task_operation_index": 0,
        "status": "completed",
        "start_time": "2024-09-18T10:00:00Z",
        "task_prep_prompt": {
          "messages": [
            {
              "role": "system",
              "content": "Please provide the necessary input parameters."
            },
            {
              "role": "user",
              "content": "What is the target email address?"
            }
          ]
        },
        "task_prep_answer": {
          "parameters": [
            {
              "name": "email_address",
              "value": "user@example.com",
              "explanation": "The email address to which the report will be sent."
            },
            {
              "name": "include_summary",
              "value": true,
              "explanation": "Indicates whether to include a summary in the report."
            }
          ]
        },
        "end_time": "2024-09-18T10:05:00Z",
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "flow_run": "4ec2d0f1-1234-5678-9abc-def012345678"
      }
    ]
  },
  {
    "flow": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "flow_request": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "status": "pending",
    "approval_status": null,
    "triggered_time": null,
    "end_time": null,
    "triggered_by": null,
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "task_runs": [
      {
        "task_operation_index": 0,
        "status": "completed",
        "start_time": "2024-09-18T10:00:00Z",
        "task_prep_prompt": {
          "messages": [
            {
              "role": "system",
              "content": "Please provide the necessary input parameters."
            },
            {
              "role": "user",
              "content": "What is the target email address?"
            }
          ]
        },
        "task_prep_answer": {
          "parameters": [
            {
              "name": "email_address",
              "value": "user@example.com",
              "explanation": "The email address to which the report will be sent."
            },
            {
              "name": "include_summary",
              "value": true,
              "explanation": "Indicates whether to include a summary in the report."
            }
          ]
        },
        "end_time": "2024-09-18T10:05:00Z",
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "flow_run": "4ec2d0f1-1234-5678-9abc-def012345678"
      },
      {
        "task_operation_index": 0,
        "status": "completed",
        "start_time": "2024-09-18T10:00:00Z",
        "task_prep_prompt": {
          "messages": [
            {
              "role": "system",
              "content": "Please provide the necessary input parameters."
            },
            {
              "role": "user",
              "content": "What is the target email address?"
            }
          ]
        },
        "task_prep_answer": {
          "parameters": [
            {
              "name": "email_address",
              "value": "user@example.com",
              "explanation": "The email address to which the report will be sent."
            },
            {
              "name": "include_summary",
              "value": true,
              "explanation": "Indicates whether to include a summary in the report."
            }
          ]
        },
        "end_time": "2024-09-18T10:05:00Z",
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "flow_run": "4ec2d0f1-1234-5678-9abc-def012345678"
      }
    ]
  },
]

This endpoint retrieves all flow runs for the user.

HTTP Request

GET /flow_runs/all

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Query Parameters

Field Type Required Description
skip int No Number of records to skip for pagination.
limit int No Maximum number of records to return.

Responses

Status Description
200 Successful Response
403 Authorization Error
422 Validation Error

Approve Flow Run

curl -X PUT "api.neena.io/flow_runs/approve?flow_run_id=uuid-of-flow-run" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'flow_run_id': 'uuid-of-flow-run'
}

response = requests.put('api.neena.io/flow_runs/approve', headers=headers, params=params)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/flow_runs/approve?flow_run_id=uuid-of-flow-run';

fetch(url, {
  method: 'PUT',
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

This endpoint approves a specific flow run.

HTTP Request

PUT /flow_runs/approve

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Query Parameters

Field Type Required Description
flow_run_id string Yes The ID of the flow run to approve.

Responses

Status Description
200 Successful Response
403 Authorization Error
404 Not Found Error
422 Validation Error

Read All Flow Runs for a Flow ID

curl -X GET "api.neena.io/flow_runs/all_for_flow_id?flow_id=uuid-of-flow&skip=0&limit=100" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'flow_id': 'uuid-of-flow',
    'skip': 0,
    'limit': 100
}

response = requests.get('api.neena.io/flow_runs/all_for_flow_id', headers=headers, params=params)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/flow_runs/all_for_flow_id?flow_id=uuid-of-flow&skip=0&limit=100';

fetch(url, {
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

[
  {
    "flow": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "flow_request": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "status": "pending",
    "approval_status": null,
    "triggered_time": null,
    "end_time": null,
    "triggered_by": null,
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "task_runs": [
      {
        "task_operation_index": 0,
        "status": "completed",
        "start_time": "2024-09-18T10:00:00Z",
        "task_prep_prompt": {
          "messages": [
            {
              "role": "system",
              "content": "Please provide the necessary input parameters."
            },
            {
              "role": "user",
              "content": "What is the target email address?"
            }
          ]
        },
        "task_prep_answer": {
          "parameters": [
            {
              "name": "email_address",
              "value": "user@example.com",
              "explanation": "The email address to which the report will be sent."
            },
            {
              "name": "include_summary",
              "value": true,
              "explanation": "Indicates whether to include a summary in the report."
            }
          ]
        },
        "end_time": "2024-09-18T10:05:00Z",
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "flow_run": "4ec2d0f1-1234-5678-9abc-def012345678"
      },
      {
        "task_operation_index": 0,
        "status": "completed",
        "start_time": "2024-09-18T10:00:00Z",
        "task_prep_prompt": {
          "messages": [
            {
              "role": "system",
              "content": "Please provide the necessary input parameters."
            },
            {
              "role": "user",
              "content": "What is the target email address?"
            }
          ]
        },
        "task_prep_answer": {
          "parameters": [
            {
              "name": "email_address",
              "value": "user@example.com",
              "explanation": "The email address to which the report will be sent."
            },
            {
              "name": "include_summary",
              "value": true,
              "explanation": "Indicates whether to include a summary in the report."
            }
          ]
        },
        "end_time": "2024-09-18T10:05:00Z",
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "flow_run": "4ec2d0f1-1234-5678-9abc-def012345678"
      }
    ]
  },
  {
    "flow": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "flow_request": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "status": "pending",
    "approval_status": null,
    "triggered_time": null,
    "end_time": null,
    "triggered_by": null,
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "task_runs": [
      {
        "task_operation_index": 0,
        "status": "completed",
        "start_time": "2024-09-18T10:00:00Z",
        "task_prep_prompt": {
          "messages": [
            {
              "role": "system",
              "content": "Please provide the necessary input parameters."
            },
            {
              "role": "user",
              "content": "What is the target email address?"
            }
          ]
        },
        "task_prep_answer": {
          "parameters": [
            {
              "name": "email_address",
              "value": "user@example.com",
              "explanation": "The email address to which the report will be sent."
            },
            {
              "name": "include_summary",
              "value": true,
              "explanation": "Indicates whether to include a summary in the report."
            }
          ]
        },
        "end_time": "2024-09-18T10:05:00Z",
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "flow_run": "4ec2d0f1-1234-5678-9abc-def012345678"
      },
      {
        "task_operation_index": 0,
        "status": "completed",
        "start_time": "2024-09-18T10:00:00Z",
        "task_prep_prompt": {
          "messages": [
            {
              "role": "system",
              "content": "Please provide the necessary input parameters."
            },
            {
              "role": "user",
              "content": "What is the target email address?"
            }
          ]
        },
        "task_prep_answer": {
          "parameters": [
            {
              "name": "email_address",
              "value": "user@example.com",
              "explanation": "The email address to which the report will be sent."
            },
            {
              "name": "include_summary",
              "value": true,
              "explanation": "Indicates whether to include a summary in the report."
            }
          ]
        },
        "end_time": "2024-09-18T10:05:00Z",
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "flow_run": "4ec2d0f1-1234-5678-9abc-def012345678"
      }
    ]
  },
]

This endpoint retrieves all flow runs associated with a specific flow ID.

HTTP Request

GET /flow_runs/all_for_flow_id

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Query Parameters

Field Type Required Description
flow_id string Yes The ID of the flow.
skip int No Number of records to skip for pagination.
limit int No Maximum number of records to return.

Responses

Status Description
200 Successful Response
403 Authorization Error
404 Not Found Error
422 Validation Error

Read Flow Run with Flow Result

curl -X GET "api.neena.io/flow_runs/with_flow_result?id=uuid-of-flow-run" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'id': 'uuid-of-flow-run'
}

response = requests.get('api.neena.io/flow_runs/with_flow_result', headers=headers, params=params)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/flow_runs/with_flow_result?id=uuid-of-flow-run';

fetch(url, {
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

{
  "flow": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "flow_request": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "completed",
  "approval_status": null,
  "triggered_time": null,
  "end_time": null,
  "triggered_by": null,
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "task_runs": [
    {
      "task_operation_index": 0,
      "status": "completed",
      "start_time": "2024-09-18T10:00:00Z",
      "task_prep_prompt": {
        "messages": [
          {
            "role": "system",
            "content": "Please provide the necessary input parameters."
          },
          {
            "role": "user",
            "content": "What is the target email address?"
          }
        ]
      },
      "task_prep_answer": {
        "parameters": [
          {
            "name": "email_address",
            "value": "user@example.com",
            "explanation": "The email address to which the report will be sent."
          },
          {
            "name": "include_summary",
            "value": true,
            "explanation": "Indicates whether to include a summary in the report."
          }
        ]
      },
      "end_time": "2024-09-18T10:05:00Z",
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "flow_run": "4ec2d0f1-1234-5678-9abc-def012345678"
    },
    {
      "task_operation_index": 0,
      "status": "completed",
      "start_time": "2024-09-18T10:00:00Z",
      "task_prep_prompt": {
        "messages": [
          {
            "role": "system",
            "content": "Please provide the necessary input parameters."
          },
          {
            "role": "user",
            "content": "What is the target email address?"
          }
        ]
      },
      "task_prep_answer": {
        "parameters": [
          {
            "name": "email_address",
            "value": "user@example.com",
            "explanation": "The email address to which the report will be sent."
          },
          {
            "name": "include_summary",
            "value": true,
            "explanation": "Indicates whether to include a summary in the report."
          }
        ]
      },
      "end_time": "2024-09-18T10:05:00Z",
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "flow_run": "4ec2d0f1-1234-5678-9abc-def012345678"
    }
  ],
  "result": {
    "body": "string",
    "trigger_run_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "integration_entity_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "flow_run_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "organization_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "created_date": "2024-09-18T10:27:57.149Z",
    "modified_date": "2024-09-18T10:27:57.149Z",
    "created_by_email": "user@example.com",
    "modified_by_email": "user@example.com",
  }
},

This endpoint retrieves a specific flow run by its ID along with its flow result.

HTTP Request

GET /flow_runs/with_flow_result

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Query Parameters

Field Type Required Description
id string Yes The ID of the flow run.

Responses

Status Description
200 Successful Response
403 Authorization Error
404 Not Found Error
422 Validation Error

Flow Results

Flow Result Model

Field Type Description
id string (UUID) Unique identifier of the flow result.
body string The content or body of the flow result. It contains the result or output message from the flow execution.
trigger_run_id string (UUID) ID of the associated trigger run.
integration_entity_id string (UUID) The integration entity ID (e.g., ticket ID) that is used in the integration platform (e.g. Zendesk)
flow_run_id string (UUID) ID of the associated flow run.
organization_id string (UUID) ID of the associated organization.
created_date string (date-time) ISO 8601 formatted date-time when created.
modified_date string (date-time) ISO 8601 formatted date-time when modified.
created_by_email string Email of the user who created the flow result.
modified_by_email string Email of the user who last modified the flow result.

Notes: - Timestamps are in ISO 8601 format and represent UTC times.

Read Latest Flow Result For Integration Entity

curl -X GET "api.neena.io/flow_results/?integration_entity_id=entity-id&integration_short_name=integration_short_name" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'integration_entity_id': 'entity-id',
    'integration_short_name': 'integration_short_name'
}

response = requests.get('api.neena.io/flow_results', headers=headers, params=params)
print(response.json())
fetch('api.neena.io/flow_results/?integration_entity_id=entity-id&integration_short_name=integration_short_name', {
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

{
  "body": "string",
  "trigger_run_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "integration_entity_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "flow_run_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "organization_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "created_date": "2024-09-18T10:27:57.149Z",
  "modified_date": "2024-09-18T10:27:57.149Z",
  "created_by_email": "user@example.com",
  "modified_by_email": "user@example.com",
}

This endpoint retrieves the latest flow result for a specific integration entity. In case you have set up a trigger that works on a specific entity, for example Google Mails, you can fetch its result by providing the entity id that is used in the platform, along with the integration short name that is used, like in this case: gmail.

HTTP Request

GET /flow_results

Headers

Parameter Type Required Description
Authorization string Yes Bearer token in the format Bearer YOUR_API_KEY

Query Parameters

Parameter Type Required Description
integration_entity_id string Yes The integration entity ID (e.g., ticket ID) that is used in the integration platform (e.g. Zendesk)
integration_short_name string Yes The integration's short name

Responses

Status Description
200 Successful Response
403 Authorization Error
404 Not Found Error
422 Validation Error

Webhook Trigger Operations

Webhook trigger operations allow you to define actions that are initiated by external events through webhooks. These operations are tied to specific webhook trigger definitions and enable your workflows to react to real-time events from various integrations.

When an external event occurs and a webhook is received by Neena, a trigger run is created for each event. This trigger run effectively becomes a flow request, which then generates a flow and starts a flow run immediately. This seamless process transforms incoming webhooks directly into executable workflows, allowing you to automate responses to events in real time without any manual intervention.

When creating a webhook trigger operation, you must specify a webhook trigger definition, which defines the type of event and the data structure you expect to receive. The template_body field allows you to map the incoming webhook payload to a format that can be used within your flows.

Webhook Trigger Operation Model

Field Type Description
name string Name of the webhook trigger operation.
webhook_trigger_definition string (UUID) ID of the associated webhook trigger definition.
template_body string Template for the webhook payload body.
status string Status of the webhook trigger operation (e.g., 'active', 'inactive', 'failed').
id string (UUID) Unique identifier of the webhook trigger operation.
created_date string (date-time) ISO 8601 formatted date-time when the operation was created.
modified_date string (date-time) ISO 8601 formatted date-time when the operation was last modified.
created_by_email string Email of the user who created the webhook trigger operation.
modified_by_email string Email of the user who last modified the webhook trigger operation.
organization string (UUID) ID of the organization associated with the operation.

Webhook Trigger Operation Status Enum

Value Description
active The webhook trigger operation is active.
inactive The webhook trigger operation is inactive.
failed The webhook trigger operation has encountered a failure.

Create Webhook Trigger Operation

curl -X POST "api.neena.io/webhook_trigger_operations/" \
  -H "api_key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "name": "New Issue Created",
        "webhook_trigger_definition": "uuid-of-webhook-trigger-definition",
        "template_body": "{\"issue_id\": \"<{issue_id}>\", \"title\": \"<{title}>\"}",
        "status": "active"
      }'
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
}

data = {
    "name": "New Issue Created",
    "webhook_trigger_definition": "uuid-of-webhook-trigger-definition",
    "template_body": "{\"issue_id\": \"<{issue_id}>\", \"title\": \"<{title}>\"}",
    "status": "active"
}

response = requests.post('api.neena.io/webhook_trigger_operations/', headers=headers, json=data)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/webhook_trigger_operations/';

const headers = {
  'api_key': 'YOUR_API_KEY',
  'Content-Type': 'application/json',
};

const body = {
  name: 'New Issue Created',
  webhook_trigger_definition: 'uuid-of-webhook-trigger-definition',
  template_body: '{"issue_id": "<{issue_id}>", "title": "<{title}>"}',
  status: 'active'
};

fetch(url, {
  method: 'POST',
  headers: headers,
  body: JSON.stringify(body),
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

{
  "name": "New Issue Created",
  "webhook_trigger_definition": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "template_body": "{\"issue_id\": \"<{issue_id}>\", \"title\": \"<{title}>\"}",
  "status": "active",
  "id": "9b74c989-7b8f-4e4a-8a3e-0b6c0d2e8f06",
  "created_date": "2024-09-18T12:00:00Z",
  "modified_date": "2024-09-18T12:00:00Z",
  "created_by_email": "user@example.com",
  "modified_by_email": "user@example.com",
  "organization": "1a2b3c4d-5e6f-7g8h-9i0j-k1l2m3n4o5p6"
}

This endpoint creates a new webhook trigger operation in the system.

The event fields are inserted into the body using <{event_field}>, which in turn fetches the item from the event and inserts it into the request.

HTTP Request

POST /webhook_trigger_operations/

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Request Body

Field Type Required Description
name string Yes Name of the webhook trigger operation.
webhook_trigger_definition string (UUID) Yes ID of the associated webhook trigger definition.
template_body string Yes Template for the webhook payload body.
status string No Status of the webhook trigger operation (default is 'inactive').

Responses

Status Description
200 Successful Response
403 Authorization Error
422 Validation Error

Read Webhook Trigger Operation

curl -X GET "api.neena.io/webhook_trigger_operations/?id=uuid-of-webhook-trigger-operation" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'id': 'uuid-of-webhook-trigger-operation'
}

response = requests.get('api.neena.io/webhook_trigger_operations/', headers=headers, params=params)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/webhook_trigger_operations/?id=uuid-of-webhook-trigger-operation';

fetch(url, {
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

{
  "name": "New Issue Created",
  "webhook_trigger_definition": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "template_body": "{\"issue_id\": \"<{issue_id}>\", \"title\": \"<{title}>\"}",
  "status": "active",
  "id": "9b74c989-7b8f-4e4a-8a3e-0b6c0d2e8f06",
  "created_date": "2024-09-18T12:00:00Z",
  "modified_date": "2024-09-18T12:00:00Z",
  "created_by_email": "user@example.com",
  "modified_by_email": "user@example.com",
  "organization": "1a2b3c4d-5e6f-7g8h-9i0j-k1l2m3n4o5p6"
}

This endpoint retrieves a specific webhook trigger operation by its ID.

HTTP Request

GET /webhook_trigger_operations/

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Query Parameters

Field Type Required Description
id string Yes The ID of the webhook trigger operation.

Responses

Status Description
200 Successful Response
403 Authorization Error
404 Not Found Error
422 Validation Error

Read All Webhook Trigger Operations

curl -X GET "api.neena.io/webhook_trigger_operations/all?skip=0&limit=100" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'skip': 0,
    'limit': 100
}

response = requests.get('api.neena.io/webhook_trigger_operations/all', headers=headers, params=params)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/webhook_trigger_operations/all?skip=0&limit=100';

fetch(url, {
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

[
  {
    "name": "New Issue Created",
    "webhook_trigger_definition": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "template_body": "{\"issue_id\": \"<{issue_id}>\", \"title\": \"<{title}>\"}",
    "status": "active",
    "id": "9b74c989-7b8f-4e4a-8a3e-0b6c0d2e8f06",
    "created_date": "2024-09-18T12:00:00Z",
    "modified_date": "2024-09-18T12:00:00Z",
    "created_by_email": "user@example.com",
    "modified_by_email": "user@example.com",
    "organization": "1a2b3c4d-5e6f-7g8h-9i0j-k1l2m3n4o5p6"
  },
  {
    "name": "Comment Added",
    "webhook_trigger_definition": "4ec2d0f1-1234-5678-9abc-def012345678",
    "template_body": "{\"comment_id\": \"{{comment_id}}\", \"content\": \"{{content}}\"}",
    "status": "inactive",
    "id": "7e4b2d1c-3456-789a-bcde-f0123456789a",
    "created_date": "2024-09-18T13:00:00Z",
    "modified_date": "2024-09-18T13:00:00Z",
    "created_by_email": "admin@neena.io",
    "modified_by_email": "admin@neena.io",
    "organization": "1a2b3c4d-5e6f-7g8h-9i0j-k1l2m3n4o5p6"
  }
]

This endpoint retrieves all webhook trigger operations associated with the user.

HTTP Request

GET /webhook_trigger_operations/all

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Query Parameters

Field Type Required Description
skip int No Number of records to skip for pagination.
limit int No Maximum number of records to return.

Responses

Status Description
200 Successful Response
403 Authorization Error
422 Validation Error

Remove Webhook Trigger Operation

curl -X DELETE "api.neena.io/webhook_trigger_operations/?id=uuid-of-webhook-trigger-operation" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'id': 'uuid-of-webhook-trigger-operation'
}

response = requests.delete('api.neena.io/webhook_trigger_operations/', headers=headers, params=params)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/webhook_trigger_operations/?id=uuid-of-webhook-trigger-operation';

fetch(url, {
  method: 'DELETE',
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

This endpoint deletes a webhook trigger operation by its ID.

HTTP Request

DELETE /webhook_trigger_operations/

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Query Parameters

Field Type Required Description
id string Yes The ID of the webhook trigger operation.

Responses

Status Description
200 Successful Deletion
403 Authorization Error
404 Not Found Error
422 Validation Error

Webhook Trigger Definitions

Webhook trigger definitions specify the types of external events that can initiate workflows in Neena. They define the structure and data expected from incoming webhooks, enabling you to integrate with various external systems and services.

Webhook trigger definitions are directly linked to webhook trigger operations. When you create a webhook trigger operation, you must specify the webhook trigger definition it is based on. This ensures that the incoming webhook data is correctly interpreted and processed according to the defined event fields.

When an external event occurs and a webhook is sent to Neena, a trigger run is created based on the matching webhook trigger definition. This trigger run effectively becomes a flow request, which then generates a flow and starts a flow run immediately. This process allows you to automate responses to events in real time, transforming incoming webhooks into executable workflows without manual intervention.

When creating a webhook trigger operation, you must specify a webhook trigger definition, which defines the type of event and the data structure you expect to receive. The event_fields field allows you to map the incoming webhook payload to a format that can be used within your flows.

Webhook Trigger Definition Model

Field Type Description
trigger_name string Name of the webhook trigger definition.
integration string (UUID) ID of the associated integration.
python_method_name string Internal Python method name handling the webhook logic.
event_fields array of objects List of event fields expected in the webhook payload.
description string Description of the webhook trigger definition.
id string (UUID) Unique identifier of the webhook trigger definition.
created_date string (date-time) ISO 8601 formatted date-time when the definition was created.
modified_date string (date-time) ISO 8601 formatted date-time when the definition was last modified.
created_by_email string Email of the user who created the webhook trigger definition.
modified_by_email string Email of the user who last modified the webhook trigger definition.
deleted_at string (date-time) ISO 8601 formatted date-time when the definition was deleted, if applicable.

Event Field Model

Field Type Description
name string Name of the event field.
json_path string JSON path to extract the field from the webhook payload.
data_type string Data type of the field (e.g., 'string', 'int').
doc_string string Description of the event field.
optional boolean Indicates whether the field is optional.

Read All Webhook Trigger Definitions

curl -X GET "api.neena.io/webhook_trigger_definitions/all?skip=0&limit=100" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'skip': 0,
    'limit': 100
}

response = requests.get('api.neena.io/webhook_trigger_definitions/all', headers=headers, params=params)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/webhook_trigger_definitions/all?skip=0&limit=100';

fetch(url, {
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

[
  {
    "trigger_name": "New Issue Created",
    "integration": "9b74c989-7b8f-4e4a-8a3e-0b6c0d2e8f06",
    "python_method_name": "handle_new_issue",
    "event_fields": [
      {
        "name": "issue_id",
        "json_path": "$.issue.id",
        "data_type": "string",
        "doc_string": "The unique ID of the issue.",
        "optional": false
      },
      {
        "name": "title",
        "json_path": "$.issue.title",
        "data_type": "string",
        "doc_string": "The title of the issue.",
        "optional": false
      },
      {
        "name": "description",
        "json_path": "$.issue.description",
        "data_type": "string",
        "doc_string": "The description of the issue.",
        "optional": true
      }
    ],
    "description": "Triggered when a new issue is created in the issue tracking system.",
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "created_date": "2024-09-18T10:00:00Z",
    "modified_date": "2024-09-18T10:00:00Z",
    "created_by_email": "user@example.com",
    "modified_by_email": "user@example.com",
    "deleted_at": null
  },
  {
    "trigger_name": "Comment Added",
    "integration": "4ec2d0f1-1234-5678-9abc-def012345678",
    "python_method_name": "handle_comment_added",
    "event_fields": [
      {
        "name": "comment_id",
        "json_path": "$.comment.id",
        "data_type": "string",
        "doc_string": "The unique ID of the comment.",
        "optional": false
      },
      {
        "name": "content",
        "json_path": "$.comment.content",
        "data_type": "string",
        "doc_string": "Content of the comment.",
        "optional": false
      }
    ],
    "description": "Triggered when a new comment is added to an issue.",
    "id": "7e4b2d1c-3456-789a-bcde-f0123456789a",
    "created_date": "2024-09-18T11:00:00Z",
    "modified_date": "2024-09-18T11:00:00Z",
    "created_by_email": "admin@neena.io",
    "modified_by_email": "admin@neena.io",
    "deleted_at": null
  }
]

This endpoint retrieves all webhook trigger definitions available in the system.

HTTP Request

GET /webhook_trigger_definitions/all

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Query Parameters

Field Type Required Description
skip int No Number of records to skip for pagination.
limit int No Maximum number of records to return.

Responses

Status Description
200 Successful Response
403 Authorization Error
422 Validation Error

Read Webhook Trigger Definition

curl -X GET "api.neena.io/webhook_trigger_definitions/?id=uuid-of-webhook-trigger-definition" \
  -H "api_key: YOUR_API_KEY"
import requests

headers = {
    'api_key': 'YOUR_API_KEY',
}

params = {
    'id': 'uuid-of-webhook-trigger-definition'
}

response = requests.get('api.neena.io/webhook_trigger_definitions/', headers=headers, params=params)
print(response.json())
const fetch = require('node-fetch');

const url = 'api.neena.io/webhook_trigger_definitions/?id=uuid-of-webhook-trigger-definition';

fetch(url, {
  headers: {
    'api_key': 'YOUR_API_KEY',
  },
})
  .then(response => response.json())
  .then(data => console.log(data));

The above command returns JSON structured like this:

{
  "trigger_name": "New Issue Created",
  "integration": "9b74c989-7b8f-4e4a-8a3e-0b6c0d2e8f06",
  "python_method_name": "handle_new_issue",
  "event_fields": [
    {
      "name": "issue_id",
      "json_path": "$.issue.id",
      "data_type": "string",
      "doc_string": "The unique ID of the issue.",
      "optional": false
    },
    {
      "name": "title",
      "json_path": "$.issue.title",
      "data_type": "string",
      "doc_string": "The title of the issue.",
      "optional": false
    },
    {
      "name": "description",
      "json_path": "$.issue.description",
      "data_type": "string",
      "doc_string": "The description of the issue.",
      "optional": true
    }
  ],
  "description": "Triggered when a new issue is created in the issue tracking system.",
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "created_date": "2024-09-18T10:00:00Z",
  "modified_date": "2024-09-18T10:00:00Z",
  "created_by_email": "user@example.com",
  "modified_by_email": "user@example.com",
  "deleted_at": null
}

This endpoint retrieves a specific webhook trigger definition by its ID.

HTTP Request

GET /webhook_trigger_definitions/

Headers

Field Type Required Description
api_key string Yes API key YOUR_API_KEY

Query Parameters

Field Type Required Description
id string Yes The ID of the webhook trigger definition.

Responses

Status Description
200 Successful Response
403 Authorization Error
404 Not Found Error
422 Validation Error