---
title: Multi
slug: multi
docTags: 
createdAt: 2022-11-25T15:46:24.000Z
---

Allows you to define a set of multiple core API to run in a single call. This function offers high performance benefits. Any of the core functions can be included in the definition and the definitions will act on the output of any of the previous definitions in the list.



:::hint{type="info"}
Task Credits will be equal to the number of functions \* items in list

i.e. if there are 100 items in the list and 2 functions then the API credits consumed will be 100\*2 = 200.

Check with the support team for task credit utilisation in Multi API Usage for different plans
:::

Each function is in the functions array should have the following properties

| Property | Description                                                                                                     |                                                                                                       |
| -------- | --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| name     | A name for the property that can be used to reference in subsequent function in the list                        | eg. "switch\_source"                                                                                  |
| type     | One of the CORE API Types<br />i.e<br />- text<br />- json<br />- list<br />- number<br />- datetime<br />- web |                                                                                                       |
| function | The lowlevel name of the function. Can be found in the url of each function                                     | e.g. If the url is /functions/text/switch<br /><br />The type is "text" and the function is "switch"  |



**Use Case**: Say you want to apply two functions on a list of JSON Input from a lead source. [Switch](docId:-W9Rm9tUWw0RARX1_PCh2)  and [Split Date (Define)](docId\:EfShYFtXCWyrBG5Xj7O7n) to extract the month name and year and then use the value in the final output by using [Convert a JSON Object from one format to another](docId:_ON3T7RdmzSjqh6ch0UlK)&#x20;

&#x20;API Definition

:::ApiMethodV2
```json
{
  "tab": "examples",
  "url": "https://orca.pathfix.com/functions/list/multi",
  "name": "List Multi API",
  "method": "POST",
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [],
    "formDataParameters": []
  },
  "results": {
    "languages": [
      {
        "id": "28UsDqyeH3QRdmtVamSQT",
        "code": "{\n    \"output\": [\n        {\n            \"eml\": \"bruce@pathfix.com\",\n            \"source\": \"FB\",\n            \"other\": \"test\",\n            \"additional_value\": \"Pathfix\",\n            \"month\": \"Jan 2022\"\n        },\n        {\n            \"eml\": \"paul@pathfix.com\",\n            \"source\": \"FB\",\n            \"other\": \"\",\n            \"additional_value\": \"Pathfix\",\n            \"month\": \"Feb 2022\"\n        },\n        {\n            \"eml\": \"chang@pathfix.com\",\n            \"source\": \"li\",\n            \"other\": \"\",\n            \"additional_value\": \"Pathfix\",\n            \"month\": \"Feb 2022\"\n        }\n    ]\n}",
        "language": "200"
      },
      {
        "id": "yIX64DyIuDPJgBRFSfAWb",
        "code": "{\n    \"message\": \"error\"\n}",
        "language": "404"
      }
    ],
    "selectedLanguageId": "28UsDqyeH3QRdmtVamSQT"
  },
  "examples": {
    "languages": [
      {
        "id": "ENcJz9TStG38F0X-taA4x",
        "code": "{\r\n    \"input\": [\r\n        {\r\n            \"email\": \"bruce@pathfix.com\",\r\n            \"source\": \"facebook\",\r\n            \"other\":\"test\",\r\n\t\t\t\"date\":\"2022-01-25\"\r\n        },\r\n        {\r\n            \"email\": \"paul@pathfix.com\",\r\n            \"source\": \"facebook\",\r\n\t\t\t\"date\":\"2022-02-12\"\r\n        },\r\n        {\r\n            \"email\": \"chang@pathfix.com\",\r\n            \"source\": \"linkedin\",\r\n\t\t\t\"date\":\"2022-02-15\"\r\n\r\n        }\r\n    ],\r\n\t\"functions\": [\r\n        {\r\n\t\t\t//this is a reference to the text/switch function \r\n            \"name\": \"switch_source\",\r\n            \"type\": \"text\",\r\n            \"function\": \"switch\",\r\n            \"params\": {\r\n                \"input\":\"{{source}}\",\r\n                \"switch\": {\r\n                    \"facebook\": \"FB\",\r\n                    \"linkedin\": \"li\"\r\n                }\r\n            }\r\n        },\r\n\t\t{\r\n\t\t\t//this is a reference to the  datetime/split function \r\n            \"name\": \"date_enum\",\r\n            \"type\": \"datetime\",\r\n            \"function\": \"split\",\r\n            \"params\": {\r\n                \"input\":\"{{date}}\"\r\n            }\r\n        },\r\n        {\r\n\t\t\t//this is a reference json/replacefrominput \r\n            \"name\": \"convert\",\r\n            \"type\": \"json\",\r\n            \"function\": \"replacefrominput\",\r\n            \"params\": {\r\n                \"output\": {\r\n                    \"eml\": \"{{email}}\",\r\n                    \"source\": \"{{switch_source.output}}\",\r\n                    \"other\":\"{{other}}\",\r\n                    \"additional_value\":\"Pathfix\",\r\n\t\t\t\t\t\"month\":\"{{date_enum.output.monthName}} {{date_enum.output.year}}\"\r\n                },\r\n                \"replace_if_not_found\":\"yes\"\r\n            }\r\n        }\r\n    ]\r\n}",
        "language": "json"
      }
    ],
    "selectedLanguageId": "ENcJz9TStG38F0X-taA4x"
  },
  "description": "\nCall the following API:",
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::




