APIs
APIs (Application Programming Interfaces) are a set of rules and protocols that enable different software applications to communicate and interact with each other. Softyflow provides an API editor that allows you to create custom APIs for integration and data exchange between different platforms, services and systems. Since version 8.6, an API can also describe its input with a call schema and be exposed as a tool for AI assistants (Claude, ChatGPT…) through the Softyflow MCP server.
1. Creating an APIDirect link to 1. Creating an API
Open your project, then open the APIs panel of the project dock and click + (or use the API card of the project home). Give the API a name in the New API card and click Create. The API editor opens in a new tab.

2. The API EditorDirect link to 2. The API Editor
The API editor (/ide/api/<id>) has the same layout as the other Softyflow editors:
- On the left, the palette, with two groups of tiles:
- Logic: Actions (visual actions) and Code (JavaScript). A green dot shows the logic the API currently runs.
- Settings: General, Call schema, AI tool (MCP), Endpoint and Logs. A dot on a tile shows that the option is on (for example the call schema or the MCP tool); the Logs tile shows the number of calls.
- In the middle, the frame of the selected tile.
- On the right, the test panel (Test the API), which you can hide or show again from the rail.
- The rail on the far right: Save (Ctrl + S), Test panel and Version history.

2.1. Logic: Actions or CodeDirect link to 2.1. Logic: Actions or Code
An API runs one logic at a time:
- Actions: chain visual actions without code. You can still write JavaScript in their fields.
- Code: the body of an
asyncfunction run on the server. The returned value becomes the response.
When you open the logic that is not running, a banner tells you so (for example "This code is not run: the API currently runs the actions. It stays saved.") with a button to switch (Run this code / Run the actions). The other logic is kept, so you can switch back at any time.
Above the code editor, a bar lists the variables you can use and reminds you that each key of the body is also available as a variable (with the exceptions listed below).
At the top right of the Code frame, the Editor theme button (Dev Tools by default) opens the theme picker: Dev Tools, Night Mode, Blackboard, Oceanic Next, Tomorrow Night Blue and All Hallows Eve, each card previewing the colours of the theme. The theme is used by the code editors of the IDE, in this browser (the Code page of the interfaces uses the same one).
The SoftyTables category offers the actions of the Softy Tables, including addToSoftyTable (A) (add a row), addManyToSoftyTable (A) (add several rows) and getSoftyTableRow (A) (read a row by its id). Dump var names the variable that receives the result, so the next action can use it: after an addToSoftyTable (A) whose dump variable is "added", write added.id in the Row id of the following action. The dump variable is also returned in the response. If no row has this id, getSoftyTableRow (A) returns an empty result, not an error.
To start a process on behalf of the user who calls the API, turn on On behalf of caller in the launchProcess action, or pass { onBehalfOf: SF_initiator } in the code (see launchProcess). The process must have the Start by an API on behalf of the caller setting (see Process settings), and the caller must be in its Who can start it roles. The instance then belongs to the caller. This also applies to an MCP tool.
2.2. Available VariablesDirect link to 2.2. Available Variables
| Variable | Type | Description |
|---|---|---|
SF_body | Object | Request body. In the code, each of its keys is also a variable. |
SF_query | Object | URL parameters |
SF_headers | Object | HTTP headers of the request |
SF_mode | String | Environment: test, uat or prod |
SF_initiator | Object | User calling the API |
SF_channel | String | Channel of the call: "http" (HTTP call) or "mcp" (AI client through the MCP server) |
SF_client | Object | MCP calls only: the AI client { id, name, host } |
In the code only, you also have SF (the SoftyFlow SDK: collections, files, processes, users…), volt (the project Volts, values of the current environment) and variables (all the variables above in one object).
Body keys that do not become variables. Since 8.6, a key of the body becomes a variable of the code only when it can name one; before, such a key made the whole code fail. The following keys are left out:
- keys that are not JavaScript names, such as
first-nameorNom client(accented names such asprénomare fine); - JavaScript reserved words:
default,class,await,new,delete,return,function…; SF,variablesandvolt, which are already taken.
When the code starts with "use strict", let, static, public, private, protected, interface, package, implements, yield, eval and arguments are left out too. These keys are still in the body: read them with SF_body['first-name'] or variables['first-name'].
An SF_res_headers key sent by the caller is removed from the body: only the logic of the API sets the response headers (see Endpoint).
2.3. General: Name, Description and Access RightsDirect link to 2.3. General: Name, Description and Access Rights
The General tile holds:
- Identity: the API name and a Description (what the API does, what it expects and what it returns).
- Access rights: who can call the API:
- Signed-in users: any signed-in user;
- Selected roles: only the members of the roles you pick in Allowed roles (with no role selected, nobody can call the API);
- Public: no authentication. Anyone who knows the URL can call the API.

