This page documents the current data-driven API contract of Artificial Interface. Its endpoint patterns are deliberately relational and CRUD-oriented; domain logic and product-specific security rules must be modeled and reviewed separately.
OpenAPI 2.0: Follows the Swagger 2.0 specification and supports APIs based on RESTful principles. The specification provides a standardized, language-independent interface that allows humans and machines to understand a service without access to source code or network traffic.
OpenAPI 3.0: Supports modern OpenAPI standards and adds improvements over version 2.0, including callbacks, links, and more flexible security definitions.
Authentication: Uses API-Key authentication with the key provided in the x-api-key request header. This validates the client through a unique API key.
/schema_name/entity for endpoint paths, enhancing clarity and consistency across the API. This helps in logically organizing the API's resources and makes the endpoints predictable and intuitive to use.200 for successful operations, 400 for bad requests, 401 for unauthorized requests, and 500 for internal server errors.x-database-schema and x-database-table, which are not part of the standard OpenAPI specification. These provide a clear mapping to underlying database structures, making the API more integrated with its backend storage layer.Each data entity includes detailed schema definitions that reflect the relational database model. These definitions describe field types, required fields, unique constraints, and relationships to other entities, helping developers model and use the data correctly.
The generated API exposes POST /transaction as a versioned, ordered and atomic workflow. The
request uses contractVersion: 1 and an explicit steps array; the former
top-level transaction array is rejected.
{
"contractVersion": 1,
"steps": [
{
"id": "create-parent",
"operation": "main.parent.post",
"body": [{ "name": "Parent" }]
},
{
"id": "create-child",
"operation": "main.child.post",
"body": [{ "name": "Child" }],
"bindings": [{
"target": "/0/id_parent",
"source": { "step": "create-parent", "path": "/0/id" }
}]
}
]
}
The GraphQL runtime uses this REST workflow internally for typed nested POST/PATCH mutations, but does not expose a second generic GraphQL transaction mutation. Clients may call the REST endpoint directly.
GET endpoints are designed to retrieve existing data about entities within the API's `schema_name` schema. These endpoints allow clients to query and obtain information on entities based on specific criteria or retrieve details of a particular entity by its identifier.
Get by ID: For querying entities based on criteria or retrieving all entities of a specific type, the GET requests are made to /schema_name/entity. To retrieve a specific entity by its identifier, the request is made to /schema_name/entity/{id}, where `{id}` is the unique identifier of the entity.
Get: Query parameters can be used to filter the list of entities returned by the GET request. Common parameters could be `name`, `email`, `phone`, and date range filters like `created` and `modified`. The use of these parameters allows for refined searches tailored to the client's needs.
Example:
GET /schema_name/entity?name=JohnDoe&email=john@example.com HTTP/1.1
While GET requests primarily focus on retrieving data and may not require a body, it is essential to include any necessary headers for authentication. The x-api-key header should be included with the client's API key for secure access.
GET /schema_name/entity?email=john@example.com HTTP/1.1
Host: 127.0.0.1
x-api-key: YourApiKeyHere
This example demonstrates a GET request to query entities based on the `email` attribute within the `schema_name` schema.
This example illustrates how the generated GET requests are represented in the OpenAPI documentation.
{
"/schema_name/entity": {
"get": {
"x-swagger-router-controller": "GenericController",
"x-database-schema": "schema_name",
"x-database-table": "entity",
"description": "GET",
"operationId": "schema_name.entity.get",
"parameters": [
{
"name": "ID",
"in": "query",
"required": false,
"description": "\"ID\" of entity",
"style": "pipeDelimited",
"schema": {
"type": "array",
"items": {
"type": "integer",
"format": "int64",
"minimum": 1
},
"uniqueItems": true
}
},
{
"name": "STATUS",
"in": "query",
"required": false,
"description": "\"STATUS\" of entity",
"style": "pipeDelimited",
"schema": {
"type": "array",
"items": {
"type": "boolean"
},
"uniqueItems": true
}
},
{
"name": "EMAIL",
"in": "query",
"required": false,
"description": "\"EMAIL\" of entity",
"style": "pipeDelimited",
"schema": {
"type": "array",
"items": {
"type": "string",
"format": "email",
"minLength": 5,
"maxLength": 255,
"pattern": "/^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/"
},
"uniqueItems": true
}
},
{
"name": "NAME",
"in": "query",
"required": false,
"description": "\"NAME\" of entity",
"style": "pipeDelimited",
"schema": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 255
},
"uniqueItems": true
}
},
{
"name": "CREATED",
"in": "query",
"required": false,
"description": "\"CREATED\" of entity",
"style": "pipeDelimited",
"schema": {
"type": "array",
"items": {
"type": "string",
"format": "date-time",
"minLength": 1,
"maxLength": 255
},
"minItems": 1,
"maxItems": 2,
"uniqueItems": true
}
},
{
"name": "MODIFIED",
"in": "query",
"required": false,
"description": "\"MODIFIED\" of entity",
"style": "pipeDelimited",
"schema": {
"type": "array",
"items": {
"type": "string",
"format": "date-time",
"minLength": 1,
"maxLength": 255
},
"minItems": 1,
"maxItems": 2,
"uniqueItems": true
}
},
{
"name": "$select",
"in": "query",
"description": "Specify one or more properties to retrieve (horizontal filtering).",
"required": false,
"style": "pipeDelimited",
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"id",
"status",
"email",
"name",
"created",
"modified"
]
},
"uniqueItems": true
}
},
{
"name": "$orderBy",
"in": "query",
"description": "\"orderBy\": to order the result asc(+) or desc(-) by columns. The '+' prefix is optional.",
"required": false,
"style": "pipeDelimited",
"schema": {
"type": "array",
"items": {
"type": "string",
"enum": [
"-id",
"+id",
"id",
"-status",
"+status",
"status",
"-email",
"+email",
"email",
"-name",
"+name",
"name",
"-created",
"+created",
"created",
"-modified",
"+modified",
"modified"
]
},
"uniqueItems": true
}
},
{
"name": "$offsetId",
"in": "query",
"description": "Set offset by ID",
"required": false,
"schema": {
"type": "integer",
"format": "int64",
"minimum": 0
}
},
{
"name": "$limit",
"in": "query",
"description": "Limit the amount of fetched items and specify the amount of skipped items",
"required": false,
"style": "form",
"explode": false,
"schema": {
"type": "array",
"items": {
"type": "integer",
"format": "int64"
},
"maxItems": 2
}
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/schema_name.entity.get"
}
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
"500": {
"description": "Internal Server Error"
}
},
"summary": "Search and sort entity by its paramters. Pagination can be used also.",
"tags": [
"schema_name.entity"
]
}
}
}
Various filter options are available in the API, designed to offer the flexibility to retrieve data efficiently and effectively. These filtering options include basic filtering, searching by multiple values, range search for dates, LIKE operations on string data types, and combined searches.
Horizontal filtering allows the filtering of attributes before the entity is retrieved.
$select keyword and the needed attribute names to the query parameters in your GET request.GET /entity?$select=email|name|status HTTP/1.1
SELECT email, name, status FROM entity;
Vertical filtering allows for the retrieval of entities based on exact matches of their attributes.
GET request.status, your request could look like this:
GET /entity?status=true HTTP/1.1
SELECT * FROM entity WHERE status = true;
The API supports filtering by multiple values for both numeric and string attributes. This feature enables fetching entities that match any of the specified values.
|) in the query parameters.numberAttribute is either 1, 2, or 3:
GET /entity?numberAttribute=1|2|3 HTTP/1.1
SELECT * FROM entity WHERE numberAttribute IN (1, 2, 3);
Range searches allow you to retrieve entities based on a date range, useful for filtering entities created or modified within specific timeframes.
|). The dates should follow the ZULU time format.GET /entity?created=2023-01-01T00:00:00Z|2023-12-31T23:59:59Z HTTP/1.1
SELECT * FROM entity WHERE created BETWEEN '2023-01-01T00:00:00Z' AND '2023-12-31T23:59:59Z';
The LIKE operation offers pattern matching for string attributes, following the SQL LIKE syntax. It's ideal for searching text fields when you don't have exact match criteria.
% as a wildcard for any sequence of characters, and _ for any single character.name contains "abc" or "xyz":
GET /entity?name=%abc%|%xyz% HTTP/1.1
SELECT * FROM entity WHERE name LIKE '%abc%' OR name LIKE '%xyz%';
The API supports combining multiple filter types in a single query, enabling precise control over the data retrieved.
status of true and a name containing "abc" or "xyz":
GET /entity?created=2023-01-01T00:00:00Z|2023-12-31T23:59:59Z&status=true&name=%abc%|%xyz% HTTP/1.1
SELECT * FROM entity
WHERE created BETWEEN '2023-01-01T00:00:00Z' AND '2023-12-31T23:59:59Z'
AND status = true
AND (name LIKE '%abc%' OR name LIKE '%xyz%');
Efficient data retrieval in applications that handle large volumes of data is crucial. The API implements advanced pagination techniques allowing for effective data management and retrieval by segmenting data into manageable chunks.
This guide assumes that each resource in the API has at a minimum an id and a created column where id is an integer and created a date-time type.
$limit: The maximum number of items to return.$offsetId: Excludes items where the "id" is less than or equal to the specified $offsetId.$orderBy: Specifies the column to sort by. Use - for descending order.GET /schema/table?$limit=10&$offsetId=20&$orderBy=-id HTTP/1.1SELECT * FROM schema.table WHERE id > 20 ORDER BY id DESC LIMIT 10;$limit: A composite parameter where the first number is the page size and the second is the offset count.GET /schema/table?$limit=20,10 HTTP/1.1SELECT * FROM schema.table LIMIT 10 OFFSET 20;$limit: Sets the maximum number of items returned.$orderBy: Determines the order of the results.GET /schema/table?$limit=10&$orderBy=-created&created=2023-03-23|2025-03-23 HTTP/1.1SELECT * FROM schema.table WHERE created BETWEEN DATE('2023-03-23T17:42:00.667Z') AND DATE('2025-03-23T17:42:06.107Z') ORDER BY created DESC LIMIT 10;$offsetId: Functions by excluding records with an ID less than the specified value.$offsetId for Efficiency: More efficient than numeric offsets for large datasets.$limit and $orderBy to finely tune data retrieval.POST endpoints are designed for the creation of new instances of data entities within the API's `schema_name` schema. These endpoints enable clients to submit new data records for creation, expanding the dataset with new entities as needed.
The POST requests target the endpoint following the pattern /schema_name/entity, indicating the creation of new entities within the specified schema. This naming convention ensures that the API's structure remains clear and consistent.
The request body must contain all the necessary attributes required to create new entities, as defined by the entity’s schema. This includes specifying values for all required fields and adhering to any defined data types and constraints.
Batch operations are also supported. Include multiple entities in the request body to create them in a single request.
[
{
"name": "New Entity Name",
"attribute1": "Value1",
"attribute2": "Value2"
},
{
"name": "Another Entity Name",
"attribute1": "Value3",
"attribute2": "Value4"
}
]
Note: Replace "attribute1", "attribute2", etc., with the actual attribute names and values relevant to the entity being created.
Every POST request must include the Content-Type: application/json header to indicate the format of the request body. Authentication is managed through the inclusion of the x-api-key header, containing the API key provided to the client.
This example shows how to construct a POST request to create a new entity within the `schema_name` schema, including specifying attribute names and values.
POST /schema_name/entity HTTP/1.1
Host: 127.0.0.1
Content-Type: application/json
x-api-key: YourApiKeyHere
[{
"name": "New Entity Name",
"attribute1": "Value1",
"attribute2": "Value2"
}]
This example illustrates how the generated POST requests are represented in the OpenAPI documentation.
{
"/schema_name/entity": {
"post": {
"x-swagger-router-controller": "GenericController",
"x-database-schema": "schema_name",
"x-database-table": "entity",
"description": "POST",
"operationId": "schema_name.entity.post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/schema_name.entity.post"
}
}
}
},
"description": "Create entity",
"required": true
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/schema_name.entity.post"
}
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
"500": {
"description": "Internal Server Error"
}
},
"summary": "POST Request to create one or more entity",
"tags": [
"schema_name.entity"
]
}
}
}
The PATCH endpoints are designed to update existing instances of data entities within the API. Unlike PUT, PATCH applies partial modifications to a resource. It requires the "id" of the entity to be included in the request, along with any fields that need updating. This approach allows for the specific fields of an entity to be updated without resubmitting the entire entity.
PATCH requests are made to the endpoint following the pattern /schema_name/entity. This endpoint is used for idempotent operations, where providing the same "id" and data in multiple requests results in the same state of the entity without creating duplicates.
The request body for a PATCH endpoint must include the "id" of each entity being updated, along with the fields that should change. You do not need to include every attribute. The "id" belongs in the body rather than the path because a single request can update multiple items.
[
{
"id": 123,
"name": "Updated Entity Name",
"email": "updated_email@example.com"
},
{
"id": 456,
"name": "Another Updated Entity Name",
"email": "another_updated_email@example.com"
}
]
All PATCH requests must include the Content-Type: application/json header. Authentication is handled through the x-api-key header, which must contain the client's API key.
This example demonstrates a PATCH request that updates specific fields of an entity, using its "id" for identification.
PATCH /schema_name/entity HTTP/1.1
Host: 127.0.0.1
Content-Type: application/json
x-api-key: YourApiKeyHere
[{
"id": 123,
"name": "Updated Entity Name",
"email": "updated_email@example.com"
}]
This example illustrates how the generated PATCH requests are represented in the OpenAPI documentation.
{
"/schema_name/entity": {
"patch": {
"x-swagger-router-controller": "GenericController",
"x-database-schema": "schema_name",
"x-database-table": "entity",
"description": "PATCH",
"operationId": "schema_name.entity.patch",
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/schema_name.entity.patch"
}
}
}
},
"description": "Modify entity",
"required": true
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/schema_name.entity.patch"
}
}
}
}
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
"500": {
"description": "Internal Server Error"
}
},
"summary": "PATCH Request to update one or more entity. A PATCH request is idempotent, updating parts of a resource without full replacement.",
"tags": [
"schema_name.entity"
]
}
}
}
DELETE endpoints are designated for removing existing entities. This operation allows clients to delete specific entities by their unique identifiers, ensuring data that is no longer needed can be appropriately managed and removed.
DELETE requests target the endpoint /schema_name/entity/{id}, where `{id}` is the unique identifier of the entity to be deleted. This convention ensures precise targeting of the entity intended for deletion.
All DELETE requests must include necessary headers for authentication. This typically involves the x-api-key header containing the client's API key, ensuring that only authorized users can delete entities.
DELETE /schema_name/entity/123 HTTP/1.1
Host: 127.0.0.1
x-api-key: YourApiKeyHere
This example illustrates a DELETE request aimed at removing an entity identified by the ID `123` within the `schema_name` schema.
This example illustrates how the generated DELETE requests are represented in the OpenAPI documentation.
{
"/schema_name/entity": {
"delete": {
"x-swagger-router-controller": "GenericController",
"x-database-schema": "schema_name",
"x-database-table": "entity",
"description": "DELETE by ID",
"operationId": "schema_name.entity.deleteById",
"parameters": [
{
"name": "ID",
"description": "Delete entity by ID",
"required": true,
"in": "path",
"style": "simple",
"schema": {
"type": "array",
"items": {
"type": "integer",
"format": "int64",
"minimum": 1
},
"uniqueItems": true
}
}
],
"responses": {
"200": {
"description": "OK"
},
"400": {
"description": "Invalid ID supplied"
},
"401": {
"description": "Unauthorized"
},
"500": {
"description": "Internal Server Error"
}
},
"summary": "DELETE Request to delete one or more entity by ID",
"tags": [
"schema_name.entity"
]
}
}
}
This documentation explains the API structure, supported operations, and data access patterns. It covers CRUD operations, filtering, pagination, authentication, and the versioned transaction workflow so developers can build scalable, data-driven applications on a consistent OpenAPI foundation.
Author: Björn Berger
Email:
bjoernberger.io@gmail.com