Functions

List Functions

List all functions with optional filtering.

GET
/v2/functions
x-api-key<token>

Authenticate using API Key in request header

In: header

Query Parameters

limit?integer
Default50
Range1 <= value <= 100
functionIDs?array<string>
Items1 <= items
functionNames?array<string>
Items1 <= items
displayName?string

Used for search over display names of functions. Will perform case-insensitive substring matching.

types?array<FunctionType>
Items1 <= items
sortOrder?string

Specifies sorting behavior. The two options are asc and desc to sort ascending and descending respectively, with default sort being ascending. Paging works in both directions.

Default"asc"
Value in"asc" | "desc"
startingAfter?string

A cursor to use in pagination. startingAfter is a function ID that defines your place in the list.

endingBefore?string

A cursor to use in pagination. endingBefore is a function ID that defines your place in the list.

tags?array<string>

Filter functions by tags. Functions must contain all specified tags.

Items1 <= items
workflowIDs?array<string>

Filter functions by workflow IDs. Returns functions whose current version is used by the current version of the specified workflows.

Items1 <= items
workflowNames?array<string>

Filter functions by workflow names. Returns functions whose current version is used by the current version of the specified workflows.

Items1 <= items
workflowIDVersionNums?array<string>

Filter functions by specific workflow versions using workflow IDs. Format: workflowID.versionNum (e.g., "w_abc123.2"). Returns functions whose current version is used by the specified workflow versions.

Items1 <= items
workflowNameVersionNums?array<string>

Filter functions by specific workflow versions using workflow names. Format: workflowName.versionNum (e.g., "invoice-processing.2"). Returns functions whose current version is used by the specified workflow versions. Resolves to workflows that currently have the specified names.

Items1 <= items

Response Body

application/json

curl -X GET "https://api.bem.ai/v2/functions?tags=billing%2Cfinance&workflowIDs=w_abc123%2Cw_def456&workflowNames=invoice-processing%2Corder-fulfillment&workflowIDVersionNums=w_abc123.2%2Cw_def456.3&workflowNameVersionNums=invoice-processing.2%2Corder-fulfillment.3"
{
  "functions": [
    {
      "functionID": "string",
      "functionName": "string",
      "versionNum": 0,
      "type": "transform",
      "usedInWorkflows": [
        [
          {
            "workflowID": "w_1234567890",
            "workflowName": "My Workflow",
            "currentVersionNum": 1,
            "usedInWorkflowVersionNums": [
              1,
              2,
              3
            ]
          }
        ]
      ],
      "displayName": "string",
      "tags": [
        "billing",
        "finance",
        "automated"
      ],
      "audit": {
        "functionCreatedBy": {
          "userActionID": "string",
          "userID": "string",
          "userEmail": "string",
          "apiKeyName": "string",
          "emailAddress": "string",
          "createdAt": "2019-08-24T14:15:22Z"
        },
        "functionLastUpdatedBy": {
          "userActionID": "string",
          "userID": "string",
          "userEmail": "string",
          "apiKeyName": "string",
          "emailAddress": "string",
          "createdAt": "2019-08-24T14:15:22Z"
        },
        "versionCreatedBy": {
          "userActionID": "string",
          "userID": "string",
          "userEmail": "string",
          "apiKeyName": "string",
          "emailAddress": "string",
          "createdAt": "2019-08-24T14:15:22Z"
        }
      },
      "outputSchemaName": "Freight Load Schema",
      "outputSchema": {
        "type": "object",
        "required": [
          "tenders"
        ],
        "properties": {
          "tenders": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "loadReference",
                "origin",
                "destination",
                "weightTons",
                "loadType",
                "desiredDeliveryDate",
                "bidSubmissionDeadline",
                "submitter"
              ],
              "properties": {
                "origin": {
                  "type": "string",
                  "description": "The starting point of the shipment."
                },
                "loadType": {
                  "type": "string",
                  "description": "The type of goods being shipped."
                },
                "submitter": {
                  "type": "object",
                  "required": [
                    "name",
                    "position",
                    "contactInfo"
                  ],
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "Name of the person submitting the tender."
                    },
                    "position": {
                      "type": "string",
                      "description": "Position of the submitter within their company."
                    },
                    "contactInfo": {
                      "type": "object",
                      "required": [
                        "email"
                      ],
                      "properties": {
                        "email": {
                          "type": "string",
                          "format": "email",
                          "description": "Email address of the submitter."
                        },
                        "phone": {
                          "type": "string",
                          "description": "Phone number of the submitter."
                        }
                      }
                    }
                  }
                },
                "weightTons": {
                  "type": "number",
                  "description": "The weight of the load in tons."
                },
                "destination": {
                  "type": "string",
                  "description": "The endpoint of the shipment."
                },
                "loadReference": {
                  "type": "string",
                  "description": "Unique identifier for the load tender."
                },
                "desiredDeliveryDate": {
                  "type": "string",
                  "format": "date",
                  "description": "The preferred date for the shipment to be delivered."
                },
                "bidSubmissionDeadline": {
                  "type": "string",
                  "format": "date",
                  "description": "The deadline for submitting bids."
                }
              }
            }
          }
        }
      },
      "emailAddress": "eml_2c9AXFXHwiaL4vPXDTOS171OJ8T@pipeline.bem.ai",
      "tabularChunkingEnabled": false
    }
  ],
  "totalCount": 0
}