2.4. Endpoint: How to Call the APIDirect link to 2.4. Endpoint: How to Call the API
The Endpoint tile documents the API for the people and tools that call it:
- URL per environment: one
POSTURL for TEST (last saved version), UAT (acceptance version) and PROD (deployed version), each with a copy button. The API can also be called withGETon.../run?SF_mode=prod, the parameters then being read fromSF_query. - Authentication: the user's session cookie, or an
x-access-tokenheader (JWT). A "Public" API needs none. - Call examples: ready-to-copy snippets in cURL, fetch and axios, for the environment you choose. When a call schema exists, the example body follows it.
- Response: success returns
{ "data": … }(the value returned by the code, or the variables after the actions); an error returns{ "err": "message" }with the HTTP status (500 by default). When the call schema refuses a call, the API answers400witherrand adetailslist (path,message) and does not run. - Facts: return an
SF_res_headersobject to set response headers (anSF_res_headerssent by the caller in the body is ignored); the maximum run time is 60 seconds; theSF_version=<id>parameter runs a given version. - Available variables: the body fields of the call schema (type, required, description) and the system variables.

2.5. LogsDirect link to 2.5. Logs
The Logs tile lists the calls of the API, most recent first. Filter them by user, period and result (All, Success, Errors), and click Details to see the message and the data of a call. Calls made by an AI assistant through the MCP server carry an MCP · client name badge.

2.6. Saving and Version HistoryDirect link to 2.6. Saving and Version History
Changes are saved with the Save button of the rail or Ctrl + S. The Version history button opens the list of the saved versions of the API; you can load a previous version in the editor (unsaved changes are lost).
3. Testing an APIDirect link to 3. Testing an API
The Test the API panel runs the API in TEST mode:
- Type the Test variables: a JSON object sent as the request body (
SF_body). From the call schema, Use as test variables fills it with an example body. - Click Run (or press Ctrl + Enter). The test runs the last saved version: when you have unsaved changes, the button becomes Save and run.
- Read the Response: HTTP status, Success or Error, and the returned JSON (with a copy button). When the call schema refuses the call, the Refused fields list tells you which fields are wrong.

4. Call SchemaDirect link to 4. Call Schema
The call schema describes the fields the API expects in its request body: name, type, constraints and a description for each field. It:
- documents the API: no need to read the code to know what to send;
- protects the API: incomplete or malformed calls can be refused before the actions or the code run;
- gets the API ready for AI: the schema is required to expose the API as an MCP tool.
Open the Call schema tile and turn on Turn the call schema on. Then choose:
- Refuse calls that do not match: a call that does not match the schema gets a
400error, and the API does not run. With validation off, the schema only documents the API. With validation on:- a
POSTcall is read from its body only. The top-levelSF_…keys of the body are removed, the default values of the schema are added to the body for the missing fields before the actions or the code run, andSF_queryonly keeps theSF_…parameters of the URL (SF_mode,SF_version…); - a
GETcall is checked on its query string only: the values are converted to the types of the schema for the check, but the logic still receives them as sent, as text, inSF_query(SF_query.amount + 1gives"121"for?amount=12: convert it withNumber(...)), and the default values of the schema are not added. AGETcall that carries a body is refused with400("a GET call takes its input in the query string, not in a body").
- a
- Refuse undeclared fields: a call that sends a field missing from the schema is refused.
A status badge tells you whether the schema is Valid, Invalid or empty.
You can also ask Flowy to write the call schema of an API and to expose it as an MCP tool.
4.1. No-code EditorDirect link to 4.1. No-code Editor
In No-code mode, drag a field type from the Field types palette into Body fields (or click it). The available types are Text, Number, Integer, Yes/No, Date, Date and time, E-mail, Link, Value list, Object, List and List of objects. Objects and lists of objects contain their own fields (drag fields into them).
For each field, fill in:
- the Field name (the key of the JSON body;
SF_…names are reserved), - a Description: what the field is for. It is read by your team and by the AI, so write it carefully (units, formats, examples),
- Required when the call must send the field.
The arrow of a field opens More settings: title, format, min./max. length, regular expression, minimum/maximum, allowed values, default value, example, number of elements, and the choice source of value lists (see below). Fields with a problem (no name, duplicate name, inconsistent limits…) are highlighted, and the API cannot be saved until they are fixed.

