REST API
/
Endpoints
Getting Started
Tutorials
Datasources
Functions
Spaces
Queues
Components
Self Hosted
Settings
REST API

Endpoints

List data sources

This endpoint lists all data sources associated with your Internal account.

Path: /api/v1/data_sources

Query parameters:

  • page: Optional, the page number to load (defaults to 1).
  • page_size: Optional, the number of data sources to list per page (defaults to 30, max of 100).

Response fields:

  • data_sources: data_sources: An array of data source objects with the following properties:
    • id: The id of the data source.
    • title: The name of the data source.

Example:

  
curl -u int_...eJVy: https://secure.internal.io/api/v1/data_sources
  
  
{
  "data_sources": [
    { "id": "757fcf6a-7122-4c8f-9dbb-075b982727e1", "title": "PostgreSQL" },
    { "id": "dedd3c9a-dcaa-42d1-96b6-e15381f0e3f8", "title": "HTTP" }
  ]
}
  

List a data source's functions

This endpoint lists all functions defined on a data source. Only functions that the API key has permissions to execute are returned.

Path: /api/v1/data_sources/:data_source_id/functions

Query parameters:

  • page: Optional, the page number to load (defaults to 1).
  • page_size: Optional, the number of data sources to list per page (defaults to 30, max of 100).

Response fields:

  • functions: An array of function objects with the following properties:
    • id: The id of the function
    • title: The title of the function
    • parameters: The array of function parameters with the following properties:
      • name: The name of the parameter.
      • type: The type of the parameter (one of: binary, bool, date, datetime, decimal, file, float, int, json, multipart, string, time, timestamp)
      • required: Whether the parameter is required.

Example:

  
curl -u int_...eJVy: \
  https://secure.internal.io/api/v1/data_sources/dedd3c9a-dcaa-42d1-96b6-e15381f0e3f8/functions
  
  
{
  "functions": [
    {
      "id": "7efc014b-525d-404e-b9fd-94dde87bcb70",
      "title": "Request",
      "parameters": [
        { "name": "path", "type": "string", "required": true },
        { "name": "query", "type": "json", "required": false },
        { "name": "header", "type": "json", "required": false },
        { "name": "method", "type": "string", "required": true },
        { "name": "raw_body", "type": "string", "required": false },
        { "name": "form_body", "type": "json", "required": false },
        { "name": "json_body", "type": "json", "required": false },
        { "name": "binary_body", "type": "binary", "required": false },
        { "name": "multipart_body", "type": "multipart", "required": false }
      ]
    },
    {
      "id": "b20a2e74-aebd-4803-b829-04343ec0457f",
      "title": "GET /",
      "parameters": [{ "name": "path", "type": "int", "required": false }]
    }
  ]
}
  

Get function

This endpoint gets a function. A function is returned only if the API key has permissions to execute that function.

Path: /api/v1/functions/:id

Response fields:

  • functions: The function object with the following properties:
    • id: The id of the function
    • title: The title of the function
    • parameters: The array of function parameters with the following properties:
      • name: The name of the parameter.
      • type: The type of the parameter (one of: binary, bool, date, datetime, decimal, file, float, int, json, multipart, string, time, timestamp)
      • required: Whether the parameter is required.

Example:

  
curl \
  -H "content-type: application/json" \
  -u int_...eJVy: \
  https://secure.internal.io/api/v1/functions/b20a2e74-aebd-4803-b829-04343ec0457f
  
  
{
  "function": {
    "id": "b20a2e74-aebd-4803-b829-04343ec0457f",
    "title": "GET /",
    "parameters": [
      { "name": "path", "type": "int", "required": false }
    ]
  }
}
  

Execute function

This endpoint executes a function. Only functions that the API key has permissions to execute are executed.

Method: POST Path: /api/v1/executions

Request parameters:

  • function_id: Required, the id of the function to execute.
  • values: Optional, an object containing the values to execute the function with.

Response fields:

  • data: The data returned by the function.
  • metadata: The metadata returned by the function.

Example:

  
curl \
  -H "content-type: application/json" \
  -u int_...eJVy: \
  -d '{"function_id": "b20a2e74-aebd-4803-b829-04343ec0457f", "values": {}}' \
  https://secure.internal.io/api/v1/executions
  
  
{
  "data": "\n\n...\n",
  "metadata": {
    "http": {
      "request": {
        "body": "",
        "headers": { "User-Agent": "Internal/1.0 (+https://internal.io/)" },
        "method": "GET",
        "url": "https://example.com"
      }
    }
  }
}