AIR-Core API v1.1.0
Deprecated. API v1 is replaced by API v2 (/api/v2/…, reference at /docs/api): the same operations without the alerts, plus the automations. API v1 keeps working; its operations of the alerts answer 410 Gone with the code ALERTS_REMOVED.
REST API of AIR-Core (version 1.1), the data and artificial intelligence platform of AIR Institute.
Authentication. Create an authorization token in the Account section (API and AI applications) and send it in the x-auth-token header. The token is shown only once, when it is created: AIR-Core keeps only its hash, and the lists show its name, dates and last 4 characters. Resetting the password revokes every token, and changing it can revoke them too. Endpoints that act on workspaces also take the organization in the x-organization header.
Asynchronous work. Uploading data and training models start a task: the response carries its task_id, and GET /api/v1/workspace/{workspaceId}/task/{taskId} reports its status and result.
Explainability and model cards. models/{modelId}/explanation, explanation/prediction and card return SHAP explanations and a model card when the explainability module is enabled; explanation/rules, explanation/prototypes, explanation/counterfactuals, explanation/compare, explanation/effects and explanation/fairness return the rules of a model, representative cases, what would have to change for another prediction, where two models disagree, the effect of each input and a bias audit by a sensitive field.
Assistants and agents. The same operations are exposed to AI assistants through the MCP server of the deployment (Streamable HTTP at /mcp, OAuth 2.1), with the permissions of the user who connects it. An OAuth authorization granted for the directory tool set (/mcp/directory, which cannot edit or delete data) is bound to it: the API answers its tokens only the operations of those tools, and 403 with the code DIRECTORY_SCOPE to the rest.
Limits. A deployment may limit the requests per second of each address; the API answers 429 when the limit is exceeded.
Python SDK: https://github.com/deepintdev/deepint-python-sdk
API v1 is deprecated. It keeps working without the alerts, which answer 410 Gone: use the automations of API v2. API v2 reference
OpenAPI (JSON) OpenAPI (YAML)
Base URL: https://app.air-core.io
sources
Sources API. Sources allow you to store your data.
GET /api/v1/workspace/{workspaceId}/sources
Obtains the list of data sources
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Autentication token
|
page | query | integer (int32) | Requested page (starts with 0)
|
limit | query | integer (int32) | Max number of items per page (max 500)
|
field_type | query | string: date | numeric | nominal | logic | text | Optional: only the sources with at least one field of this type (date lists the sources a forecast can use). The answer then also has field_type and total_sources, the number of sources of the workspace.
|
Responses
- 200 Normal response. Paginated result.
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/sources" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/sources
Creates a new data source
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
name | string | Source name. Max 120 characters.
|
description | string | Source description. Max 300 characters.
|
encrypted | boolean | True to encrypt the data source
|
shuffled | boolean | True to shuffle instances
|
features | array<object> | List of features to create
|
Responses
- 200 Normal response.
- 400 Bad request
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/sources" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/source/{sourceId}/clone
Clones Source
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the source
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
name | string | Source name (Max 120 characters)
|
Responses
- 200 Success
- 400 Bad request
- 401 Unauthorized
- 403 Access denied
- 404 Not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/clone" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/sources/derived
Creates a derived source
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
name | string | Source name. Max 120 characters.
|
description | string | Source description. Max 300 characters.
|
derived_type | string: filter | extend | join | merge | aggregate | join_multi | recipe | text_analysis | Derived type. filter = Filters a source. extend = Melts a source. join = Join 2 sources. merge = merges 2 sources. aggregate = Performs instances aggregations. join_multi = Joins a main source with 1 to 5 more (main, lookups and columns): the lookups are loaded in memory up to the cap of the plan (JOIN_TOO_BIG above it), a repeated key of a lookup uses its first row, and each run keeps a report (GET .../source/{sourceId}/join-report). recipe = a prepared source: the steps over the origin, recomputed each time the origin updates (see GET .../source/{sourceId}/recipe). text_analysis = «Analizar textos»: the columns of the origin plus a classical analysis of one of its columns of texts (origin, column, tasks, language, keywords_top, date_column, topics, classifiers, names), applied again when the origin updates when the plan includes it (see GET .../source/{sourceId}/text-analysis); refused with TEXT_ANALYSIS_LIMIT or TEXT_ANALYSIS_PLAN by the caps of the plan and TEXT_ENGINE_OUTDATED when the AI module cannot analyse texts
|
origin | string | ID of the origin source.
|
origin_b | string | ID of the second origin source. For join and merge.
|
query | QueryTree | Tree used to describe a query. Used in order to query instances of data sources.
|
features | string | List of features indexes, split by commas. For filter, this selects the list of features to keep in the derived source. For extend, this selects the features to melt.
|
steps | array<RecipeStep> | recipe: the steps, checked against the columns of the origin (400 with the code of the first one that cannot be used)
|
column | string | text_analysis: NAME of the column of texts (text or nominal)
|
tasks | array<string: language | sentiment | keywords | entities | topics> | text_analysis: what to compute (default language, sentiment, keywords); entities on the plans that include them
|
language | string | text_analysis: auto (default: identified in each text) or es, en, ca, de, fr, it, pt, ja, zh
|
keywords_top | integer | text_analysis: keywords per text (default 5)
|
date_column | string | text_analysis: NAME of a column of dates: sentiment (and topics, on the plans with topics over time) by period
|
topics | object | text_analysis with the task topics: {k: 0 (automatic) or 2 to the maximum of the plan, method?: nmf or lda, model?: an existing topics model of the workspace}
|
classifiers | array<object> | text_analysis: text classifiers of the workspace to apply ({model, column, kind: emotions or labels}); own classifiers on the plans that include them
|
names | object | text_analysis: names of the new columns by output (language, sentiment, score, keywords, entities, people, topic, topic_weight); a name taken by the origin gets « 2»
|
field_a | number (int32) | Match feature for join in first origin source. For merge, this sets the source name filed if the first source is already a merge source. For aggregate, this is the field to group by, set to -1 for no grouping.
|
field_b | number (int32) | Match feature for join in the second origin source.
|
encrypted | boolean | True to encrypt the data source
|
shuffled | boolean | True to shuffle instances
|
main | string | join_multi: identifier of the main source (one output row per row of it, or fewer with inner lookups)
|
lookups | array<JoinMultiLookup> | join_multi: the sources joined to the main one, in order
|
columns | array<JoinMultiColumn> | join_multi: the columns of the new source, in order (default: every column of the main source and of each lookup without its key columns)
|
Responses
- 200 Normal response.
- 400 Bad request
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/sources/derived" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/sources/external
Creates an external source
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
name | string | Source name. Max 120 characters.
|
description | string | Source description. Max 300 characters.
|
url | string | External connection URL
|
features | array<object> | List of features to create
|
Responses
- 200 Normal response.
- 400 Bad request
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/sources/external" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/sources/real_time
Creates a real time source
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
name | string | Source name. Max 120 characters.
|
description | string | Source description. Max 300 characters.
|
max_age | number (int64) | Max age of registers in milliseconds. Set to 0 or negative for unlimited age. It can never be longer than the maximum age of the plan of the organization: a longer age (or 0) is shortened to it.
|
features | array<object> | List of features to create
|
Responses
- 200 Normal response.
- 400 Bad request
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/sources/real_time" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/sources/other
Creates other type of source. Including database sources or MQTT sources.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
name | string | Source name. Max 120 characters.
|
description | string | Source description. Max 300 characters.
|
type | string: file/any | url/any | s3 | ckan | database/mongo | database/mysql | database/influx | mqtt | |
encrypted | boolean | True to encrypt the data source
|
shuffled | boolean | True to shuffle instances
|
indexed | boolean | True to index the fields
|
dyn_enabled | boolean | Set to true to enable auto update
|
dyn_delay | number (int64) | Auto update delay (milliseconds). Min is 5 minutes.
|
dyn_replace | boolean | Set to true to replace the entire data set with each update. False to append the data.
|
dyn_pk | string | Name of the primary key field. In order to check for duplicates when appending.
|
dyn_update_mode | boolean | Set to true to update existing rows (by primary key). Set to false to skip duplicate rows. If you set dyn_replace to true. This option does not have any effect.
|
file | string | File (multipart/form-data) for file/any (required)
|
file_name | string | Name of the uploaded file
|
separator | string | Separator character for csv files
|
quotes | string | Quotes character for csv files
|
csv_header | boolean | Set to false if the csv files does not have a header.
|
json_fields | array<string> | List of fileds to get, in order, for json files or mongo databases.
|
json_prefix | string | Prefix to tell the engine where the data is in the JSON file. Use dots to split levels.
|
json_mode | string: single | default | Set to single in case there is a single instance in the JSON
|
date_format | string | Date format in the CSV of JSON file. By default is the ISO format. This uses the Moment.js formats.
|
url | string | URL for url/any and ckan source types. In case of S3. This is the URI of the object inside the bucket. For mongo and influx, this is the connection URL.
|
parser | string: auto | csv | json | jsonl | parquet | xlsx | ods | sqlite | File format: 'auto' (or empty) detects it from its content, content type and name; or one of csv, json, jsonl (JSON Lines), parquet, xlsx (Excel, also XLS), ods, sqlite. Share links of Google Sheets, Google Drive, OneDrive, SharePoint and Dropbox are downloaded as the file they point to.
|
sheet | string | Sheet of a spreadsheet (xlsx, ods, Google Sheets) to read, by the name on its tab. Empty: the first one.
|
http_headers | string | Custom headers to send
|
rejectUnauthorized | boolean | Set to false to ignore invalid certificates: of the HTTPS server (url/any), or of a Microsoft SQL Server (database/mysql with db = ms, for a self-signed certificate). Default true.
|
sdp_enabled | boolean | Set to true to enable stored data parameter in the Query. Any instances of ${SDP} will be replaced.
|
sdp_name | string | Name of the field to use for SDP
|
sdp_dir | string: desc | asc | Sorting direction to calc the SDP
|
database | string | Name of the database or the S3 bucket.
|
user | string | User / Access key ID
|
password | string | Password / Secret key
|
table | string | Name of the table / collection
|
query | string | Database Query. For mongo, this is a JSON.
|
sort | string | For MongoDB. Sorting
|
project | string | MongoDB project.
|
limit | number (int32) | Limit of results
|
db | string: mysql | pg | oracle | ms | Database type (for relational)
|
host | string | Database host. For Microsoft SQL Server (db = ms) it can also be server\INSTANCE (a named instance, found through the SQL Server Browser), server,port or tcp:server,port.
|
port | number (int32) | Port number
|
topics | string | For MQTT, list of topics split by commas.
|
fields_expected | array<object> | List of expected fields for MQTT
|
Responses
- 200 Normal response.
- 400 Bad request
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/sources/other" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/source/{sourceId}
Obtains information about a source
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Autentication token
|
catalog | query | string: true | false | true: adds catalog, the catalogue of the source as GET .../catalog gives it (only to a member who can read the sources). Without it the answer is the same as always.
|
Responses
- 200 Normal response.
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/source/{sourceId}
Sets the name and description of the source
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
name | string | Source name (max 120 characters)
|
description | string | Source description (max 300 characters)
|
Responses
- 200 Normal response.
- 400 Bad request
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
DELETE /api/v1/workspace/{workspaceId}/source/{sourceId}
Deletes the data source
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Autentication token
|
Responses
- 200 Normal response.
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X DELETE "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/source/{sourceId}/dependents
Dependency map of a source: what is built from it, to check before editing or deleting it.
derived: its derived sources as a tree (how: filter, join, merge, extend (melt), aggregate, or model for the predictions of a model applied to it), followed down to 6 levels; deeper counts the sources one level beyond.
models, visualizations and alerts: those built on the source or on one of its derived sources (direct is false for the latter, and source says which).
dashboards: those that show one of those visualizations, a widget of one of those models, or use the source or a derived source in a monitor, a filter or a variable input (via).
Each kind lists up to 50 items, direct ones first; more counts the rest and partial marks a count cut by a safety limit. Groups the user of the token cannot read in the workspace (read_sources, read_models, read_views, read_dashboards) keep their count, with hidden: true and no items. A public source does not make its map public: the token is always required.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Autentication token
|
Responses
- 200 Normal response.
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/dependents" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/source/{sourceId}/connection
Gets external source connection URL
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Autentication token
|
Responses
- 200 Normal response.
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/connection" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/source/{sourceId}/connection
Sets the Connection for a external source
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
url | string | External connection URL
|
Responses
- 200 Normal response.
- 400 Bad request
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/connection" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/source/{sourceId}/real_time
Gets real time connection details and configuration
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Autentication token
|
Responses
- 200 Normal response.
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/real_time" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/source/{sourceId}/real_time
Updates real time configuration
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
max_age | number (int64) | Max age of registers in milliseconds. Set to 0 or negative for unlimited. It can never be longer than the maximum age of the plan of the organization: a longer age (or 0) is shortened to it.
|
regenerate_password | boolean | Set to true to regenerate the MQTT password. Use if it was compromised.
|
Responses
- 200 Normal response.
- 400 Bad request
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/real_time" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/source/{sourceId}/real_time_push
Inserts an instance in real time. Alternative to MQTT for slower inserts.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
data | array<string> | Array of data fields. This does not include the timestamp or the computed fields
|
Responses
- 200 Normal response.
- 400 Bad request
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/real_time_push" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/source/{sourceId}/real_time_clear
Clears instances of a real time source to fit into limits.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
from_time | number (int64) | Timestamp (Unix millis). Start of the clear range
|
to_time | number (int64) | Timestamp (Unix millis). End of the clear range
|
Responses
- 200 Normal response.
- 400 Bad request
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/real_time_clear" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/source/{sourceId}/autoupdate
Gets source auto update configuration
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Autentication token
|
Responses
- 200 Normal response.
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/autoupdate" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/source/{sourceId}/autoupdate
Sets the auto update configuration
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
dyn_enabled | boolean | Set to true to enable auto update
|
dyn_delay | number (int64) | Auto update delay (milliseconds). Min is 5 minutes.
|
dyn_replace | boolean | Set to true to replace the entire data set with each update. False to append the data.
|
dyn_pk | string | Name of the primary key field. In order to check for duplicates when appending.
|
dyn_update_mode | boolean | Set to true to update existing rows (by primary key). Set to false to skip duplicate rows. If you set dyn_replace to true. This option does not have any effect.
|
separator | string | Separator character for csv files
|
quotes | string | Quotes character for csv files
|
csv_header | boolean | Set to false if the csv files does not have a header.
|
json_fields | array<string> | List of fileds to get, in order, for json files or mongo databases.
|
json_prefix | string | Prefix to tell the engine where the data is in the JSON file. Use dots to split levels.
|
json_mode | string: single | default | Set to single in case there is a single instance in the JSON
|
date_format | string | Date format in the CSV of JSON file. By default is the ISO format. This uses the Moment.js formats.
|
url | string | URL for url/any and ckan source types. In case of S3. This is the URI of the object inside the bucket. For mongo and influx, this is the connection URL.
|
parser | string: auto | csv | json | jsonl | parquet | xlsx | ods | sqlite | File format: 'auto' (or empty) detects it from its content, content type and name; or one of csv, json, jsonl (JSON Lines), parquet, xlsx (Excel, also XLS), ods, sqlite. Share links of Google Sheets, Google Drive, OneDrive, SharePoint and Dropbox are downloaded as the file they point to.
|
sheet | string | Sheet of a spreadsheet (xlsx, ods, Google Sheets) to read, by the name on its tab. Empty: the first one.
|
http_headers | string | Custom headers to send
|
rejectUnauthorized | boolean | Set to false to ignore invalid certificates: of the HTTPS server (url/any), or of a Microsoft SQL Server (database/mysql with db = ms, for a self-signed certificate). Default true.
|
sdp_enabled | boolean | Set to true to enable stored data parameter in the Query. Any instances of ${SDP} will be replaced.
|
sdp_name | string | Name of the field to use for SDP
|
sdp_dir | string: desc | asc | Sorting direction to calc the SDP
|
database | string | Name of the database or the S3 bucket.
|
user | string | User / Access key ID
|
password | string | Password / Secret key
|
table | string | Name of the table / collection
|
query | string | Database Query. For mongo, this is a JSON.
|
sort | string | For MongoDB. Sorting
|
project | string | MongoDB project.
|
limit | number (int32) | Limit of results
|
db | string: mysql | pg | oracle | ms | Database type (for relational)
|
host | string | Database host. For Microsoft SQL Server (db = ms) it can also be server\INSTANCE (a named instance, found through the SQL Server Browser), server,port or tcp:server,port.
|
port | number (int32) | Port number
|
topics | string | For MQTT, list of topics split by commas.
|
fields_expected | array<object> | List of expected fields for MQTT
|
Responses
- 200 Normal response.
- 400 Bad request
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/autoupdate" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/source/{sourceId}/features
Transforms the source features. If you change the types, all the instances will be casted to the selected types.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
shuffled | boolean | True to add a hidden feature to shuffle instances
|
features | array<object> | List of features mapped to the previous features
|
Responses
- 200 Normal response.
- 400 Bad request
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/features" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/source/{sourceId}/analyze
Talk to your data: exact figures over ALL the rows of a source, computed by AIR-Core on the server (never by a language model). Counts, distinct values, sums, averages, minimums, maximums and medians, grouped by up to 2 fields (dates by hour, day, week, month, quarter or year in the time zone of the question), with filters, relative periods resolved on the server, top N, share of the total and comparison with the previous period or the same period a year before. Reads at most the rows of the installation limit (2,000,000 by default) for a limited time (25 s by default): read.partial says whether the figures cover only part of the rows. Changes nothing. Requires the read_sources permission. On the free plan it needs the organization's own AI key (403 TALK_PLAN_REQUIRED).
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
metric | string: count | count_distinct | sum | avg | min | max | median | What is computed. count (default) counts rows, or the non-empty values of field; sum, avg and median need a numeric field; min and max a numeric or date field.
|
field | string | integer | Field measured, by name or index.
|
group_by | array<string | integer | object> | Up to 2 fields to group by, by name or index, or as {field, bucket}. Date fields are grouped by bucket: hour, day, week (from Monday), month (default), quarter or year.
|
filters | array<object> | Conditions that must all hold: {field, op, value}. op: eq (default), not_eq, in (value is a list), gt, gte, lt, lte, cn, cni, sw, swi, ew, ewi or null. A category value written with other capitals or accents is matched to the value of the data, and the answer says so in notes.
|
where | object | Advanced filter (QueryTree, as in the queries of instances), combined with filters. left may also be a field name.
|
period | object | Period of a date field (by default, the first date field), resolved on the server in the time zone: a preset (today, yesterday, this_week, last_week, this_month, last_month, this_quarter, last_quarter, this_year, last_year, last_7_days, last_30_days, last_90_days, last_12_months or last_N_days, weeks, months or years; this_* runs up to now), last N units (the current one included), or from and to, both included (YYYY, YYYY-Qn, YYYY-MM, YYYY-MM-DD or YYYY-MM-DDTHH:mm).
|
compare | string: previous_period | previous_year | Compare with the previous period (of the same length; this_* with the same stretch of the previous unit) or with the same period a year before. Needs period. Adds previous, change and change_pct.
|
order | string: desc | asc | label | label_desc | desc: largest value first (default); asc; label: by name, or in date order (default when grouping by a date); label_desc.
|
limit | integer | Groups returned (top N). 50 by default; the maximum is the installation limit (200 by default).
|
timezone | string | IANA time zone of the question (UTC by default).
|
Responses
- 200 The figures as AIR-Core computed them. columns describes each position of rows: the group values (g0, g1; date groups as keys such as 2026-03, 2026-Q1, 2026-03-02 for the week of that Monday), value, and share, previous, change and change_pct when they apply. total has the value over all the rows that match; groups.other adds up the groups not returned (counts and sums). read says how many rows were read and whether the read was partial. explanation says how it was computed, in English.
- 400 Bad question: BAD_REQUEST, BAD_METRIC, BAD_FIELD (details.fields lists the fields), FIELD_REQUIRED, FIELD_NOT_NUMERIC, TOO_MANY_GROUPS, BAD_FILTER, BAD_PERIOD, DATE_FIELD_REQUIRED, DATE_FIELD_NOT_DATE, BAD_COMPARE, COMPARE_NEEDS_PERIOD, TOO_MANY_GROUP_VALUES or EMPTY_SOURCE, with a message.
- 401 Invalid authorization
- 403 No permission, or TALK_PLAN_REQUIRED: on the free plan it needs the organization's own AI key.
- 404 Workspace or source not found
- 429 Too many questions in a minute (TOO_MANY_REQUESTS).
- 503 SOURCE_UNAVAILABLE: the data could not be read now (an external source whose connector does not answer).
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/analyze" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/source/{sourceId}/instances
Queries the instances of a data source
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Autentication token
|
select | query | string | List of features (indexes to fetch). Do not set to get all the features.
|
where | query | string | Conditions to match (filter), as a JSON of QueryTree (see schemas for more information)
|
order_by | query | string | Sorting options. Must be the index of the feature to sort by and 'asc' or 'desc'.
|
offset | query | integer (int32) | Number of instances to skip (if you orderred them)
|
limit | query | integer (int32) | Max number of instances to fetch. Do not set or set to -1 to get all the instances.
|
Responses
- 200 Normal response.
- 400 Bad request
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/instances" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/source/{sourceId}/instances
Updates a data source.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
replace | boolean | True in order to replace the dataset with the provided data, false in order to append the provided data.
|
pk | string | Private key (optional) to use to orevent duplicates
|
date_format | string | Date formatting to use. ISO by default
|
data | array<array<string>> | Data to provide, as a matrix
|
Responses
- 200 Normal response.
- 400 Bad request
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/instances" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
DELETE /api/v1/workspace/{workspaceId}/source/{sourceId}/instances
Updates a data source.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Autentication token
|
where | query | string | Conditions to match (filter), as a JSON of QueryTree (see schemas for more information)
|
Responses
- 200 Normal response.
- 400 Bad request
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X DELETE "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/instances" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/external/source/update
Updates external source, in order to generate alerts al clear cache. You can include up to 100 instances to analize in the body.
Parameters
| Name | In | Type | Description |
|---|
x-public-key required | header | string | External source public key
|
x-secret-key required | header | string | External source secret key
|
Request body application/json
array<array<string | number | boolean>>
Responses
- 200 Normal response.
- 429 Busy. You will receive this response by trying to update with multiple requests in parallel.
Example
curl -X POST "https://app.air-core.io/api/v1/external/source/update" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/source/{sourceId}/catalog
The catalogue of a data source («Ficha»): what its data mean. The description, the person in charge (steward), tags and provenance (origin and update process written by people, the sources of the workspace it is obtained from, and what AIR-Core knows in computed: kind of origin, automatic updates, parent sources and model). Per field, in the order of the source: description, unit, kind of value (semantic_type), allowed values or range (informative) and its personal data, the one found and chosen in the AI governance (never changed here). ai_withheld lists the texts an AI would not receive because the detector of personal data finds some in them. An AI application connected through MCP (and the built-in assistant) gets it as an AI may see it: never the person in charge nor who saved it, the flagged texts empty and listed in withheld_for_ai, no allowed values nor ranges below the level «aggregates» of the AI data policy, and personal_data as not_sent, pseudonymised or allowed. Needs a token that reads workspaces and permission to read the sources.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Responses
- 200 The catalogue (empty values when the source has none)
- 401 Invalid authorization
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 404 Workspace or source not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/catalog" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
PUT /api/v1/workspace/{workspaceId}/source/{sourceId}/catalog
Changes the catalogue of a data source. Only the keys sent change: an empty text, null or an empty list clears a value, and null for a field clears its whole entry. fields is an object by field name or a list of entries with name or index. Unknown keys or fields, texts too long and kinds of value that do not exist are refused (400), never cut. provenance.derived_from names other sources of the same workspace. The data of the source and its personal data choices are not changed. Needs a token that writes workspaces and permission to edit the source (or to own it). Answers the catalogue as GET does.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Request body application/json
| Field | Type | Description |
|---|
description | string | |
steward | string | |
tags | array<string> | |
provenance | object | |
fields | object | array<SourceCatalogFieldChange> | By field name ({"importe": {...}}) or a list of entries with name or index ([{"index": 2, ...}])
|
Responses
- 200 The catalogue as it is left
- 400 BAD_REQUEST, UNKNOWN_KEY, UNKNOWN_FIELD (details.fields), BAD_FIELD_ENTRY, BAD_SEMANTIC_TYPE, BAD_RANGE, BAD_DESCRIPTION, BAD_UNIT, BAD_TAGS, BAD_STEWARD, BAD_ORIGIN, BAD_UPDATE_PROCESS, BAD_ALLOWED_VALUES, BAD_DERIVED_FROM or BAD_PROVENANCE
- 401 Invalid authorization
- 403 Access denied (ACCESS_DENIED: without permission to edit the source), or the AI data policy refuses it (AI_POLICY_*)
- 404 Workspace or source not found
Example
curl -X PUT "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/catalog" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/sources/join/suggest
Suggested keys to join a main data source with 1 to 5 other sources of the workspace (for a join of several sources, derived_type join_multi). For each lookup, up to 5 pairs of columns ordered by confidence: by names and types (the join the data advisor proposes, the same name), by the catalogue of both sources when it says something (the same kind of value helps; different kinds of value or units count against and are noted) and by the values in common measured on samples: overlap is the share of the first 1000 rows of the main source whose value is in the lookup (up to 30000 rows of it read, compared as the join compares keys), lookup_unique how unique the column is in the lookup (1: one row per key). suggested is the pair to start with, two pairs when one column alone repeats in the lookup and both together do not. For an AI application connected through MCP below the level «aggregates» of the AI data policy: by names, types and catalogue only, nothing read (measured false). Needs a token that reads workspaces and permission to read the sources.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Request body application/json
| Field | Type | Description |
|---|
main required | string | Identifier of the main source
|
lookups required | array<string> | Identifiers of the sources to join with it (the same one may repeat)
|
Responses
- 200 The suggested keys
- 400 BAD_REQUEST, NOT_FOUND (a source that is not in the workspace), EXTERNAL (external and real time sources cannot be joined) or TOO_MANY_SOURCES
- 401 Invalid authorization
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 404 Workspace not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/sources/join/suggest" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/source/{sourceId}/join-report
The report of the last run (creation or refresh) of a join of several sources (derived_type join_multi), and a short history of the earlier runs (the last 10 are kept). Per lookup: rows of the main source that found a row in it and that did not (unmatched, with unmatched_empty for empty keys, which never match), the match rate, up to 20 different example keys without a match, rows of the lookup read, keys kept, repeated keys (only the first row of a repeated key is used, rows are never multiplied) with examples, and keys no row used. The names of the sources are the ones they have now. For an AI application connected through MCP, the example keys of key columns with personal data the organization does not share with AI applications are left out (examples_withheld, duplicate_examples_withheld). Needs a token that reads workspaces and permission to read the sources.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the source made by the join
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Responses
- 200 The report
- 401 Invalid authorization
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 404 Workspace or source not found, or NOT_A_JOIN: the source is not a join of several sources
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/join-report" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/source/{sourceId}/recipe
The recipe of a prepared source («fuente preparada»): its origin (and the origin's columns), the steps (columns named by name), the columns they give, whether they still fit the origin as it is now (check: the first step that does not, and why), the version of the recipe, who changed it and when, and what each step did in the last recomputation (last_report; or the step that failed, when the prepared source kept its previous data). A prepared source is created with POST .../sources/derived (derived_type recipe) and recomputed each time its origin updates; the origin is never changed. An AI application connected through MCP gets the values written in steps about a column with personal data not sent in clear withheld (withheld: true on the step) and, below the level «aggregates» of the AI data policy, no counts of rows. Needs a token that reads workspaces and permission to read the sources.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the prepared source
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Responses
- 200 The recipe
- 401 Invalid authorization
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 404 Workspace or source not found, or NOT_A_RECIPE: the source is not prepared with a recipe
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/recipe" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/source/{sourceId}/recipe
Replaces the steps of a prepared source (the whole list, in order) and asks for its recomputation from its origin with them (it runs in the background within seconds). The steps are checked first against the columns of the origin as it is now: when one cannot be used nothing is saved and details says which (step from 0, code, column). The origin is not changed. Needs a token that writes workspaces and permission to edit the source (or to own it) and to run tasks. Answers the recipe as GET does.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the prepared source
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Request body application/json
| Field | Type | Description |
|---|
steps required | array<RecipeStep> | |
Responses
- 200 The recipe as it is left (recipe_version + 1, pending true)
- 400 RECIPE_STEPS_INVALID, RECIPE_TOO_MANY_STEPS, RECIPE_TOO_LONG, RECIPE_COLUMN_MISSING, RECIPE_COLUMN_EXISTS, RECIPE_STEP_TYPE, RECIPE_STEP_INVALID, RECIPE_EXPRESSION_INVALID (with details: step, op, code, column, message) or ORIGIN_MISSING
- 401 Invalid authorization
- 403 Access denied (ACCESS_DENIED: without permission to edit the source and run tasks), or the AI data policy refuses it (AI_POLICY_*)
- 404 Workspace or source not found, or NOT_A_RECIPE
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/recipe" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/source/{sourceId}/recipe/preview
Tries some steps over the first rows of a source (the origin of a recipe) without saving anything: for each step the columns, the rows in and out, the cells changed (or rows removed), the values left empty and the first resulting rows; error is the first step that cannot be used (the steps before it are given). The first steps, when they are filters, are applied by the storage when the rows are read. Regular expressions run with a time limit (RECIPE_REGEX_TIMEOUT in error). For an AI application connected through MCP: only when the AI data policy lets rows go, each column protected as the strictest rule of the columns of the origin it comes from, and refused (AI_POLICY_PERSONAL_DATA) when a filter, a cleaning of only some rows or a removal of duplicates uses a column with personal data not sent in clear. Needs a token that reads workspaces and permission to read the sources.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the origin source
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Request body application/json
| Field | Type | Description |
|---|
steps | array<RecipeStep> | |
sample | integer | Rows of the origin read (default 200, at most 500)
|
rows | integer | Rows given after each step (default 10, at most 50)
|
Responses
- 200 The preview
- 400 RECIPE_STEPS_INVALID, RECIPE_TOO_MANY_STEPS, RECIPE_TOO_LONG or EXTERNAL (external and real-time sources cannot be prepared)
- 401 Invalid authorization
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 404 Workspace or source not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/recipe/preview" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/text-analysis
«Analizar textos»: what the AI module of this installation offers for texts (available; the tasks, languages, summaries and topics it advertises: gimodeler 0.21, methods.text-annotate, text-summarize, text-topics; with an older AI module everything is unavailable and nothing else changes), the caps of the plan of the organization (limits: texts per analysis, analyses per month, re-application when the data change, entities, topics over time, most topics, own classifiers, texts generative AI labels in one run; -1 = no limit), what it used this month (usage) and whether the labels with generative AI can be used (labels.code GENAI_PLAN_REQUIRED: a paid plan, AI credit or the organization's own AI key). Needs a token that reads workspaces and permission to read the sources.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Responses
- 200 What can be used and the caps of the plan
- 401 Invalid authorization
- 403 Access denied
- 404 Workspace not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/text-analysis" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/source/{sourceId}/text-analysis
The analysis of texts of a source made with POST .../sources/derived (derived_type text_analysis): its origin and column, the tasks, the language, the column of dates, its topics model and text classifiers, the columns it writes, the last run (last_report), whether a run is waiting or running, whether the origin changed and the plan does not apply it by itself (stale), the caps of the plan and the «Resumen del análisis» (overview: texts analysed and skipped by the cap of the plan, languages, sentiment and its evolution by period, keywords, entities, people, topics with their words, share and examples, labels of each classifier, examples of each sentiment, notes). For any other source: analysis: null, whether it can be analysed (can_create) and its columns (text: a column that can be analysed). For an AI application connected through MCP: the figures, keywords, entities and topics (aggregates); the examples and the people only when the AI data policy lets rows go and the analysed column has no personal data held back; at the level «structure», only the settings. Needs a token that reads workspaces and permission to read the sources.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the source
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Responses
- 200 The analysis, or what can be analysed in the source
- 401 Invalid authorization
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 404 Workspace or source not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/text-analysis" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/source/{sourceId}/text-analysis/reanalyze
«Volver a analizar»: asks for a new run of an analysis of texts now (within seconds, in the background), with the rows its origin has now. It counts as an analysis of the month (TEXT_ANALYSIS_LIMIT, 403, when the plan's are used up). Needs a token that writes workspaces and permission to edit the source (or to own it) and to run tasks. Answers the analysis as GET does (pending true).
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the analysis source
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Responses
- 200 {result: success, analysis, can_edit}
- 400 NOT_A_TEXT_ANALYSIS
- 401 Invalid authorization
- 403 ACCESS_DENIED, TEXT_ANALYSIS_LIMIT (the analyses of the month of the plan are used; details.offer upgrade) or the AI data policy (AI_POLICY_*)
- 404 Workspace or source not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/text-analysis/reanalyze" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/source/{sourceId}/text-analysis/preview
The analysis of the first rows of a source (at most 20) without writing or counting anything: for each text its language, sentiment (label, value written in the column, score), keywords and entities (entities only when the plan includes them). plan says how many texts a whole analysis would read and whether the cap of the plan would stop it. For an AI application connected through MCP: only when the AI data policy lets rows go, and refused (AI_POLICY_PERSONAL_DATA) when the column has personal data not sent in clear. Needs a token that reads workspaces and permission to read the sources.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the source
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Request body application/json
| Field | Type | Description |
|---|
column required | string | Name of the column of texts (text or nominal)
|
tasks | array<string: language | sentiment | keywords | entities | topics> | Default language, sentiment, keywords; topics are found over every text when the analysis runs, never in a preview
|
language | string | auto (default) or es, en, ca, de, fr, it, pt, ja, zh
|
keywords_top | integer | |
rows | integer | |
Responses
- 200 The preview
- 400 TEXT_COLUMN_MISSING, TEXT_TASKS_INVALID, TEXT_LANGUAGE_INVALID, EXTERNAL or an error of the AI module (TEXT_ENGINE_BAD_REQUEST)
- 401 Invalid authorization
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 404 Workspace or source not found
- 503 TEXT_ENGINE_OUTDATED (the AI module cannot analyse texts) or TEXT_ENGINE_UNAVAILABLE
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/text-analysis/preview" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/source/{sourceId}/text-analysis/summarize
The sentences that best sum up a group of texts of a source (extractive: sentences of the texts themselves, chosen by the AI module with TextRank; no generative AI): the texts of a sentiment, a topic or a keyword of an analysis of texts, or of a value of a column; at most max_texts texts (the first ones). For an AI application connected through MCP: only when the AI data policy lets rows go, and refused (AI_POLICY_PERSONAL_DATA) when the column (in the source or in the origin of the analysis) has personal data not sent in clear. Needs a token that reads workspaces and permission to read the sources.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the source (an analysis of texts
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Request body application/json
| Field | Type | Description |
|---|
column | string | Name of the column of texts (default: the analysed one)
|
group | object | Which texts (none: the first ones of the source)
|
sentences | integer | Default 3
|
max_texts | integer | Default 200
|
language | string | auto (the most frequent language of the texts) or a code
|
Responses
- 200 {column, group, texts (texts read), sentences: [{text, score}]}
- 400 TEXT_COLUMN_MISSING, TEXT_GROUP_INVALID (the source has no column for that group), EXTERNAL
- 401 Invalid authorization
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 404 Workspace or source not found
- 503 TEXT_ENGINE_OUTDATED (the AI module cannot summarize texts) or TEXT_ENGINE_UNAVAILABLE
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/text-analysis/summarize" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/source/{sourceId}/rows
Rows of a data source with their row ids (ids, parallel to instances), to edit them in place. For an AI application connected through MCP, rows only when the AI data policy of the organization allows them, with the personal data protected. The routes of /instances do not change.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
where | query | string | Filter, as a JSON of QueryTree (filter is accepted too)
|
order_by | query | string | Index of the feature to sort by and 'asc' or 'desc'
|
select | query | string | Indexes of the features to return (all by default)
|
offset | query | integer (int32) | Rows to skip
|
limit | query | integer (int32) | Rows to return (default 100, at most 500)
|
Responses
- 200 The rows
- 400 INVALID_FILTER
- 401 Invalid authorization
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 404 Not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/rows" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/source/{sourceId}/rows
Edits rows in place, as a spreadsheet: an ordered list of operations (set a cell, insert rows, delete rows by row id), all or nothing, at most 1000 operations or rows. Calculated columns are computed again when their expression only reads values of the row. Needs a token that writes workspaces and permission to edit the source (or to own it) and to run tasks.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Request body application/json
| Field | Type | Description |
|---|
ops required | array<object> | |
Responses
- 200 Applied ({result: success, applied, inserted: {tempId: rid}, missing, counts, version, instances, calculated?}), or refused with result error and code VALUE, UNIQUE, OPS_LIMIT, LIMIT or STORAGE_OLD
- 400 OPS (malformed) or NOT_EDITABLE
- 403 Access denied
- 409 BUSY: a task or another edit has the source
- 504 TIMEOUT: nothing was changed
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/rows" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/source/{sourceId}/columns/{feature}/transform
Cleans a column in place (all rows, or those of the filter). With dry_run, only how many cells would change and a sample before and after (nothing is written). The version before the cleaning is kept for 24 hours (it counts in the size of the organization meanwhile) and undo restores it. Operations by type of column: text trim {collapse}, lower, upper, capitalize, replace {find, replace, mode contains|exact, case}, regex_replace {pattern (at most 500 characters), replace, case}, prefix|suffix {text}, fill_empty {value}, to_null {value}, merge_values {values: [{from, to}]} (each cell that is exactly from, same case and spaces, becomes to: the merge of the groups of GET .../columns/{feature}/variants, at most 500 pairs; no to may also be a from; it is one operation with one undo, its preview counts the rows of each value); numbers round {decimals 0-10}, multiply|add {value}, clip {min, max}, abs, fill_empty {value}; dates shift {ms}, fill_empty {value}; booleans invert, fill_empty {value}.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
feature required | path | integer | Index of the column
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Request body application/json
| Field | Type | Description |
|---|
op required | string: trim | lower | upper | capitalize | replace | regex_replace | prefix | suffix | |
args | object | Arguments of the operation
|
filter | QueryTree | Tree used to describe a query. Used in order to query instances of data sources.
|
dry_run | boolean | Only the preview: {changed, sample: [{rid, before, after}]} (at most 20)
|
Responses
- 200 {result: success, changed, version, instances, undo, calculated?} (with dry_run: {dry_run: true, changed, sample}); refused with result error and code STORAGE_OLD, VALUE, UNIQUE or LIMIT
- 400 FEATURE, OP, ARGS, INVALID_FILTER, FILTER, UNSUPPORTED or NOT_EDITABLE
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 409 BUSY
- 504 TIMEOUT
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/columns/<feature>/transform" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/source/{sourceId}/columns/{feature}/profile
Profile of a column computed by the storage over every row (or those of the filter): rows, nulls, empty texts, distinct values, the 10 most frequent values and min, max and average (numbers; min and max of dates). With duplicates, also how many rows repeat an earlier row (what dedupe would delete).
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
feature required | path | integer | Index of the column
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
where | query | string | Filter, as a JSON of QueryTree
|
duplicates | query | string | 'all' (whole rows) or a JSON list of feature indexes
|
Responses
- 200 The profile
- 400 FEATURE, INVALID_FILTER or UNSUPPORTED (external and real-time sources)
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 404 Not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/columns/<feature>/profile" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/source/{sourceId}/columns/{feature}/variants
«Agrupar variantes», without AI and without credits (free plan too): groups of values of a text column (nominal or text) that are the same thing written differently («Madrid», «madrid », «Mádrid», «Madriz»; «C/ Mayor» and «Calle Mayor»). Values are normalised (case, accents, spaces, punctuation and, with abbreviations, a small list of abbreviations) and compared with a similarity (the mean of Jaro-Winkler and the normalised Levenshtein similarity; texts whose numbers differ never match; texts shorter than 4 characters only match when equal). It works on the DISTINCT values of the column with their counts: the storage says how many there are (distinct, column_profile); up to 200 it counts every one of them (method: histogram, no row is read); with more, only this column is read by streaming (method: stream) up to the rows of the plan (200,000 free, 1,000,000 paid, 2,000,000 without limits; estimated only when not every row was read) and the most frequent values are compared, up to the cap of the plan (2,000 free, 10,000 paid, 20,000 without limits; truncated when the column has more: values of distinct). Each group has its proposed canonical value (the most frequent), its values with their rows and similarity to it, and suggested for those proposed for the merge. merge_args are the arguments of POST .../columns/{feature}/transform with op merge_values that merges the suggested values. For an AI application connected through MCP: refused (AI_POLICY_PERSONAL_DATA) on a column, or with a filter, with personal data it may not see.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
feature required | path | integer | Index of the column (nominal or text)
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
threshold | query | number | Least similarity to group, from 0.5 to 1 (default 0.85; 1 = only the same normalised form)
|
abbreviations | query | boolean | Expand the small list of abbreviations (c/, avda., pza., ctra., ayto., sta.…) before comparing (default true)
|
where | query | string | Filter, as a JSON of QueryTree
|
Responses
- 200 The groups of variants
- 400 FEATURE, TYPE (not a text column), ARGS, INVALID_FILTER, UNSUPPORTED (external and real-time sources) or STORAGE_OLD
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 404 Not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/columns/<feature>/variants" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/source/{sourceId}/near-duplicates
«Filas casi duplicadas», without AI and without credits (free plan too): clusters of rows that are almost the same in some columns (the same customer with small differences). Each row is the set of the character 3-grams of the normalised values of those columns (tagged with their column); MinHash with 64 hash functions of fixed seeds (the same answer every time) and LSH banding tuned to the threshold find the candidate pairs, kept when the exact Jaccard similarity of their 3-grams reaches the threshold; every row of a cluster is at the threshold of its first row (a chain ABC with A and C apart does not put C with A). Rows are read in pages with their ids from the first one, up to the cap of the plan (10,000 rows free, 100,000 paid, 200,000 without limits) or max_rows, and for 25 seconds at most: estimated (and stopped: cap or time) when not every row was read. Each cluster has its rows (row id, cells of the compared columns, differs: positions of the cells that differ from the first row, similarity to it) and a QueryTree filter that shows them in a table (null when too long). Nothing is deleted: remove the extra rows with POST .../rows (delete by row id), kept in the version history. For an AI application connected through MCP: rows (the policy must let rows go), refused over columns with personal data it may not see.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
features | query | string | Indexes of the columns compared, separated by commas or as a JSON list (default: every column that is not calculated, up to 20)
|
threshold | query | number | Least estimated Jaccard similarity, from 0.5 to 1 (default 0.8)
|
abbreviations | query | boolean | Expand the small list of abbreviations before comparing (default true)
|
max_rows | query | integer | Rows to read at most (never more than the cap of the plan)
|
Responses
- 200 The clusters of near-duplicate rows
- 400 FEATURE, ARGS, UNSUPPORTED (external and real-time sources) or STORAGE_OLD
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 404 Not found
- 429 BUSY: other searches of near duplicates are running
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/near-duplicates" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/source/{sourceId}/dedupe
Removes the rows that repeat the values of some features (whole rows when none are given; nulls equal), keeping the first or the last of each group. With dry_run, only how many rows it would delete. The version before is kept for 24 hours and undo restores it.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Request body application/json
| Field | Type | Description |
|---|
features | array<integer> | |
keep | string: first | last | |
dry_run | boolean | |
Responses
- 200 {result: success, deleted, version, instances, undo} (with dry_run: {dry_run: true, deleted}); refused with result error and code STORAGE_OLD or LIMIT
- 400 FEATURE, ARGS, UNSUPPORTED (CrateDB sources) or NOT_EDITABLE
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 409 BUSY
- 504 TIMEOUT
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/dedupe" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/source/{sourceId}/undo
Undoes the last cleaning of a column or removal of duplicates: puts back the version kept before it, within 24 hours and while nothing else changed the source (UNDO_GONE otherwise). The current version is deleted.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Responses
- 200 {result: success, version, instances, undone}
- 403 Access denied
- 409 UNDO_GONE or BUSY
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/undo" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/source/{sourceId}/detach
Turns a derived source (filter, join, merge, extend, aggregate, the predictions of a model, a forecast) into an independent stored source: the data stays, its update configuration stops being derived and its parents no longer refresh it. Needs permission to edit the source (or to own it).
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Responses
- 200 {result: success, update_effect: none, detached: {at, derived_type, derived_from, derived_from2, model}}
- 400 NOT_DERIVED
- 403 Access denied
- 409 BUSY
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/detach" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/source/{sourceId}/versions
The version history of the data of the source, the newest first: who made each version, when and how (kind: import, update, delete_rows, update_rows, columns, edit, clean, dedupe, restore, previous), its rows and size, and whether its data is kept (restorable). policy says what the organization keeps: keep (previous versions, 0 = no history), max (of its plan), auto_hours (versions kept for sources that update by themselves; 0 = no limit) and stored (false for sources in a CrateDB database: the history records who and when but keeps no data). Kept versions count in the size of the organization. Needs to read the sources of the workspace.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Responses
- 200 {result: success, policy: {keep, max, auto_hours, stored}, kept_size, held_size, held_over_limit, versions: [{version, created, current, restorable, kind, task, authors: [{uid, name}], counts, note, size, instances, held_by, held_names}]}. A version something still needs (a model learned from it, a version of a model, a comparison of methods, a training running) is never deleted: held_by says how many models need it and held_names names them (the first five); it is kept, restorable and counted in held_size whatever the history keeps, and goes away by itself when nothing needs it. held_over_limit: the organization is over its size limit only because of those versions (updates of the data still work).
- 403 Access denied
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/versions" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/source/{sourceId}/versions/{version}/restore
Restores a kept version of the source: a new version that is a copy of it (its rows and its columns), added to the history as kind restore; nothing is rewritten and the version before stays in the history. Same permission, limits and lock as an edit of the rows (permission to edit the source or to own it, and to run tasks).
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
version required | path | integer | The version to restore, as the history gives it
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Responses
- 200 {result: success, version, instances, restored}
- 400 VERSION or NOT_EDITABLE
- 403 Access denied, or LIMIT
- 409 VERSION_GONE (the version is not kept) or BUSY
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/versions/<version>/restore" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/sql/tables
The tables a read-only SQL query can read in a workspace: one per data source, named after it (lower case, no accents, _ between words, unique), with its columns (name as SQL sees it, sql as a query writes it, the field it comes from and its type); the caps of the plan of the organization; and the functions a query may call. Reads no rows. For people with a token that reads workspaces and permission to read the sources of the workspace; AI applications connected through MCP, MCP clients and the assistant get 403 SQL_NOT_FOR_AI_APPS.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Responses
- 200 The tables, the caps and the functions
- 401 Invalid authorization
- 403 ACCESS_DENIED (the token does not read workspaces) or SQL_NOT_FOR_AI_APPS
- 404 Workspace not found, or no permission to read its sources
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/sql/tables" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/sql
Runs a read-only SQL query (SQLite dialect) over one or several data sources of the workspace and answers a page of its result, or the whole result as CSV with format: csv. One statement that starts with SELECT, WITH or VALUES; never ATTACH, PRAGMA, writes, extensions, the internals of SQLite, parameters or functions outside the allowed list (see GET .../sql/tables). The tables are the ones of GET .../sql/tables; sources gives a source of this workspace another table name (a source of another workspace or organization is refused, SQL_UNKNOWN_SOURCE, without reading it). Only the tables and columns the query names are read, up to the caps of the plan: a read cut by a cap says so in read.partial. The query runs in a process of its own, stopped at the time or memory limit of the plan (SQL_TIMEOUT, SQL_MEMORY_LIMIT). One query at a time per person. For people with a token that reads workspaces and permission to read the sources of the workspace (the same rows and columns they see on the page of each source); AI applications connected through MCP, MCP clients and the assistant get 403 SQL_NOT_FOR_AI_APPS.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Request body application/json
| Field | Type | Description |
|---|
sql required | string | The query (at most 20000 characters)
|
sources | object | array<object> | Optional table names of your own for sources of this workspace: {alias: sourceId} or [{alias, source}] (letters, digits and _, not a keyword, at most 20)
|
offset | integer | Rows of the result to skip (default 0)
|
limit | integer | Rows of the page (default 100, at most max_page_rows of the plan)
|
format | string: json | csv | csv: the whole result as a CSV file
|
Responses
- 200 A page of the result (JSON), or the whole result as CSV (UTF-8 with a byte order mark, at most `max_result_rows` of the plan) with format csv
- 400 The query is refused or fails, with its place in the text when known: SQL_EMPTY, SQL_TOO_LONG, SQL_SYNTAX, SQL_MULTIPLE_STATEMENTS, SQL_NOT_A_QUERY, SQL_NOT_READ_ONLY, SQL_FORBIDDEN_STATEMENT, SQL_FORBIDDEN_NAME, SQL_FUNCTION_NOT_ALLOWED, SQL_PARAMETERS, SQL_UNKNOWN_TABLE, SQL_UNKNOWN_COLUMN, SQL_UNKNOWN_FUNCTION, SQL_ERROR, SQL_BAD_ALIAS, SQL_BAD_SOURCES, SQL_TOO_MANY_SOURCES, SQL_TOO_MANY_COLUMNS, SQL_TIMEOUT or SQL_MEMORY_LIMIT
- 401 Invalid authorization
- 403 ACCESS_DENIED (the token does not read workspaces) or SQL_NOT_FOR_AI_APPS
- 404 Workspace not found, no permission to read its sources, or SQL_UNKNOWN_SOURCE (an alias names a source that is not in this workspace)
- 429 SQL_BUSY (a query of the same person, or too many of the server, are running) or TOO_MANY_REQUESTS (30 queries per minute)
- 503 SOURCE_UNAVAILABLE: the data of a table could not be read right now
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/sql" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/sql/source
Saves a read-only SQL query as a new derived data source (type sql) that is computed again whenever one of the sources it reads changes. The query is checked and prepared (its columns are known without reading any row); every table must be a stored source of the workspace and their rows must fit the cap of the plan, because a saved query reads them whole. Each run checks again that its owner can read the sources of the workspace, the query, the caps of the current plan and its columns. Answers the task that creates the source. Needs a token that writes workspaces, permission to read the sources and to create sources and tasks; AI applications connected through MCP, MCP clients and the assistant get 403 SQL_NOT_FOR_AI_APPS.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Request body application/json
| Field | Type | Description |
|---|
sql required | string | The query (see SqlQuery)
|
sources | object | array<object> | Optional table names of your own for sources of this workspace, as in SqlQuery; they are kept with the saved query
|
name required | string | Name of the new source (1 to 120 characters)
|
description | string | At most 300 characters
|
Responses
- 200 The task that creates the source
- 400 BAD_NAME, BAD_DESCRIPTION, SQL_NO_TABLES, EXTERNAL, SQL_TOO_MANY_ROWS or any refusal of the query (see POST .../sql)
- 401 Invalid authorization
- 403 ACCESS_DENIED (the token does not write workspaces, or no permission to create sources and tasks), LIMIT (plan) or SQL_NOT_FOR_AI_APPS
- 404 Workspace not found, no permission to read its sources, or SQL_UNKNOWN_SOURCE
- 429 SQL_BUSY or TOO_MANY_REQUESTS
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/sql/source" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/source/{sourceId}/quality/rules
The data quality rules of a source («Calidad»): per column (not_empty, unique, range, allowed_values, pattern, not_future) or on the source (row_count, freshness), each with its severity (warning or error) and whether it is enabled. A rule names its field by name; index is its position now (-1 and missing: true when the field is gone: the rule then fails). With suggestions=true, the rules AIR-Core suggests from the catalogue of the source, the statistics of its columns, the names of the columns and its automatic updates, each with its reason (nothing is saved until they are sent with PUT). An AI application connected through MCP gets the rules without the values they hold (allowed values, bounds, the text of a pattern) below the level «aggregates» of the AI data policy, or for a field with personal data not allowed (withheld_for_ai). Needs a token that reads workspaces and permission to read the sources.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
suggestions | query | string: true | false | true: adds the suggested rules
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Responses
- 200 The rules
- 401 Invalid authorization
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 404 Workspace or source not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/quality/rules" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
PUT /api/v1/workspace/{workspaceId}/source/{sourceId}/quality/rules
Replaces the quality rules of a source with the list sent (an empty list removes them) and checks them now: the answer waits up to 20 seconds for the check (checking: true when it goes on in the background). A rule keeps its id when it sends one of the current list (its history and its alerts follow it); the other ones get a new id. Up to 30 rules. Refused (400), never cut: an unknown kind, key or parameter, a field that does not exist or of a type the kind does not apply to, invalid parameters or a repeated rule. alert turns the quality alert of the source on or off, with a threshold of the score (needs permission to edit the workspace). External and real-time sources cannot have rules (UNSUPPORTED_SOURCE). Needs a token that writes workspaces and permission to edit the source (or to own it). Answers the report as GET .../quality does.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Request body application/json
| Field | Type | Description |
|---|
rules | array<QualityRule> | The whole list: it replaces the current one
|
check | boolean | Check them now (default true)
|
alert | object | The quality alert of the source: on or off, and the score under which it also fires (0: only when a rule breaks)
|
Responses
- 200 The report of the source with its new rules
- 400 BAD_REQUEST, TOO_MANY_RULES, UNKNOWN_KEY, UNKNOWN_KIND, UNKNOWN_FIELD, FIELD_TYPE, BAD_SEVERITY, BAD_PARAMS, DUPLICATE_RULE (details.rule: its position), BAD_THRESHOLD or UNSUPPORTED_SOURCE
- 401 Invalid authorization
- 403 Access denied (ACCESS_DENIED: without permission to edit the source, or the workspace for `alert`), or the AI data policy refuses it (AI_POLICY_*)
- 404 Workspace or source not found
Example
curl -X PUT "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/quality/rules" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/source/{sourceId}/quality
The quality report of a source: its rules, the last check (when, why, the score from 0 to 100 and its status, the rows, and per rule its status pass, fail or unknown with the rows that break it, their share, whether the count is an estimate and some failing values for patterns and unique values), whether the data changed after it (stale; the watcher checks them again after each update) and the history of the score. Rules never checked yet are checked now. Score: each rule weighs 3 (error) or 1 (warning); a rule that passes counts fully, one on rows that fails counts at most half its weight, less the more rows break it (0.5 × (1 − share)), one on the source that fails or whose field is gone counts nothing; rules that could not be checked are left out; score = round(100 × Σ weight × value / Σ weight). Every rule is counted by the storage over all the rows (one scan for all of them); a pattern the storage cannot test (a preset or a regular expression) is checked on a sample of up to 2000 non-empty values spread over the source, and its count is an estimate unless the sample held them all. An AI application connected through MCP needs the level «aggregates» and gets the failing values only when rows may go, never the filter of the failing rows. Needs a token that reads workspaces and permission to read the sources.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Responses
- 200 The report (report null when there are no rules)
- 401 Invalid authorization
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 404 Workspace or source not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/quality" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/source/{sourceId}/quality/check
Checks the quality rules of a source now (the answer waits up to 20 seconds; checking: true when the check goes on in the background). Asked again within 15 seconds with nothing changed, it answers the last check. Needs a token that writes workspaces and permission to edit the source (or to own it). Answers the report as GET .../quality does.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
sourceId required | path | string | Identifier of the data source
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Responses
- 200 The report
- 400 UNSUPPORTED_SOURCE (external and real-time sources)
- 401 Invalid authorization
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 404 Workspace or source not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/source/<sourceId>/quality/check" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/quality
The quality score of each source of a workspace that has rules: score (null before its first check), status (ok, warning, error, unknown, or pending before its first check), when it was checked and how many rules it has. Needs a token that reads workspaces and permission to read the sources.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Responses
- 200 The scores, by source id
- 401 Invalid authorization
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 404 Workspace not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/quality" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
metrics
Metrics API. The metric dictionary of a workspace (each metric defined once), their values with why they changed, unusual values, targets, alerts and the briefing of the metrics each person follows.
GET /api/v1/workspace/{workspaceId}/metrics
The metric dictionary of the workspace (its semantic layer): each metric with its exact calculation, whether the user follows it and its last value. Needs read_sources.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Autentication token
|
Responses
- 200 The metrics
- 401 Invalid authorization
- 403 The token or the user lacks the permission (ACCESS_DENIED), or a limit (LIMIT)
- 404 Workspace, metric or its source not found (NOT_FOUND, SOURCE_NOT_FOUND)
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/metrics" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/metrics
Creates a metric, checked against its source (fields that exist, numbers for sums and averages; category values are matched as the data write them and noted in notes). Needs view_create and a token that can write. Each change keeps a version.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
name required | string | |
description | string | |
source required | string | |
definition | MetricDefinition | The calculation of a metric: a question of the engine of «Habla con tus datos», with the fields by name.
|
date_field | string | |
period | string: day | week | month | quarter | year | |
bucket | string: hour | day | week | month | |
unit | string | |
format | string: number | integer | currency | percent | |
decimals | integer | |
direction | string: up | down | none | up: more is better; down: more is worse
|
synonyms | array<string> | |
dimensions | array<string> | |
forecast | string | Model of «Predict the future»
|
sensitivity | string: low | medium | high | |
owner | string | |
Responses
- 200 The metric created
- 400 The definition does not run on the source (BAD_FIELD, FIELD_NOT_NUMERIC, BAD_METRIC, BAD_FILTER, DATE_FIELD_NOT_DATE, BAD_DIMENSION)
- 401 Invalid authorization
- 403 The token or the user lacks the permission (ACCESS_DENIED), or a limit (LIMIT)
- 404 Workspace, metric or its source not found (NOT_FOUND, SOURCE_NOT_FOUND)
- 409 A metric with that name exists (NAME_TAKEN)
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/metrics" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/metrics/suggestions
Metrics the sources of the workspace suggest from their fields, without AI (the number of records, totals of amounts, averages of levels).
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Autentication token
|
source | query | string | Only this source
|
Responses
- 200 The suggestions
- 401 Invalid authorization
- 403 The token or the user lacks the permission (ACCESS_DENIED), or a limit (LIMIT)
- 404 Workspace, metric or its source not found (NOT_FOUND, SOURCE_NOT_FOUND)
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/metrics/suggestions" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/metrics/{metricId}
A metric with its targets, versions (who changed what), alerts, unusual values found and the forecasts of its source. With value=true, also its value now (value, as /value).
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
metricId required | path | string | Identifier of the metric
|
x-auth-token required | header | string | Autentication token
|
timezone | query | string | IANA time zone of the user (default Europe/Madrid)
|
value | query | boolean | |
Responses
- 200 The metric
- 401 Invalid authorization
- 403 The token or the user lacks the permission (ACCESS_DENIED), or a limit (LIMIT)
- 404 Workspace, metric or its source not found (NOT_FOUND, SOURCE_NOT_FOUND)
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/metrics/<metricId>" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/metrics/{metricId}
Changes a metric (what is not sent stays). A new version records who changed what. Needs view_edit or being its owner.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
metricId required | path | string | Identifier of the metric
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
name required | string | |
description | string | |
source required | string | |
definition | MetricDefinition | The calculation of a metric: a question of the engine of «Habla con tus datos», with the fields by name.
|
date_field | string | |
period | string: day | week | month | quarter | year | |
bucket | string: hour | day | week | month | |
unit | string | |
format | string: number | integer | currency | percent | |
decimals | integer | |
direction | string: up | down | none | up: more is better; down: more is worse
|
synonyms | array<string> | |
dimensions | array<string> | |
forecast | string | Model of «Predict the future»
|
sensitivity | string: low | medium | high | |
owner | string | |
Responses
- 200 The metric, with `changes`
- 401 Invalid authorization
- 403 The token or the user lacks the permission (ACCESS_DENIED), or a limit (LIMIT)
- 404 Workspace, metric or its source not found (NOT_FOUND, SOURCE_NOT_FOUND)
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/metrics/<metricId>" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
DELETE /api/v1/workspace/{workspaceId}/metrics/{metricId}
Deletes a metric with its targets, unusual values, follows and alerts. Needs view_delete or being its owner.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
metricId required | path | string | Identifier of the metric
|
x-auth-token required | header | string | Autentication token
|
Responses
- 200 Deleted
- 401 Invalid authorization
- 403 The token or the user lacks the permission (ACCESS_DENIED), or a limit (LIMIT)
- 404 Workspace, metric or its source not found (NOT_FOUND, SOURCE_NOT_FOUND)
Example
curl -X DELETE "https://app.air-core.io/api/v1/workspace/<workspaceId>/metrics/<metricId>" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/metrics/{metricId}/value
The value of a metric now, computed by AIR-Core over all the rows: against the previous period (same stretch), its series with the usual range of each point, trend, unusual values (each point against its own history: median/MAD, with its weekly or yearly pattern when it has one), targets with their projection, forecast (when a model of «Predict the future» computes the same figure) and why it changed (why).
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
metricId required | path | string | Identifier of the metric
|
x-auth-token required | header | string | Autentication token
|
timezone | query | string | IANA time zone of the user (default Europe/Madrid)
|
Responses
- 200 The card of the metric
- 401 Invalid authorization
- 403 The token or the user lacks the permission (ACCESS_DENIED), or a limit (LIMIT)
- 404 Workspace, metric or its source not found (NOT_FOUND, SOURCE_NOT_FOUND)
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/metrics/<metricId>/value" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/metrics/{metricId}/explain
Why a metric changed, computed exactly by AIR-Core: for each dimension the change of each group and the share of the total change it explains (sums and counts add up exactly; averages split into mix and rate). Without a body: the current period against the previous one. With from/to (and ref_from/ref_to): those periods. With anomaly: one point of the series against the one before or, with season, one season before.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
metricId required | path | string | Identifier of the metric
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
from | string | |
to | string | |
ref_from | string | |
ref_to | string | |
anomaly | string | Key of a point (2026-10-31, 2026-10)
|
season | integer | |
dimensions | array<string> | |
timezone | string | |
Responses
- 200 The contribution analysis
- 400 NO_DIMENSIONS, DATE_FIELD_REQUIRED, BAD_POINT
- 401 Invalid authorization
- 403 The token or the user lacks the permission (ACCESS_DENIED), or a limit (LIMIT)
- 404 Workspace, metric or its source not found (NOT_FOUND, SOURCE_NOT_FOUND)
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/metrics/<metricId>/explain" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/metrics/{metricId}/follow
Follows (or, with follow: false, stops following) a metric: it goes into the user's daily or weekly briefing; with notify, its unusual values reach them by email at once. Following does not start any email of the briefing: the briefing by email is off until the user turns it on (email in /briefing/preferences); briefing_email in the answer says whether it is on.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
metricId required | path | string | Identifier of the metric
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
follow | boolean | |
notify | boolean | |
timezone | string | |
Responses
- 200 Whether the user follows it
- 401 Invalid authorization
- 403 The token or the user lacks the permission (ACCESS_DENIED), or a limit (LIMIT)
- 404 Workspace, metric or its source not found (NOT_FOUND, SOURCE_NOT_FOUND)
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/metrics/<metricId>/follow" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/metrics/{metricId}/targets
Replaces the targets of a metric: one per period kind (every week, month, quarter or year) or for one period in particular (period_key: 2026-11, 2026-Q4, 2026, the Monday of a week).
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
metricId required | path | string | Identifier of the metric
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
targets | array<object> | |
Responses
- 200 The targets
- 401 Invalid authorization
- 403 The token or the user lacks the permission (ACCESS_DENIED), or a limit (LIMIT)
- 404 Workspace, metric or its source not found (NOT_FOUND, SOURCE_NOT_FOUND)
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/metrics/<metricId>/targets" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/metrics/{metricId}/alerts
Removed. The alerts are no longer part of the API: this operation answers 410 Gone with the code ALERTS_REMOVED. Use POST /api/v2/workspace/{workspaceId}/automations with trigger.type: metric (the automations of API v2) instead.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
metricId required | path | string | Identifier of the metric
|
Responses
- 410 Gone: the alerts were removed from API v1
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/metrics/<metricId>/alerts" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/metrics/{metricId}/alerts/{alertId}/check
Removed. The alerts are no longer part of the API: this operation answers 410 Gone with the code ALERTS_REMOVED. Use POST /api/v2/workspace/{workspaceId}/automations/{automationId}/test (the automations of API v2) instead.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
metricId required | path | string | Identifier of the metric
|
alertId required | path | string | |
Responses
- 410 Gone: the alerts were removed from API v1
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/metrics/<metricId>/alerts/<alertId>/check" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/metrics/{metricId}/dashboard
Adds the metric to a dashboard (or a new one) as a key figure over the last days of its period.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
metricId required | path | string | Identifier of the metric
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
dashboard | string | |
dashboard_name | string | |
Responses
- 200 The dashboard and the visualization
- 401 Invalid authorization
- 403 The token or the user lacks the permission (ACCESS_DENIED), or a limit (LIMIT)
- 404 Workspace, metric or its source not found (NOT_FOUND, SOURCE_NOT_FOUND)
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/metrics/<metricId>/dashboard" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/briefing
The briefing of the metrics the user follows, computed now: a card per metric (as /value) and narrative, two or three sentences from a template (summaries by AI are made by the daily or weekly briefing where AI is allowed: paid plans, or the free plan with AI credit or its own key; the model only sees aggregated figures, never rows).
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Autentication token
|
timezone | query | string | IANA time zone of the user (default Europe/Madrid)
|
Responses
- 200 The briefing
- 401 Invalid authorization
- 403 The token or the user lacks the permission (ACCESS_DENIED), or a limit (LIMIT)
- 404 Workspace, metric or its source not found (NOT_FOUND, SOURCE_NOT_FOUND)
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/briefing" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/briefing/preferences
When the user receives the briefing: frequency (daily, weekly, off), timezone, hour, weekday (1 Monday … 7 Sunday), email, ai. The briefing by email is off until the user turns it on (email: false by default); without it the briefing is only computed when it is opened.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Autentication token
|
timezone | query | string | IANA time zone of the user (default Europe/Madrid)
|
Responses
- 200 The preferences
- 401 Invalid authorization
- 403 The token or the user lacks the permission (ACCESS_DENIED), or a limit (LIMIT)
- 404 Workspace, metric or its source not found (NOT_FOUND, SOURCE_NOT_FOUND)
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/briefing/preferences" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/briefing/preferences
Changes when the user receives the briefing. It is sent once per day or ISO week of their calendar, from that hour in their time zone.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
frequency | string: daily | weekly | off | |
timezone | string | |
hour | integer | |
weekday | integer | |
email | boolean | |
ai | boolean | |
Responses
- 200 The preferences
- 401 Invalid authorization
- 403 The token or the user lacks the permission (ACCESS_DENIED), or a limit (LIMIT)
- 404 Workspace, metric or its source not found (NOT_FOUND, SOURCE_NOT_FOUND)
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/briefing/preferences" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
models
Models API. Models allow you to use artificial intelligence algorithms to analyze your data and extract knowledge from it.
GET /api/v1/workspace/{workspaceId}/topics-model/{modelId}
A topics model (model type topics: made by an analysis of texts with the task topics, or by the goal «Temas en textos» of the model wizard): its column of texts and of dates, language, method, number of topics and each topic with the name people gave it (or its first words), its words with their weight, its texts and its share; with a column of dates, the share of each topic by period (prevalence). Needs a token that reads workspaces and permission to read the models.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the topics model
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Responses
- 200 The topics model
- 401 Invalid authorization
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 404 Workspace not found, or NOT_FOUND: not a topics model of the workspace
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/topics-model/<modelId>" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/models/methods
Lists the methods that can be used to create models in this installation, by type of model and in the recommended order (the first ones are good defaults). They depend on the version of the AI module: source is 'ai-module' when the module advertises them and 'default' when it does not (an earlier module, or one that cannot be reached right now), and then they are the usual ones. Any valid token can call it, also one limited to a workspace.
Parameters
| Name | In | Type | Description |
|---|
x-auth-token required | header | string | Autentication token
|
Responses
- 200 Normal response.
- 401 Invalid authorization
Example
curl -X GET "https://app.air-core.io/api/v1/models/methods" \
-H "x-auth-token: $AIRCORE_TOKEN"
GET /api/v1/workspace/{workspaceId}/models
Lists the models of a workspace
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Autentication token
|
page | query | integer (int32) | Requested page (starts with 0)
|
limit | query | integer (int32) | Max number of items per page (max 500)
|
Responses
- 200 Normal response. Paginated result.
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/models" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/models
Creates a new artificial intelligence model. This may require advanced knowledge if you want to use specific configurations. Please refer to AIR-Core documentation on how to create models using this API.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
name | string | Model name (max 80 characters)
|
description | string | Model description (max 300 characters)
|
type | string: classifier | regressor | clustering | outlier | Model type: 'classifier' (nominal or logic target) and 'regressor' (numeric target) are supervised; 'clustering' and 'outlier' (anomaly detection) are unsupervised (target is ignored, but it must be a valid index).
|
method | string: forest | hist-gradient | xgboost | lightgbm | gradient | extra-trees | logistic | linear | Method to build the model with. The methods offered depend on the version of the AI module of the installation: GET /api/v1/models/methods lists them by type, in the recommended order. With an AI module that does not advertise them they are: classifier 'bayes', 'forest', 'gradient', 'logistic', 'mlp', 'neighbors', 'sv', 'tree' and 'xgb'; regressor 'forest', 'gradient', 'linear', 'mlp', 'neighbors', 'sv', 'tree' and 'xgb'; clustering 'dbscan' and 'kmeans'; outlier 'elliptic-envelope', 'isolation-forest' and 'one-class-svm'. An AI module that advertises them (gimodeler 0.14) may add 'hist-gradient' (histogram-based gradient boosting, handles missing values), 'xgboost' (XGBoost gradient boosting; 'xgb' is XGBoost's random forest mode), 'lightgbm', 'extra-trees' and 'rgf' (classifier and regressor), 'multinomial-nb' and 'complement-nb' (classifier; non-negative inputs only), 'ridge', 'lasso' and 'elastic-net' (regressor), 'gaussianmixture', 'agglomerative' and 'spectral' (clustering) and 'local-outlier-factor' (outlier), and leave out a method whose library is not installed. A known method the AI module does not offer is refused with 400 METHOD_NOT_AVAILABLE, and an unknown one with 400 UNKNOWN_METHOD; the message lists the methods available.
|
source | string | Identifier of the source to use for training.
|
target | integer (int32) | Index of the feature to use as target (if applicable).
|
configuration | object | Dictionary of configuration attributes for the model (Advanced).
|
training_configuration | object | Training configuration (if applicable).
|
second_attempt | boolean | Quality guarantee (classifiers and regressors). When the trained model is not better than the naive prediction (always answering the most frequent class, or always predicting the mean), AIR-Core trains a few other methods with their default settings on the same data (2 on the free plan, 3 on the paid ones, inside the same task and its time) and keeps the best one that beats it; the model then has that method, and quality.second_attempt of the model says what happened. false always keeps the method asked for. Default: true.
|
hyper_search_configuration | object | Hyperparameter search (advanced). {"auto": true} searches a small grid of the main settings of the method with 3-fold cross-validation (settings fixed in configuration are not searched); the chosen values are returned in the evaluation of the model (hyperparameters). Otherwise a gimodeler search configuration: method (grid or random), cv, shuffle, random_state, number_models and grid.estimator (lists of values per setting).
|
inputs | array<integer (int32)> | Optional: the columns the model learns from, as indexes of the training source (the target cannot be one of them; repetitions are refused). Without it, every column but the target, as always. Only for 'classifier', 'regressor', 'clustering' and 'outlier', and only with an AI module that trains on chosen columns (gimodeler 0.19 or later; GET /api/v1/models/methods says so in inputs). The model keeps them in configuration.inputs: inputs of the model, predict, batch-predict, predict-1d, apply and the explanations then take exactly these columns, in the order of the source. A list with every column but the target is the same as leaving it out. With nlp_config.text_attribute, the column of text must be one of them. Errors (400): BAD_INPUTS (not a list of indexes, empty or repeated), INPUT_NOT_FOUND, INPUT_IS_TARGET, INPUTS_NOT_SUPPORTED (another type of model), INPUTS_WITHOUT_TEXT and INPUTS_NOT_AVAILABLE (the AI module of the installation cannot yet; nothing is created).
|
Responses
- 200 Normal response.
- 400 Bad request
- 401 Invalid authorization
- 403 Access denied
- 404 Not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/models" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/models/{modelId}
Gets the information about a model (attributes, metrics, etc).
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Autentication token
|
Responses
- 200 Normal response
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/models/{modelId}
Modifies the name and description of a model
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
name | string | Model name (max 80 characters)
|
description | string | Model description (max 300 characters)
|
Responses
- 200 Normal response
- 400 Bad request
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
DELETE /api/v1/workspace/{workspaceId}/models/{modelId}
Deletes a model.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Autentication token
|
Responses
- 200 Normal response
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X DELETE "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/models/{modelId}/dependents
Dependency map of a model, to check before deleting it. sources, the sources made with its predictions (from is the source it was applied to), and dashboards, the dashboards with widgets of the model. Up to 50 of each; more counts the rest. Groups the user of the token cannot read keep their count, with hidden: true and no items.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Autentication token
|
Responses
- 200 Normal response.
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/dependents" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/models/{modelId}/evaluation
Gets the evaluation of a model.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Autentication token
|
Responses
- 200 Normal response
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/evaluation" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/models/{modelId}/predict
Uses a model to predict a value given the inputs.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Autentication token
|
inputs required | query | string | Input values given as JSON array. Example: [0.2, 0.1, -0.5, 0.9]
|
Responses
- 200 Normal response
- 400 Bad request
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
- 500 Internal server error or model error.
- 501 The model does not support prediction.
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/predict" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/models/{modelId}/batch-predict
Uses a model to predict a value given the inputs.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
data | array<object> | Array of instances to predict. Max 25 instances in a single request.
|
Responses
- 200 Normal response
- 400 Bad request
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
- 500 Internal server error or model error.
- 501 The model does not support prediction.
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/batch-predict" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/models/{modelId}/apply
Applies a model to a source: a task creates a new source with the rows of the source and a column with the prediction of each row. Without mapping, each input of the model takes the column of the source with the same name (case-insensitive).
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
source required | string | Identifier of the source with the data to predict (not external or real-time).
|
name required | string | Name of the new source (max 120 characters).
|
mapping | array<integer> | Optional. Column index of the source for each input of the model, in the order of the model inputs (all its fields but the target).
|
Responses
- 200 Task created; poll GET /workspace/{workspaceId}/task/{taskId}: its result is the ID of the new source.
- 400 Bad request
- 401 Invalid authorization
- 403 Access denied or plan limit
- 404 Workspace, model or source not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/apply" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/models/{modelId}/predict-1d
Unidimensional predict. Keep all the input variables with the same value and vary one of them.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
inputs | array<number> | Array of input values to provide the model with. You must provide the variable you want to vary, event it is not used, to keep the order of the variables.
|
vary | integer (int32) | Index of the input variable you want to vary
|
values | array<number> | Array of values for the input variable you want to vary. You must provide at least one value. Max values in a single request are 255.
|
Responses
- 200 Normal response
- 400 Bad request
- 401 Invalid authorization
- 403 Access denied
- 404 Requested resource was not found
- 500 Internal server error or model error.
- 501 The model does not support prediction.
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/predict-1d" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/models/{modelId}/explanation
Global explanation of a classification or regression model: weight of each input in its predictions (mean absolute SHAP value over a sample of the training data). Computed by the explainability module; cached until the model changes. Requires the model_use permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Autentication token
|
lang | query | string: es | en | Language of the text: es or en
|
stored | query | boolean | Only what is already stored: true answers the stored explanation for this version of the model, or 204 when there is none. Explanations are kept per model version (also those computed after training); the explainability module is never called.
|
Responses
- 200 Normal response
- 204 No explanation stored yet (only with stored=true)
- 401 Error
- 403 ACCESS_DENIED, or XAI_DISABLED: the explainability module is not enabled for the organization of the workspace (it is enabled per organization by a global administrator)
- 404 Error
- 422 XAI_UNSUPPORTED: the model type cannot be explained (only classifiers and regressors) or its training data no longer exists
- 503 XAI_UNAVAILABLE: the explainability module is not enabled or not available
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/explanation" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/models/{modelId}/explanation/prediction
Explains one prediction: contribution of each input value (SHAP). For classifiers it explains the predicted class. Requires the model_use permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
inputs required | array<object> | Input values, in the order of the model inputs (all model fields except the target)
|
lang | string: es | en | |
Responses
- 200 Normal response
- 400 Error
- 401 Error
- 403 ACCESS_DENIED, or XAI_DISABLED: the explainability module is not enabled for the organization of the workspace (it is enabled per organization by a global administrator)
- 404 Error
- 422 XAI_UNSUPPORTED
- 503 XAI_UNAVAILABLE
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/explanation/prediction" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/models/{modelId}/explanation/rules
Rules that describe what a classification or regression model predicts («if … then …»; for regressors, ranges of the value), learned from its predictions over a random sample of up to 1000 rows of its training data (the same rows every time), with the coverage and precision of each rule and the fidelity of the rule list to the model. Computed by the explainability module; cached until the model changes. Requires the model_use permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Autentication token
|
lang | query | string: es | en | Language of the text: es or en
|
stored | query | boolean | Only what is already stored: true answers the stored explanation for this version of the model, or 204 when there is none. Explanations are kept per model version (also those computed after training); the explainability module is never called.
|
Responses
- 200 Normal response
- 204 No explanation stored yet (only with stored=true)
- 401 Error
- 403 ACCESS_DENIED, or XAI_DISABLED: the explainability module is not enabled for the organization of the workspace (it is enabled per organization by a global administrator)
- 404 NOT_FOUND: the workspace or the model was not found
- 422 XAI_UNSUPPORTED: only classifiers and regressors are supported, or the training data of the model no longer exists
- 429 TOO_MANY_REQUESTS: too many explanation requests; wait a minute
- 503 XAI_UNAVAILABLE: the explainability module is not enabled or not available
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/explanation/rules" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/models/{modelId}/explanation/prototypes
Representative cases (prototypes) of a random sample of up to 1000 rows of the training data of a model (the same rows every time), overall and per group: per class (classifiers), range (regressors), cluster (clustering) or anomaly / normal (anomaly detection), with how each group differs from the whole. The values of the cases are rows of the training source: they are left out (rows_hidden: true) unless the user has the read_sources permission in the workspace. Cached until the model changes. Requires the model_use permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Autentication token
|
lang | query | string: es | en | Language of the text: es or en
|
stored | query | boolean | Only what is already stored: true answers the stored explanation for this version of the model, or 204 when there is none. Explanations are kept per model version (also those computed after training); the explainability module is never called.
|
Responses
- 200 Normal response
- 204 No explanation stored yet (only with stored=true)
- 401 Error
- 403 ACCESS_DENIED, or XAI_DISABLED: the explainability module is not enabled for the organization of the workspace (it is enabled per organization by a global administrator)
- 404 NOT_FOUND: the workspace or the model was not found
- 422 XAI_UNSUPPORTED: only classifiers, regressors, clustering and anomaly detection models are supported, or the training data of the model no longer exists
- 429 TOO_MANY_REQUESTS: too many explanation requests; wait a minute
- 503 XAI_UNAVAILABLE: the explainability module is not enabled or not available
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/explanation/prototypes" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/models/{modelId}/explanation/counterfactuals
Counterfactual explanation of one case: the smallest changes of its input values that would make the model give the desired class (classifiers) or a value in the desired range (regressors), keeping the locked inputs. Up to 5 alternatives, each verified with the model. Requires the model_use permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
inputs required | array<object> | Input values, in the order of the model inputs (all model fields except the target)
|
locked | array<string> | Names of inputs that may not change
|
desired_class | object | Classifiers: the wanted class (optional; any other class by default)
|
desired_range | object | Regressors (required): the wanted range of the prediction; null for no bound, at least one bound
|
count | integer | Alternatives to find
|
lang | string: es | en | |
Responses
- 200 Normal response
- 400 BAD_INPUTS: the input values, the locked inputs or the desired class or range are not valid
- 401 Error
- 403 ACCESS_DENIED, or XAI_DISABLED: the explainability module is not enabled for the organization of the workspace (it is enabled per organization by a global administrator)
- 404 NOT_FOUND: the workspace or the model was not found
- 422 XAI_UNSUPPORTED: only classifiers and regressors are supported, or the training data of the model no longer exists
- 429 TOO_MANY_REQUESTS: too many explanation requests; wait a minute
- 503 XAI_UNAVAILABLE: the explainability module is not enabled or not available
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/explanation/counterfactuals" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/models/{modelId}/explanation/compare
Where two models of the same workspace disagree (interpretable model differencing): share of disagreement over a random sample of up to 1000 rows of the training data of the first model, and regions of the inputs, as readable conditions, where they differ most. Both models must be classifiers or both regressors, with the same inputs. Cached until either model changes. Requires the model_use permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Autentication token
|
other required | query | string | Identifier of the other model, of the same workspace
|
lang | query | string: es | en | Language of the text: es or en
|
stored | query | boolean | Only what is already stored: true answers the stored comparison (with other, that one; without other, the one stored last for this version of the model, whose other_model says which) or 204 when there is none. The explainability module is never called.
|
Responses
- 200 Normal response
- 204 No explanation stored yet (only with stored=true)
- 401 Error
- 403 ACCESS_DENIED, or XAI_DISABLED: the explainability module is not enabled for the organization of the workspace (it is enabled per organization by a global administrator)
- 404 NOT_FOUND: the workspace or the model was not found, or `other` is not a model of the workspace
- 422 XAI_UNSUPPORTED: the models are not both classifiers or both regressors, do not have the same inputs, or the training data no longer exists
- 429 TOO_MANY_REQUESTS: too many explanation requests; wait a minute
- 503 XAI_UNAVAILABLE: the explainability module is not enabled or not available
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/explanation/compare" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/models/{modelId}/explanation/forecast
What weighs in a forecast (a model of type forecast): which past periods of a series move most what it forecasts for the next periods. The explainability module treats the forecast as a black box and forecasts again from perturbed copies of the last periods (through the AI module, gimodeler 0.17 or later) with three methods ported from IBM AIX360: TS-Saliency (integrated gradients estimated by Monte Carlo), TS-LIME (a local linear surrogate) and TS-ICE (how the forecast changes when the values of one stretch go up or down), combined in equal parts. When the chosen method is naive or seasonal naive the explanation is exact and nothing is computed. Cached until the forecast is trained again. Requires the model_use permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Autentication token
|
series | query | string | The series to explain (its value of the series field); the first one when left out
|
lang | query | string: es | en | Language of the text: es or en
|
stored | query | boolean | Only what is already stored: true answers the stored explanation for this version of the model, or 204 when there is none. Explanations are kept per model version (also those computed after training); the explainability module is never called.
|
Responses
- 200 Normal response
- 204 No explanation stored yet (only with stored=true)
- 401 Error
- 403 ACCESS_DENIED, or XAI_DISABLED: the explainability module is not enabled for the organization of the workspace (it is enabled per organization by a global administrator)
- 404 NOT_FOUND: the workspace, the model or the series was not found
- 409 FORECAST_NOT_READY: the forecast is still being trained
- 422 XAI_UNSUPPORTED: the model is not a forecast, or the AI module cannot forecast from a window (gimodeler before 0.17)
- 429 TOO_MANY_REQUESTS: too many explanation requests; wait a minute
- 503 XAI_UNAVAILABLE: the explainability module is not enabled or not available
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/explanation/forecast" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/models/{modelId}/explanation/effects
Effect of each input of a classification or regression model: one curve per input (ranges of numbers and dates, the 20 most frequent categories and «Otros») and up to 3 pairs of inputs that act together, from an Explainable Boosting Machine (InterpretML) fitted to the predictions of the model over a random sample of up to 2000 rows of its training data, with its fidelity on rows it did not see (accuracy for classification, R² for regression). For a classifier one class is explained against the rest and the effects are percentage points of its probability; for a regressor, units of the target. Computed by the explainability module; cached until the model changes. Requires the model_use permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Autentication token
|
class | query | string | Classification: the class explained against the rest. By default the positive class of a binary task (1, true, yes, sí…) or, otherwise, the class the model predicts least often among those it predicts for at least 5 % of the rows.
|
lang | query | string: es | en | Language of the text: es or en
|
stored | query | boolean | Only what is already stored: true answers the stored explanation for this version of the model, or 204 when there is none. Explanations are kept per model version (also those computed after training); the explainability module is never called.
|
Responses
- 200 Normal response
- 204 No explanation stored yet (only with stored=true)
- 401 Error
- 403 ACCESS_DENIED, or XAI_DISABLED: the explainability module is not enabled for the organization of the workspace (it is enabled per organization by a global administrator)
- 404 NOT_FOUND: the workspace or the model was not found
- 422 XAI_UNSUPPORTED: only classifiers and regressors are supported, the model does not predict the class asked for (or too few rows of it), or the training data of the model no longer exists
- 429 TOO_MANY_REQUESTS: too many explanation requests; wait a minute
- 503 XAI_UNAVAILABLE: the explainability module is not enabled or not available
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/explanation/effects" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/models/{modelId}/explanation/fairness
Bias audit (group fairness) of a classification or regression model by a sensitive field of a source (by default its training source): over a random sample of up to 5000 rows, the predictions of the model are compared with the real value of the target per group of the field (categories, or readable ranges for numbers). The field need not be an input of the model: a model that does not use it can still treat its groups differently through other inputs (indirect bias). Groups with fewer than 30 rows are reported with small: true and left out of the gaps. Verdict: concern with any flag of severity high, review with any warning (or fewer than two groups to compare), ok otherwise; the thresholds are documented in the explainability module (disparate impact below 0.8 is a warning and below 0.6 high; gaps of rates of 0.1 a warning and 0.2 high; a ratio of mean errors of 1.25 a warning and 1.5 high). Cached for an hour per model, source version, field and class. Requires the model_use and read_sources permissions.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
sensitive | string | Name of the sensitive field in the source (required unless stored is true)
|
source | string | Identifier of a source of the workspace with the inputs and the target of the model (by name); the training source by default
|
favorable | string | Classification: the favorable class. By default the positive class of a binary task or, otherwise, the least frequent real class among those with at least 5 % of the rows.
|
lang | string: es | en | |
stored | boolean | Only what is already stored: true answers the stored audit (with sensitive, that one; without it, the one stored last for this version of the model while its source has not changed) or 204 when there is none. The explainability module is never called.
|
Responses
- 200 Normal response
- 204 No explanation stored yet (only with stored=true)
- 400 BAD_SENSITIVE: the sensitive field is missing, not in the source or the target of the model; BAD_CLASS: the favorable class is not one value; MODEL_NOT_SUPPORTED: only classifiers and regressors can be audited
- 401 Error
- 403 ACCESS_DENIED (the audit reads the rows of a source: it needs read_sources), XAI_DISABLED, or a refusal of the AI data policy for an AI application connected through MCP (the groups are values of the field: never sent refuses the audit, pseudonymised gives them as tokens)
- 404 NOT_FOUND: the workspace, the model or the source was not found
- 422 XAI_UNSUPPORTED: the source does not have every input of the model and its target, has no rows, or the favorable class is not a class of the target
- 429 TOO_MANY_REQUESTS: too many explanation requests; wait a minute
- 503 XAI_UNAVAILABLE: the explainability module is not enabled or not available
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/explanation/fairness" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/models/{modelId}/card
Automatic model card: training data (source, rows, inputs and types, target, missing values), method and configuration, evaluation metrics, limitations detected with heuristics (class imbalance, small sample, low metric, missing values), intended use, out-of-scope uses, creation date and author. JSON by default; format=markdown returns a Markdown document. Requires the read_models permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Autentication token
|
format | query | string: json | markdown | Response format: json (default) or markdown
|
lang | query | string: es | en | Language of the texts: es (default) or en
|
Responses
- 200 Model card
- 401 Error
- 403 Error
- 404 Error
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/card" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/forecasts
Creates a forecast of a time series: a model of type forecast that predicts the next periods of a figure from its history, with a range of likely values. Only the source and its date field are needed; the rest is automatic. It starts a task (poll GET /api/v1/workspace/{workspaceId}/task/{taskId}: its result is the ID of the model) and needs an AI module that forecasts (gimodeler 0.16; GET /api/v1/models/methods says forecast: true). If the task fails, its message is FORECAST_NOT_ENOUGH_HISTORY (fewer periods than needed, which the error description says), FORECAST_NO_DATES, FORECAST_CONSTANT or FORECAST_INTERNAL. Requires the model_create and task permissions; same plan limits as other models.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
name required | string | Name of the forecast (max 120 characters).
|
description | string | Description (max 300 characters).
|
source required | string | Identifier of the source with the history (not external or real-time).
|
date required | string | integer | Date field of the source, by name or index.
|
target | string | integer | Numeric field to forecast, by name or index. Empty or missing to forecast the number of records.
|
series | string | integer | Optional field with categories to make one forecast per value (the 20 most frequent).
|
aggregation | string: auto | sum | mean | count | How the records of a period are combined. 'auto' (default): sum when the figure adds up by its name, else mean; count without a target.
|
frequency | string: auto | H | D | W | M | Q | Y | Period of the forecast: 'auto' (default, the rhythm of the data), H hours, D days, W weeks, M months, Q quarters, Y years.
|
horizon | integer | Periods ahead; 0 (default) is automatic: 48 hours, 30 days, 12 weeks, 12 months, 8 quarters or 5 years.
|
level | number: 0.8 | 0.95 | Coverage of the range of likely values.
|
Responses
- 200 Task created; its result is the ID of the forecast model.
- 400 Bad request: FORECAST_NOT_AVAILABLE (the AI module does not forecast), BAD_NAME, BAD_DESCRIPTION, SOURCE_EXTERNAL, DATE_FIELD_MISSING, DATE_FIELD_NOT_FOUND, DATE_FIELD_NOT_DATE, TARGET_NOT_FOUND, TARGET_NOT_NUMERIC, SERIES_NOT_FOUND, SERIES_NOT_CATEGORY, BAD_AGGREGATION, BAD_FREQUENCY, BAD_HORIZON or BAD_LEVEL, with a message.
- 401 Invalid authorization
- 403 No permission (ACCESS_DENIED) or a limit of the plan (LIMIT).
- 404 Workspace or source not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/forecasts" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/models/{modelId}/forecast
The forecast of a model of type forecast, as the AI module has it: for each series (one without a series field), the next periods with the forecast value and its range, the chosen method, the seasonal pattern (in periods), the trend and the errors of the test on past data (rolling-origin backtest). history=1 adds the history (last 1,000 periods) and the test of each series. Requires the read_models permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the forecast model
|
x-auth-token required | header | string | Autentication token
|
history | query | string | 1 to include the history and the test of each series
|
series | query | string | Only the series with this value of the series field
|
Responses
- 200 The forecast (status 'ready'), or status 'training' or 'error' (with code and description; for NOT_ENOUGH_HISTORY, history.available and history.needed when the description says them).
- 400 The model is not a forecast (NOT_A_FORECAST).
- 401 Invalid authorization
- 403 No permission
- 404 Workspace or model not found, or the AI module does not have the forecast (FORECAST_NOT_FOUND).
- 503 The AI module is not available (AI_MODULE_UNAVAILABLE).
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/forecast" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/models/{modelId}/forecast/retrain
Trains the forecast again with the same settings and the data the source has now. The model keeps its ID, page, dashboards and saved sources; the sources made with it are updated when the new forecast is ready. Starts a task. Requires the model_edit permission (or being its owner) and the task permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the forecast model
|
x-auth-token required | header | string | Autentication token
|
Responses
- 200 Task created.
- 400 FORECAST_NOT_AVAILABLE, NOT_A_FORECAST, SOURCE_NOT_FOUND (the source was deleted) or a settings code when the columns of the source changed.
- 401 Invalid authorization
- 403 No permission (ACCESS_DENIED) or a limit of the plan (LIMIT).
- 404 Workspace or model not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/forecast/retrain" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/models/{modelId}/forecast/source
Saves the forecast as a data source with the columns date, series (only with a series field), forecast, lower and upper. It is a derived source of the model: it is updated each time the forecast is trained again. Starts a task (its result is the ID of the source). Requires the model_use, source_create and task permissions; counts towards the sources of the plan.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the forecast model
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
name required | string | Name of the new source (max 120 characters).
|
Responses
- 200 Task created.
- 400 NOT_A_FORECAST or BAD_NAME.
- 401 Invalid authorization
- 403 No permission (ACCESS_DENIED) or a limit of the plan (LIMIT).
- 404 Workspace or model not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/forecast/source" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/genai-models
Lists the models with generative AI of a workspace: the user described what to predict from one to five sources, and generative AI predicts it row by row. Requires the read_models permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
page | query | integer | |
limit | query | integer | |
x-auth-token required | header | string | Autentication token
|
Responses
- 200 The models (the cases of their checks left out).
- 401 Invalid authorization
- 404 Workspace or model not found (NOT_FOUND)
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/genai-models" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/genai-models
Plans a model with generative AI from a description and one to five sources. The model only sees a profile of each source (schema, statistics and at most 30 sample rows, long texts cut): a small fixed cost (plan_estimate_eur of the config), whatever the size of the data; nothing is spent on the rows. The plan is kept only as far as it fits the sources (dropped says what was left out) and can be corrected with POST .../genai-models/{genaiModelId}. Requires the model_create permission. On the free plan only the cost-free model of the platform or the organization's own key can be used (403 GENAI_PLAN_REQUIRED).
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
description required | string | What to predict, in the user's words.
|
sources required | array<string> | Identifiers of the sources (the first one is a good main source).
|
name | string | Name; otherwise the AI proposes one.
|
lang | string | Language of the plan and of the reasons (es, en, cat, fr...).
|
Responses
- 200 The model and its plan.
- 400 BAD_DESCRIPTION, BAD_SOURCES, or the text was not accepted (REQUEST_NOT_ALLOWED...).
- 401 Invalid authorization
- 403 GENAI_PLAN_REQUIRED, LIMIT (models per workspace) or a spending limit of the AI.
- 404 Workspace or model not found (NOT_FOUND)
- 422 NOT_UNDERSTOOD: no plan could be made from the description.
- 429 Too many requests or a spending limit (SPEND_LIMIT, ORG_SPEND_LIMIT).
- 503 ASSISTANT_DISABLED or MODEL_UNAVAILABLE.
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/genai-models" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/genai-models/config
Whether models with generative AI can be used here (available, else code: ASSISTANT_DISABLED or GENAI_PLAN_REQUIRED), the AI model (cost_free, own_key), the fixed cost of a plan, the default spending limit of a run, the limits and what the user may do. Requires the read_models permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Autentication token
|
Responses
- 200 The configuration.
- 401 Invalid authorization
- 404 Workspace or model not found (NOT_FOUND)
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/genai-models/config" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/genai-models/{genaiModelId}
A model with generative AI: its plan, its last check (with its result) and its last run (with why it stopped and the source of the predictions). While a check or a run is in progress, read it every few seconds: it catches up with its task. Requires the read_models permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
genaiModelId required | path | string | Identifier of the model with generative AI
|
x-auth-token required | header | string | Autentication token
|
Responses
- 200 The model.
- 401 Invalid authorization
- 404 Workspace or model not found (NOT_FOUND)
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/genai-models/<genaiModelId>" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/genai-models/{genaiModelId}
Corrects the plan (only the keys sent; it is checked again against the sources as the plan of the AI), the name or the description. No cost. Requires the model_edit permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
genaiModelId required | path | string | Identifier of the model with generative AI
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
plan | object | The keys of the plan that change: question, task, answers, inputs, past_answers (or null), guidance, number_range.
|
name | string | |
description | string | |
Responses
- 200 The model, what was left out and a new estimate.
- 400 BAD_PLAN, BAD_SOURCES or a text that was not accepted.
- 401 Invalid authorization
- 404 Workspace or model not found (NOT_FOUND)
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/genai-models/<genaiModelId>" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
DELETE /api/v1/workspace/{workspaceId}/genai-models/{genaiModelId}
Deletes the model; the source of its predictions stays. Requires the model_delete permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
genaiModelId required | path | string | Identifier of the model with generative AI
|
x-auth-token required | header | string | Autentication token
|
Responses
- 200 Deleted.
- 401 Invalid authorization
- 404 Workspace or model not found (NOT_FOUND)
Example
curl -X DELETE "https://app.air-core.io/api/v1/workspace/<workspaceId>/genai-models/<genaiModelId>" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/genai-models/{genaiModelId}/estimate
What each paid step would cost, in charged euros, from counts and a small sample (the data is never read whole): the check on up to 100 rows with a known answer, and the apply with the limits of the run. Zero with the cost-free model or the organization's own key. Spends nothing. Requires the read_models permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
genaiModelId required | path | string | Identifier of the model with generative AI
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
max_eur | number | Spending limit of the run in charged euros (default: what is left of the AI credits or monthly caps of the user and the organization, at most 5).
|
max_rows | integer | Maximum rows sent to the model in the run (default 20000).
|
only_missing | boolean | Only the rows without a known answer (default true when the plan has a field of known answers).
|
Responses
- 200 The estimate.
- 401 Invalid authorization
- 404 Workspace or model not found (NOT_FOUND)
- 409 PLAN_NOT_READY or SOURCE_MISSING.
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/genai-models/<genaiModelId>/estimate" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/genai-models/{genaiModelId}/check
Checks the plan, as a task: predicts up to 100 rows that already have the answer (stratified by answer, without seeing it), with a few others as examples, and measures the hit rate or the error next to a simple rule. A paid step: it runs only with the estimate_id of the check the user accepted, or confirm_eur. Requires the model_create or model_edit permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
genaiModelId required | path | string | Identifier of the model with generative AI
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
estimate_id | string | The estimate_id of the step, from the estimate the user accepted.
|
confirm_eur | number | Instead of estimate_id: an amount in euros the user accepted, at least the payable_eur of the step now.
|
max_eur | number | Spending limit of the run in charged euros (default: what is left of the AI credits or monthly caps of the user and the organization, at most 5).
|
Responses
- 200 Task created (poll GET .../genai-models/{genaiModelId}, which catches up with the task).
- 401 Invalid authorization
- 403 GENAI_PLAN_REQUIRED, LIMIT (task time or parallel tasks) or a spending limit.
- 404 Workspace or model not found (NOT_FOUND)
- 409 ESTIMATE_NOT_CONFIRMED (409): the step was not confirmed or its cost changed; `details.estimate` has the current estimate to show to the user and confirm again. Also NO_PAST_ANSWERS (fewer than 20 known answers), PLAN_NOT_READY, PLAN_OUTDATED, SOURCE_MISSING or RUN_IN_PROGRESS.
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/genai-models/<genaiModelId>/check" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/genai-models/{genaiModelId}/apply
Applies the model to the rows of the main source, as a task: many rows per call, every answer validated against the plan, answers cached by row content (a refresh pays only for new or changed rows), and the limits of the run checked before every call: it stops cleanly at the first one and keeps what it got. The first run creates a source with the predictions, a one-sentence reason and a status per row; the next ones replace it. A paid step: send the estimate_id of the apply the user accepted with the same max_eur, max_rows and only_missing, or confirm_eur. Requires the source_create permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
genaiModelId required | path | string | Identifier of the model with generative AI
|
x-auth-token required | header | string | Autentication token
|
Request body application/json
| Field | Type | Description |
|---|
estimate_id | string | The estimate_id of the step, from the estimate the user accepted.
|
confirm_eur | number | Instead of estimate_id: an amount in euros the user accepted, at least the payable_eur of the step now.
|
max_eur | number | Spending limit of the run in charged euros (default: what is left of the AI credits or monthly caps of the user and the organization, at most 5).
|
max_rows | integer | Maximum rows sent to the model in the run (default 20000).
|
only_missing | boolean | Only the rows without a known answer (default true when the plan has a field of known answers).
|
name | string | Name of the source of the predictions (first run).
|
Responses
- 200 Task created (poll GET .../genai-models/{genaiModelId}, which catches up with the task).
- 401 Invalid authorization
- 403 GENAI_PLAN_REQUIRED, LIMIT (sources, task time or parallel tasks) or a spending limit.
- 404 Workspace or model not found (NOT_FOUND)
- 409 ESTIMATE_NOT_CONFIRMED (409): the step was not confirmed or its cost changed; `details.estimate` has the current estimate to show to the user and confirm again. Also NO_ROWS, PLAN_NOT_READY, PLAN_OUTDATED, SOURCE_MISSING or RUN_IN_PROGRESS.
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/genai-models/<genaiModelId>/apply" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/models/{modelId}/monitoring
The monitoring of a model in production («Seguimiento»): whether it is on (on by default for the models trained after the feature existed, off for the older ones until a person turns it on), its settings, the sources it can watch (the training source and the origins of the sources the model is applied to), the reference profile of its training data (exact: from the exact version the model was trained on, kept by the version history of the source; approximate: that version is gone and the current one was used) with, per input and target, the fixed edges of its bins (numbers and dates: about ten bins with about the same rows, chosen among 200 bins of equal width) or its 20 most frequent values plus «others», and the shares of rows of each bucket; its status (stable, watch, alert, pending before its first run, off), the last run in full (per source watched and column: the PSI against the reference with the same edges, its status and the shares of each bucket now; and the quality with the real outcomes of the rows added after training: the main metric now against the one of the training, or a code saying why it was not measured, e.g. SCORE_UNAVAILABLE with a gimodeler without /score) and the summary of the latest runs for the trend. PSI = Σ (a − e) · ln(a / e) over the buckets (empty values, under the first edge, each bin, over the last edge; or empty values, each value, others), shares of 0 taken as 0.0001; a column is watch from psi_warning (0.10) and alert from psi_alert (0.25); dates do not count in the status unless include_dates. The watcher runs it after the updates of the sources watched, at most once a day. An AI application connected through MCP needs the level «aggregates» and gets the values of the categories and the edges of the bins only for columns without personal data held back (withheld_for_ai). Needs a token that reads workspaces and permission to read the models.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Responses
- 200 The monitoring of the model
- 401 Invalid authorization
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 404 Workspace or model not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/monitoring" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
PUT /api/v1/workspace/{workspaceId}/models/{modelId}/monitoring
Turns the monitoring of a model on or off and changes its settings (only what is sent changes). Turning it on, or changing what is compared, takes the reference when there is none and runs it now: the answer waits up to 20 seconds (running: true when it goes on in the background). alert turns the alert of the model on or off (an alert of the workspace of type «model»: it fires when a run newly reaches «alert», never on the first run nor again while it stays; needs permission to edit the workspace). check: true runs it now. Classifiers, regressors, clusterings and outlier detectors can be monitored. Needs a token that writes workspaces and permission to edit the model (or to own it). Answers the monitoring as GET does.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Request body application/json
| Field | Type | Description |
|---|
enabled | boolean | |
settings | ModelMonitoringSettings | |
alert | object | |
check | boolean | true: run it now
|
Responses
- 200 The monitoring of the model
- 400 BAD_REQUEST, BAD_SETTINGS, UNKNOWN_KEY, BAD_THRESHOLD, BAD_SOURCES, UNKNOWN_SOURCE, NO_SOURCES or UNSUPPORTED_MODEL
- 401 Invalid authorization
- 403 Access denied (ACCESS_DENIED: without permission to edit the model, or the workspace for `alert`), or the AI data policy refuses it (AI_POLICY_*)
- 404 Workspace or model not found
- 409 TRAINING_SOURCE_MISSING (an alert for a model without its training source)
Example
curl -X PUT "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/monitoring" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/models/{modelId}/monitoring/check
Runs the monitoring of a model now (the answer waits up to 20 seconds; running: true when it goes on in the background). Asked again within a minute with nothing changed, it answers the last run. Needs a token that writes workspaces and permission to edit the model (or to own it). Answers the monitoring as GET .../monitoring does.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Responses
- 200 The monitoring of the model
- 400 MONITORING_OFF (turn it on first) or UNSUPPORTED_MODEL
- 401 Invalid authorization
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 404 Workspace or model not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/monitoring/check" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/models/{modelId}/versions
The versions of a model, the newest first. A model keeps its ID, page, dashboards and sources while the trained engine behind it can change: status says which version is in use (active), waits to be promoted (candidate), was in use and is kept to go back to it (previous: the last 2), failed, or is no longer kept (retired). Each one has its trigger (initial: the one the model was created with; manual: retrained by a person; retrain: retrained by AIR-Core), when and who, its metrics (numbers only, never the classes), the data it learned from (training_data: the source and its version, whether that version is the current one and whether it is kept in the history of the source), how it compared with the version in use when it was trained (comparison: basis same_rows when both were measured on the same rows, the holdout of the current version of the source, with gimodeler 0.20 and its /score; own_evaluation when each one was measured on its own test rows, indicative only; metric, delta, relative, better (at least 1 % better), baseline), its note and can_promote. retrain says whether the model can be retrained now (problem: why not, e.g. SOURCE_COLUMNS_CHANGED), whether a retraining is running (running: its task) and whether candidates are compared on the same rows (same_rows); a forecast is always replaced when retrained (promotion: always). Models without stored versions list the one they were created with. Requires the read_models permission. For an AI application connected through MCP, the gate «aggregates» of the AI data policy, and notes in which the detector of personal data finds some are withheld (note_withheld).
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Responses
- 200 {result: success, model, type, active, keep_previous: 2, min_gain: 0.01, versions: [{version, status, trigger, created, author: {uid, name}, metrics, size, training_data: {source, source_name, version, at, current, kept}, comparison, note, task, promoted, replaced, can_promote}], retrain: {supported, promotion, available, running, problem, same_rows}, can_retrain, can_promote}
- 401 Invalid authorization
- 403 Access denied, or AI_POLICY_* for an AI application
- 404 Workspace or model not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/versions" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/models/{modelId}/retrain
Retrains the model with the same configuration (method, settings, chosen columns, train/test split) and the data its source has now (classifiers and regressors; a forecast gets the retraining of POST …/forecast/retrain, which always replaces it). The new version is a candidate, compared with the version in use, and nothing changes until it is promoted; with auto_promote: true it is promoted by itself when, measured on the same rows, its main metric (F1 macro or accuracy for a classifier, R² for a regressor) is at least 1 % better. The last 2 versions in use and the newest candidate are kept; their size counts in the workspace. Starts a task (its result is the ID of the model); its time counts like any training. Requires the model_edit permission (or being the owner of the model) and the task permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Request body application/json
| Field | Type | Description |
|---|
auto_promote | boolean | Promote it by itself when it is at least 1 % better on the same rows (default false: it stays a candidate)
|
note | string | A note for the history
|
lang | string: es | en | Language of the texts of the task
|
Responses
- 200 {result: success, task, task_id}
- 400 BAD_REQUEST, BAD_NOTE, RETRAIN_NOT_SUPPORTED, SOURCE_NOT_FOUND, SOURCE_EXTERNAL, SOURCE_COLUMNS_CHANGED (the columns of the source changed since the model was trained: details.columns), METHOD_NOT_AVAILABLE, INPUTS_NOT_AVAILABLE or a settings code of a forecast
- 401 Invalid authorization
- 403 ACCESS_DENIED, or a limit of the plan (LIMIT)
- 404 Workspace or model not found
- 409 RETRAIN_RUNNING (details.task)
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/retrain" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
POST /api/v1/workspace/{workspaceId}/models/{modelId}/versions/{version}/promote
Makes a version the one in use: a candidate, or a previous one to go back to it. One write of the model (its engine, evaluation, columns, size and version of the source), only if the model did not change meanwhile; the version that was in use is kept to go back to it, and the sources made by applying the model are computed again. Requires the model_edit permission (or being the owner of the model).
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
version required | path | integer | The version to use, as GET …/versions gives it
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Responses
- 200 {result: success, model, active, previous}
- 400 VERSION or NOT_PROMOTABLE (forecasts and unsupervised models)
- 401 Invalid authorization
- 403 ACCESS_DENIED
- 404 Workspace or model not found, or VERSION_NOT_FOUND
- 409 VERSION_ACTIVE, VERSION_GONE (its engine is no longer kept) or CONFLICT (the model changed meanwhile)
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/versions/<version>/promote" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/model-experiments
The comparisons of methods («Comparar métodos») of a workspace, the newest first (at most 50): their status, the methods of their candidates, the recommended candidate, whether a winner can still be picked (can_choose) and until when (expires), and the model the winner became. With model, only those started from that model or won by it; with source, only those of that source. options says what a comparison can have here: the candidates of the plan (2 to 3 on the free plan, up to 10 on the paid plans), the methods, whether candidates can learn from chosen columns, and who measures the naive prediction (ai-module with an AI module that learns it, platform otherwise). Needs a token that reads workspaces and permission to read the models.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
model | query | string | Only the comparisons started from this model or won by it
|
source | query | string | Only the comparisons of this source
|
Responses
- 200 The comparisons and what one can have
- 401 Invalid authorization
- 403 Access denied
- 404 Workspace not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/model-experiments" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/model-experiments
Starts a comparison of methods: several candidates that predict the same target of a source, trained one after the other in one task (one stage per candidate) on the same data and the same split (the same test_size, shuffle and seed for all; when no seed is given, one is drawn and used for all), each one a method with its default settings or the automatic search of its settings, and optionally other input columns. A candidate that fails does not stop the others, and the task stops starting candidates when the task time of the organization runs out. Each candidate is compared with the naive prediction (the most frequent class, or the mean): measured on the same rows by an AI module that learns it, or computed by AIR-Core from the evaluation otherwise. The candidates are not models: when the task ends, read the comparison and pick the winner (POST .../winner); candidates nobody picks are deleted after 7 days. Classifiers and regressors only; 2 to 3 candidates on the free plan, up to 10 on the paid plans. Answers the comparison and its task (the task gives the comparison in result). Needs a token that writes workspaces and permission to create models and run tasks.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Request body application/json
| Field | Type | Description |
|---|
name required | string | The name the winner will have
|
description | string | The description the winner will have
|
source required | string | Training source
|
target required | integer | Index of the target field
|
type | string: classifier | regressor | Without it, regressor for a numeric target and classifier otherwise
|
candidates required | array<ModelExperimentCandidateRequest> | |
training_configuration | object | The split shared by every candidate
|
scaling | object | Scaling of the inputs, as in the creation of a model (count-based naive Bayes candidates get minmax instead of standard or robust)
|
feature_selection | object | Feature selection, as in the creation of a model
|
nlp_config | object | Text classifiers: the column of text and its settings, as in the creation of a model
|
from_model | string | The model the comparison starts from («Try other methods with this data»), to link them
|
lang | string: es | en | Language of the explanations of the winner
|
Responses
- 200 The comparison and its task
- 400 BAD_NAME, BAD_DESCRIPTION, BAD_TYPE, BAD_CANDIDATES, TOO_FEW_CANDIDATES, TOO_MANY_CANDIDATES (details.limit), DUPLICATE_CANDIDATE, UNKNOWN_METHOD, METHOD_NOT_AVAILABLE, BAD_INPUTS, INPUT_NOT_FOUND, INPUT_IS_TARGET, INPUTS_WITHOUT_TEXT, INPUTS_NOT_AVAILABLE, BAD_SPLIT or SOURCE_EXTERNAL
- 401 Invalid authorization
- 403 Access denied, or LIMIT (size, task time or parallel tasks of the plan)
- 404 Workspace, source (SOURCE_NOT_FOUND) or target (TARGET_NOT_FOUND) not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/model-experiments" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/model-experiments/{experimentId}
A comparison of methods: its status (pending, running, done = waiting for a choice, chosen, expired, failed, history = imported), the shared split, and per candidate its method and settings, its columns, its status (and the error of one that failed), its metrics (classifier: accuracy and f1, macro average; regressor: r2 and mae), those of the naive prediction (baseline, with source: ai-module or platform), the gain over it in the main metric, how much smaller its error is (regressors, when known), the training time and the size. primary_metric is the figure they are compared by (r2; accuracy, or f1 when the classes of the test rows are unbalanced); recommended is the candidate with the best one, ties (less than half a point) going to the simpler method and then to the faster one (recommended_reason: best, tie_simpler, tie_faster, only); beats_baseline false means no candidate beats the naive prediction. An AI application connected through MCP never gets the class the naive prediction answers. Needs a token that reads workspaces and permission to read the models.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
experimentId required | path | string | Identifier of the comparison
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Responses
- 200 The comparison
- 401 Invalid authorization
- 403 Access denied, or the AI data policy refuses it (AI_POLICY_*)
- 404 Workspace or comparison not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/model-experiments/<experimentId>" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/model-experiments/{experimentId}/winner
Picks the winner of a finished comparison (status done): the candidate becomes a normal model, with the identifier it has in the AI module, its configuration, its evaluation and the fields of the source when it was trained, and the other candidates are deleted from the AI module (they were never models). Picking the same candidate again answers the same model. Needs a token that writes workspaces and permission to create models.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
experimentId required | path | string | Identifier of the comparison
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Request body application/json
| Field | Type | Description |
|---|
candidate required | string | Key of the candidate (c1, c2...)
|
Responses
- 200 The model the winner became
- 401 Invalid authorization
- 403 Access denied, or LIMIT (size of the plan)
- 404 Workspace or comparison not found, or CANDIDATE_NOT_FOUND
- 409 NOT_FINISHED, ALREADY_CHOSEN (another candidate was picked), CANDIDATE_NOT_TRAINED, CANDIDATES_EXPIRED (not picked in 7 days) or NO_CANDIDATES
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/model-experiments/<experimentId>/winner" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/models/{modelId}/retrain-schedule
The automatic retraining of a classifier or a regressor («Reentrenamiento automático»; a forecast keeps its own retraining: supported: false). mode: off (never by itself: the default of every model, also the existing ones), schedule (every day, week or month in a window of hours, in the time zone of the organization or its own timezone), data (when the training source has at least min_new_rows new rows, or min_growth more rows as a share, since the data the version in use learned from: its source version), drift (when the monitoring of the model reaches «alert»). timezone is the one in use, next_run when the window starts next (schedule) or when the condition is looked at again (data, drift), last_started and last_task the last retraining it started, last_result and history what happened: started, skipped (reason: SOURCE_COLUMNS_CHANGED, RETRAIN_RUNNING, LIMIT, SOURCE_UNCHANGED, ONCE_A_DAY or another code of the retraining; the same skip again is counted in count), candidate (the new version waits for a person; reason why it was not promoted by itself: auto_off, not_same_rows, not_enough, worse), promoted (by itself, with version, previous to go back to it with POST …/versions/{previous}/promote, and the comparison) or failed; catch_up when it ran after the platform missed its window (once, never once per window missed). state gives each condition now: data (base_rows, rows, new_rows, growth, changed, met) and monitoring (enabled, status). At most one retraining by itself a day per model; each one is a task whose time counts like any training, within the limits of the plan. same_rows says whether the AI module measures both versions on the same rows (needed to promote by itself). Requires the read_models permission. For an AI application connected through MCP, the gate «aggregates» of the AI data policy, without who set it up.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Responses
- 200 The schedule of the model
- 401 Invalid authorization
- 403 Access denied, or AI_POLICY_* for an AI application
- 404 Workspace or model not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/retrain-schedule" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
PUT /api/v1/workspace/{workspaceId}/models/{modelId}/retrain-schedule
Changes the automatic retraining of a classifier or a regressor: only what is sent changes. With auto_promote: true a new version is promoted by itself only when it was measured on the same rows as the version in use (gimodeler 0.20 with /score; never on each version's own evaluation) and its main metric (F1 macro or accuracy for a classifier, R² for a regressor) improves at least min_gain (a share: 0.01 = 1 %, the default; 0 or more); otherwise it waits as a candidate, with a notice in the bell of the owner and of who set it up, the activity of the workspace and, when the owner has the emails of alerts on, an email. Every automatic promotion is written down with its comparison and can be undone with POST …/versions/{version}/promote. Requires the model_edit permission (or being the owner of the model) and the task permission. Answers the schedule as GET does.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Request body application/json
| Field | Type | Description |
|---|
mode | string: off | schedule | data | drift | |
settings | ModelRetrainScheduleSettings | |
Responses
- 200 The schedule of the model
- 400 BAD_REQUEST, UNKNOWN_KEY, BAD_MODE, BAD_SETTINGS, BAD_EVERY, BAD_WEEKDAY, BAD_DAY, BAD_HOUR, BAD_TIMEZONE, BAD_NEW_ROWS, BAD_GROWTH, NO_CONDITION (mode data without min_new_rows nor min_growth), BAD_AUTO_PROMOTE, BAD_MIN_GAIN or UNSUPPORTED_MODEL (forecasts and unsupervised models)
- 401 Invalid authorization
- 403 ACCESS_DENIED, or AI_POLICY_* for an AI application
- 404 Workspace or model not found
Example
curl -X PUT "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/retrain-schedule" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/models/{modelId}/trust-report
Trust report of a model, to help document it as an AI system (Regulation (EU) 2024/1689): intended purpose (written by the organization), data used (source, version, rows, columns and the personal data found, as field names and kinds, never values), method, evaluation and quality verdict, global importance of the inputs, known limits, monitoring and drift, versions, who changed what, human oversight (written by the organization) and where it runs. The risk category is the one the organization chose in its register of AI systems; the platform does not classify. It does not certify compliance and is not legal advice. JSON by default; format=markdown returns a Markdown document and format=pdf a PDF (an HTML document, with the header X-Report-Format: html, when the installation cannot print PDF). Read only. Requires the read_models permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
modelId required | path | string | Identifier of the model
|
x-auth-token required | header | string | Autentication token
|
format | query | string: json | markdown | pdf | Response format: json (default), markdown or pdf
|
lang | query | string: es | en | Language of the texts: es (default) or en
|
Responses
- 200 Trust report
- 401 Error
- 403 Error
- 404 Error
- 503 Too many PDF documents are being prepared (PDF_BUSY); try again after Retry-After
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/models/<modelId>/trust-report" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
GET /api/v1/workspace/{workspaceId}/flows
«Flujos»: the flows of the workspace (decisions that run by themselves: when a source is updated or every N hours, retrain a model when due, predict the new rows, evaluate a condition and act by email, signed webhook or rows written to another source), newest change first, each with last_outcome (the status of its last run). Requires the read permission. For an AI application connected through MCP, the gate «structure» of the AI data policy, without who made or changed them.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Responses
- 200 The flows
- 401 Invalid authorization
- 403 Access denied, or AI_POLICY_* for an AI application
- 404 Workspace not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/flows" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/flows
Creates a flow, off unless enabled: true (switched on, the rows the source has then do not count as new). retrain: never, if_due (when the training source has data the model did not learn from, at most once a day) or always; the retraining is the task of «Versiones» and the new version is used only when its quality verdict is not not_better_than_naive and not worse than the version in use (nor worse on the same rows); otherwise the version in use is kept, the new one waits as a candidate, the owner is told and the run ends guarded without acting. condition: all, rules (on the columns of the source and the columns the model adds, such as <target>_predicted and <target>_predicted_probability; the operators of the alerts) or alert (an alert of the trigger source). At most 3 actions, one of each type: email (to: me, members or list: the notice list of the workspace, all of it or the entries in recipients, with the checks of the alerts), webhook (url: https and public only; JSON event flow.fired signed with HMAC-SHA256 in x-signature-256, as the alert webhooks) and append (target: a source of the workspace that can be edited; columns taken by name, flow_run_at gets the time of the run). Limits: 2 flows per workspace on the free plan (20 on paid plans), 4 runs per flow and hour, 10 tests per hour, 5 runs with actions a day on the free plan (48 on paid), 1000 rows predicted per run. Requires the ws_edit and task permissions. Answers the flow; webhook_secret only when one was made (shown once).
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Request body application/json
| Field | Type | Description |
|---|
name | string | |
description | string | |
enabled | boolean | |
trigger | object | |
model | string | A classifier, regressor, clustering or outlier model of the workspace; empty: the condition is on the data only
|
retrain | string: never | if_due | always | |
condition | object | |
actions | array<object> | |
rotate_secret | boolean | |
Responses
- 200 The flow
- 400 BAD_REQUEST, UNKNOWN_KEY, BAD_NAME, BAD_TRIGGER, BAD_SCHEDULE, BAD_RETRAIN, BAD_CONDITION, BAD_ACTIONS, BAD_RECIPIENTS, LIST_EMPTY, RECIPIENT_NOT_FOUND, SOURCE_NOT_FOUND, MODEL_NOT_FOUND, MODEL_NOT_SUPPORTED, INPUTS_MISSING, ALERT_NOT_FOUND, TARGET_NOT_FOUND, TARGET_NOT_EDITABLE, WEBHOOK_URL_INVALID, WEBHOOK_PRIVATE_ADDRESS, WEBHOOK_PORT_NOT_ALLOWED or WEBHOOK_HOST_NOT_ALLOWED
- 401 Invalid authorization
- 403 ACCESS_DENIED, LIMIT (flows of the plan), or AI_POLICY_* for an AI application
- 404 Workspace not found
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/flows" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/flows/{flowId}
A flow and its latest runs (runs: how many, 20 by default, 50 at most), each with what every step did (counts, never rows). The webhook is given by its origin only. Requires the read permission. For an AI application connected through MCP, the gate «aggregates».
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
flowId required | path | string | Identifier of the flow
|
runs | query | integer | |
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Responses
- 200 The flow and its runs
- 401 Invalid authorization
- 403 Access denied, or AI_POLICY_* for an AI application
- 404 Workspace or flow not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/flows/<flowId>" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
PUT /api/v1/workspace/{workspaceId}/flows/{flowId}
Changes a flow: only what is sent changes, and every change is a new version (the previous ones are kept in history). rotate_secret: true makes a new signing secret for the webhook (answered once). Requires the ws_edit and task permissions.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
flowId required | path | string | Identifier of the flow
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Request body application/json
| Field | Type | Description |
|---|
name | string | |
description | string | |
enabled | boolean | |
trigger | object | |
model | string | A classifier, regressor, clustering or outlier model of the workspace; empty: the condition is on the data only
|
retrain | string: never | if_due | always | |
condition | object | |
actions | array<object> | |
rotate_secret | boolean | |
Responses
- 200 The flow
- 400 The codes of POST …/flows
- 401 Invalid authorization
- 403 ACCESS_DENIED, or AI_POLICY_* for an AI application
- 404 Workspace or flow not found
Example
curl -X PUT "https://app.air-core.io/api/v1/workspace/<workspaceId>/flows/<flowId>" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG" \
-H "Content-Type: application/json" -d @body.json
GET /api/v1/workspace/{workspaceId}/flows/{flowId}/runs
The runs of a flow, newest first (limit, 50 at most; the last 50 are kept). Requires the read permission.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
flowId required | path | string | Identifier of the flow
|
limit | query | integer | |
x-auth-token required | header | string | Authentication token (reads workspaces)
|
Responses
- 200 The runs
- 401 Invalid authorization
- 403 Access denied, or AI_POLICY_* for an AI application
- 404 Workspace or flow not found
Example
curl -X GET "https://app.air-core.io/api/v1/workspace/<workspaceId>/flows/<flowId>/runs" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"
POST /api/v1/workspace/{workspaceId}/flows/{flowId}/test
«Probar ahora»: goes through the flow with the new rows of its source (or, when there are none, its last 20 rows) and tells what each step would do (would_run, would_send, would_write), without starting a retraining, sending or writing anything. Recorded as a run with dry_run: true. preview: the first rows that meet the condition (left out for an AI application). At most 10 tests per flow and hour (429 RATE_LIMIT). Requires the ws_edit and task permissions.
Parameters
| Name | In | Type | Description |
|---|
workspaceId required | path | string | Identifier of the workspace
|
flowId required | path | string | Identifier of the flow
|
x-auth-token required | header | string | Authentication token (writes workspaces)
|
Responses
- 200 The test
- 401 Invalid authorization
- 403 ACCESS_DENIED, or AI_POLICY_* for an AI application
- 404 Workspace or flow not found
- 429 RATE_LIMIT
Example
curl -X POST "https://app.air-core.io/api/v1/workspace/<workspaceId>/flows/<flowId>/test" \
-H "x-auth-token: $AIRCORE_TOKEN" \
-H "x-organization: $AIRCORE_ORG"