4.2. Low-code Editor (JSON Schema)Direct link to 4.2. Low-code Editor (JSON Schema)
Low-code shows the same schema as a JSON Schema (2020-12) document, checked as you type (Format reformats it). The root must be an object ("type": "object"). Use it for JSON Schema features the no-code editor does not offer; such a schema is then shown read-only in no-code mode.

4.3. Choice Sources: Custom Lists and CollectionsDirect link to 4.3. Choice Sources: Custom Lists and Collections
The allowed values of a Value list field (and of a number field) do not have to be typed by hand. In More settings, Value source offers:
- Manual values: the values you type;
- Custom list: the values of a custom list of the project (text fields only);
- Collection: the documents of a collection. Choose the Returned value field (for example
_idor a code) and the Label field shown to people and to the AI; the fields are detected from a test document, and you can type another field path.
The source follows the environment of the call (test, UAT or production): a custom list uses its version published in that environment, and the values are resolved at call time with the rights of the user who calls. Turn on Available to AI to give the AI an extra MCP tool that lists the choices and searches them by value or label (exact, text or regex match), so it can pick a valid value before calling the API.

4.4. Draft with AIDirect link to 4.4. Draft with AI
Draft with AI reads the actions or the code of the API and drafts the whole schema, with a description on every field (it also proposes the API description and the MCP tool texts). Nothing is saved: review the draft, click Undo if it does not suit you, then save. The button is available when AI is configured on the instance.
4.5. Example CallDirect link to 4.5. Example Call
Under the schema, Example call shows a request body that matches the schema. Use as test variables copies it into the test panel.
5. Exposing an API as an MCP ToolDirect link to 5. Exposing an API as an MCP Tool
MCP (Model Context Protocol) lets AI assistants such as Claude, ChatGPT or Copilot call external tools. Softyflow runs one MCP server per environment: each API you expose becomes a tool that the users' AI assistants can call on their behalf, with their rights. How users connect their assistant is explained in the Integration guide.
Open the AI tool (MCP) tile.

5.1. Expose as an MCP ToolDirect link to 5.1. Expose as an MCP Tool
Turn on Expose as an MCP tool. The switch needs a valid call schema: the AI needs it to know what to send (Open the call schema takes you there). The card then tells you:
- Who sees this tool: it follows the API access rights. With Signed-in users, any signed-in user who authorised their AI client; with Selected roles, only the members of those roles. A Public API is still only visible through MCP to signed-in users who authorised their AI client.
- Whether the tool is read only (usable with a "Read only" connection) or changes data (needs a "Read and write" connection).
The tool depends on the call schema:
- Turning the call schema off also turns the MCP tool off, with the message "MCP tool turned off: it needs the call schema.". Turn the tool on again once the schema is back.
- When the tool is exposed but the schema is missing or has errors, the card says so ("The call schema has errors: fix them to expose the tool.") and warns: "While the tool stays exposed, the API cannot be saved.". Fix the schema (Open the call schema) or turn the tool off, then save.
5.2. Tool IdentityDirect link to 5.2. Tool Identity
What the AI reads to choose the tool and call it:
- Technical name: letters, digits,
_and-, 64 characters at most, unique in each environment. From the name builds it from the API name. - Title: a readable label (for example "Create an order").
- Description for the AI (required, 2,000 characters at most): what the tool does, when to use it, the units of the fields and its effects (creates a request, sends an e-mail…).
Draft with AI proposes the name, title and description from the API and its schema.
5.3. BehaviourDirect link to 5.3. Behaviour
Hints for the AI client (they do not replace the access rights): Read only, Destructive, Idempotent and External services. In Automatic mode they are inferred from the actions or the code of the API and computed again on every save: chips show the result (Read only or Changes data, May delete data, Calls external services, Idempotent), Detected: lists the operations that change data found in the logic (for example SF.collection.insertOne), and Compute again runs the analysis again on the logic as it is in the editor, before you save. Switch to Manual to set the hints yourself. A read-only tool may be called by AI clients without asking the user for confirmation.
5.4. What the AI Receives and MCP ServersDirect link to 5.4. What the AI Receives and MCP Servers
What the AI receives previews the tool exactly as the MCP server describes it (tools/list). MCP servers lists the address to add as a connector in the AI client, one per environment:
| Environment | MCP server address | API version exposed |
|---|---|---|
| PROD | https://<your-instance>/mcp | Deployed version |
| UAT | https://<your-instance>/mcp/uat | Acceptance version |
| TEST | https://<your-instance>/mcp/test | Last saved version |
The tool follows deployments: each server exposes the API version of its environment. Each user authorises their AI client with their Softyflow account and only sees the tools their roles allow; they can revoke the access at any time in My settings › AI apps of the portal (see Integration › Revoking access).

5.5. MCP Calls in Your LogicDirect link to 5.5. MCP Calls in Your Logic
An MCP call runs the API exactly like an HTTP call: the arguments sent by the AI (already checked against the call schema) are available as variables, in SF_body and in SF_query; SF_initiator is the connected user, SF_channel is "mcp" and SF_client describes the AI client. Each call appears in the Logs with an MCP badge. An MCP call must finish within 55 seconds.
6. Invoking APIsDirect link to 6. Invoking APIs
Softyflow provides two methods for invoking APIs:
6.1. Method 1: Using the InvokeApi ActionDirect link to 6.1. Method 1: Using the InvokeApi Action
The InvokeApi action provides a visual, no-code way to call an API of the project from a web interface. It is a visual action of the interface: in a process, call the URL of the API from a script with SF.utils.axios (see Method 2 and the Integration guide).
Configuration Steps:
- Open the Code page of the interface, choose the trigger in Visual actions (for example On Click) and open a function, or create one with New function.
- Open the Api category of the action bar and pick InvokeApi.

- Fill in the two fields of the action:
- Dump variable (first field,
"apiResponse"by default): the variable that receives the response. Keep the quotes: like all action fields, it accepts JavaScript; - Api endpoint: the API to call, chosen among the APIs of the project. Once an API is selected, the eye button opens it in a new tab; without an API, the + button creates one.
- Dump variable (first field,

- Click the edit button (
edit_noteicon) at the end of the row: it opens the params dialog, where you write the request body, sent to the API asSF_body. Reference a field of the page with{{model}}, without quotes: between quotes,"{{objet}}"is not replaced by the value of the field.

When the action runs, it calls the API (POST) in the environment of the application (TEST, UAT or PROD) and stores the value returned by the API (the data part of the response) in the variable. When the API answers an error (including a 400 refused by the call schema), the action fails with the error message: the next actions of the function do not run, and the function chosen in On error (an Error handler function of the interface), if any, runs with the error.
6.2. Method 2: Using Axios (Code-Based Approach)Direct link to 6.2. Method 2: Using Axios (Code-Based Approach)
For advanced use cases or external integrations, you can invoke Softyflow APIs using standard HTTP clients like Axios.
In a process script, axios is not a global variable: write SF.utils.axios (for example await SF.utils.axios.post(apiUrl, body)). See the Integration guide.
Example Implementation:
// Define request body
let body = {
email: "client1@example.com",
userId: 12345,
};
// Construct API URL with mode parameter
let apiUrl =
"https://your-instance.softyflow.io/api/v1/api/6491696d1ef51ed2f7044b79?SF_mode=prod";
// Available modes: test, uat, prod
// Make POST request
let result = await axios.post(apiUrl, body);
// Access response data
console.log(result.data);
Key Considerations:
- Mode Parameter: Always specify
SF_modein the URL (test, uat, or prod). The Endpoint tile of the API editor gives the exact URL of each environment and ready-made cURL, fetch and axios snippets. - Authentication: Include authentication headers if required
- Error Handling: Implement try-catch blocks for robust error handling
- Response Format: API responses are typically JSON formatted
Advanced Example with Headers:
try {
let body = {
email: "user@example.com",
action: "getData",
};
let config = {
headers: {
"Content-Type": "application/json",
Authorization: "Bearer YOUR_TOKEN",
},
};
let apiUrl =
"https://your-instance.softyflow.io/api/v1/api/YOUR_API_ID?SF_mode=prod";
let response = await axios.post(apiUrl, body, config);
// Process response
return response.data;
} catch (error) {
console.error("API call failed:", error);
throw error;
}
7. Best PracticesDirect link to 7. Best Practices
7.1. API DesignDirect link to 7.1. API Design
- Clear Naming: Use descriptive names that indicate the API's purpose
- Consistent Structure: Maintain uniform request/response formats
- Version Control: Consider API versioning for future changes
- Documentation: Document expected inputs, outputs, and error codes; a call schema with a description on each field does most of this work
7.2. SecurityDirect link to 7.2. Security
- Access Control: Restrict API access to authorized users/groups
- Input Validation: Always validate incoming data
- Error Messages: Avoid exposing sensitive system information
- Rate Limiting: Implement throttling for production APIs
7.3. TestingDirect link to 7.3. Testing
- Test All Modes: Validate behavior in test, UAT, and production modes
- Edge Cases: Test with various input scenarios
- Error Conditions: Verify proper error handling
- Performance: Monitor response times and optimize as needed
7.4. MonitoringDirect link to 7.4. Monitoring
- Review Logs: Regularly check execution logs for errors
- Usage Patterns: Monitor which APIs are called most frequently
- Performance Metrics: Track response times and success rates
- Alert Systems: Set up notifications for critical failures
8. TroubleshootingDirect link to 8. Troubleshooting
8.1. Common IssuesDirect link to 8.1. Common Issues
8.1.1. API Not RespondingDirect link to 8.1.1. API Not Responding
Problem: API calls return no response or timeout
Solutions:
- Verify the API URL is correct
- Check if the API is enabled in the specified mode
- Ensure network connectivity to Softyflow instance
- Review execution logs for error details
8.1.2. Authentication ErrorsDirect link to 8.1.2. Authentication Errors
Problem: "Unauthorized" or "Forbidden" responses
Solutions:
- Verify user has proper access rights
- Check if API is set to public if needed
- Confirm authentication headers are correct
- Review role assignments in configuration
8.1.3. Incorrect Data FormatDirect link to 8.1.3. Incorrect Data Format
Problem: API receives or returns unexpected data
Solutions:
- Validate request body matches expected schema
- Check SF_body, SF_query variable usage
- Review API logic for proper data transformation
- Test with sample data in test mode
8.1.4. Performance IssuesDirect link to 8.1.4. Performance Issues
Problem: Slow API response times
Solutions:
- Optimize database queries within API logic
- Reduce unnecessary data processing
- Consider caching frequently accessed data
- Monitor and limit concurrent executions
8.1.5. Calls Refused with a 400 ErrorDirect link to 8.1.5. Calls Refused with a 400 Error
Problem: The API answers 400 with err and a details list, and its logic does not run
Solutions:
- The call does not match the call schema while Refuse calls that do not match is on: read
details(field path and message) - Check that required fields are sent and that no undeclared field is sent when Refuse undeclared fields is on
- Remember that, with validation on, a
POSTcall is read from its body only and aGETcall from its query string only: aGETcall that carries a body is refused
For additional support, consult the execution logs and review the API configuration settings.