> ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # List mapping functions > Returns one page of the mapping functions a profile's mapping can call, ordered by function id ascending by default. `search` finds a function by what it does, `id` resolves the functions a mapping already uses, and `nameContains`, `group` and `sort` work as on the other collections. `meta.total` counts the functions matching the filters. A `page` past the last one answers 200 with an empty `data` array. ## OpenAPI ````json GET /platform/api/functions/preview { "openapi": "3.1.0", "info": { "title": "Lobster Platform API", "description": "**PREVIEW:** This API is in preview and under active development. Endpoints and schemas are subject to breaking changes, and backward compatibility is not guaranteed until the API is promoted to a stable version.\n\nREST API of the Lobster Platform for headless clients. Every operation, schema and member of this document carries a description, and the create operations carry complete examples. Each tag links the page of the Lobster documentation that explains its resources.\n\n## Authentication\nFour authentication flows are available. All of them produce a bearer token that must be sent as `Authorization: Bearer ` on every request.\n\n1. **Authorization code with PKCE** (acting as a user; works with Microsoft and other SSO): the steps are in the `OAuth2AuthorizationCode` security scheme.\n2. **OAuth2 Client Credentials** (machine-to-machine): exchange a client id/secret provisioned in the Lobster administration UI at `POST /dw/register/oauth/token` with `grant_type=client_credentials&client_id=&client_secret=`.\n3. **UI Session Bearer Token**: log in via the Lobster web UI, then exchange the session cookie for a token at `GET /auth/sessionBearerToken`.\n4. **Guest User Login Token**: append a GuestUser `loginToken` as a URL query parameter (`?loginToken=`) to establish a session without a password, then retrieve the bearer token the same way.", "version": "preview" }, "servers": [ { "url": "https://platform-beta-test.lobster-cloud.com" } ], "security": [ { "OAuth2": [] }, { "OAuth2AuthorizationCode": [] }, { "SessionBearer": [] } ], "tags": [ { "name": "Channels", "description": "The channels of a partner, the concrete connections a profile uses to receive or send.", "externalDocs": { "description": "Lobster documentation", "url": "https://docs.lobstersoftware.com/docs/en/manage-partners-channels" } }, { "name": "Functions", "description": "The catalogue of mapping functions a profile's mapping can call.", "externalDocs": { "description": "Lobster documentation", "url": "https://docs.lobstersoftware.com/docs/en/functions" } }, { "name": "Partners", "description": "Integration partners, the business parties profiles exchange data with.", "externalDocs": { "description": "Lobster documentation", "url": "https://docs.lobstersoftware.com/docs/en/manage-partners" } }, { "name": "Profiles", "description": "Integration profiles: what data comes in, how it is mapped and where the result goes.", "externalDocs": { "description": "Lobster documentation", "url": "https://docs.lobstersoftware.com/docs/en/profiles" } } ], "externalDocs": { "description": "Lobster documentation", "url": "https://docs.lobstersoftware.com/docs/en/profiles" }, "paths": { "/platform/api/functions/preview": { "get": { "tags": [ "Functions" ], "summary": "List mapping functions", "description": "Returns one page of the mapping functions a profile's mapping can call, ordered by function id ascending by default. `search` finds a function by what it does, `id` resolves the functions a mapping already uses, and `nameContains`, `group` and `sort` work as on the other collections. `meta.total` counts the functions matching the filters. A `page` past the last one answers 200 with an empty `data` array.", "operationId": "listFunctions", "parameters": [ { "name": "page", "in": "query", "description": "Zero-based index of the page to return.", "schema": { "type": "integer", "format": "int32", "default": 0, "minimum": 0 } }, { "name": "size", "in": "query", "description": "Number of entries per page; a value out of range is rejected, not clamped.", "schema": { "type": "integer", "format": "int32", "default": 20, "maximum": 200, "minimum": 1 } }, { "name": "id", "in": "query", "description": "Exact match on the function id. Repeatable — repeated values OR.", "schema": { "type": "array", "items": { "type": "integer", "format": "int32" } } }, { "name": "nameContains", "in": "query", "description": "Case-insensitive substring match on the function name.", "schema": { "type": "string" } }, { "name": "search", "in": "query", "description": "Full-text search: every whitespace-separated token must match, case-insensitively, the function's id, name, group, description or a parameter description; `aggregate` and `sum` also match each other. Results are ranked: all tokens in the name, then in the description, then in the parameters, then any other match (id, group or several fields); `sort` orders within a rank.", "schema": { "type": "string" }, "example": "sum per group" }, { "name": "group", "in": "query", "description": "Exact, case-sensitive match on the function group, e.g. `Date functions`. Repeatable — repeated values OR.", "schema": { "type": "array", "items": { "type": "string" } } }, { "name": "sort", "in": "query", "description": "Sort key; a leading `-` sorts descending. Default: `id` ascending.", "schema": { "type": "string", "enum": [ "id", "-id", "name", "-name" ] } } ], "responses": { "200": { "description": "Functions returned.", "content": { "application/json": { "schema": { "type": "object", "description": "Standard Platform API success envelope. Every response carries exactly one of `data` (success) or `error` (failure) at top level.", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/core.MappingFunction", "title": "MappingFunction" } }, "meta": { "$ref": "#/components/schemas/Meta" } }, "required": [ "data" ] }, "examples": { "One page of functions": { "description": "The envelope as returned: the page in `data`, the paging state in `meta`.", "value": { "data": [ { "id": 454, "name": "last date of month(a)", "description": "Returns last date of month from given date or timestamp 'a'", "group": "Date functions", "resultType": "DATE", "deprecated": false, "parameters": [ { "name": "a", "description": "date or timestamp", "mandatory": false, "secret": false } ] } ], "meta": { "page": 0, "size": 20, "total": 1 } } } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "500": { "$ref": "#/components/responses/ServerError" } } } } }, "components": { "schemas": { "core.MappingFunction": { "type": "object", "description": "A mapping function of this instance, called by `id` from a `core.FunctionConfiguration` in the `functions` chain of a target field or node. Read-only; includes the instance's custom functions.", "properties": { "class": { "type": "string", "const": "core.MappingFunction", "description": "The type of this object, always `core.MappingFunction`. Required where the member it is sent in accepts several types." }, "deprecated": { "type": "boolean", "description": "Whether the function is deprecated: it still runs, but a new profile should not use it." }, "description": { "type": "string", "description": "What the function does and returns.", "examples": [ "Returns last date of month from given date or timestamp 'a'" ] }, "group": { "type": "string", "description": "The group the function belongs to; the `group` query parameter filters on it.", "examples": [ "Date functions" ] }, "id": { "type": "integer", "format": "int32", "description": "The function id a `core.FunctionConfiguration` refers to. Ids from 5000 up are the instance's custom functions and differ between instances.", "examples": [ 72 ] }, "name": { "type": "string", "description": "The name, with the parameters as letters; a parameter in brackets (`[b]`) may be empty but must still be sent.", "examples": [ "last date of month(a)" ] }, "parameters": { "type": "array", "description": "The parameters in order (`a`, `b`, ...), the order of the `functionParameters` of a `core.FunctionConfiguration`, which carries one entry for each, an unused one as an empty `VALUE`.", "items": { "$ref": "#/components/schemas/core.MappingFunctionParameter", "title": "MappingFunctionParameter" } }, "resultType": { "$ref": "#/components/schemas/core.ValueType", "description": "The type of the value the function returns. Absent when it returns any type, or none.", "title": "ValueType" } }, "title": "MappingFunction" }, "Meta": { "type": "object", "additionalProperties": true, "description": "Everything about the response that is not the resource itself. Members may be added over time; ignore the ones you do not recognize.", "properties": { "page": { "type": "integer", "format": "int32", "description": "Zero-based index of the returned page." }, "size": { "type": "integer", "format": "int32", "description": "Number of entries per page." }, "total": { "type": "integer", "format": "int64", "description": "Number of entries across all pages." } } }, "core.MappingFunctionParameter": { "type": "object", "description": "One parameter of a mapping function. Its position in the function's `parameters` is its position in the `functionParameters` of a `core.FunctionConfiguration`.", "properties": { "class": { "type": "string", "const": "core.MappingFunctionParameter", "description": "The type of this object, always `core.MappingFunctionParameter`. Required where the member it is sent in accepts several types." }, "description": { "type": "string", "description": "What the parameter means. Absent where the function does not describe it.", "examples": [ "date or timestamp" ] }, "helper": { "type": "string", "description": "What kind of value the parameter refers to; absent for a plain value. E.g. `CHANNEL_SELECTION` takes a channel id, `PARTNER_SELECTION` a partner id, `PROFILE_SELECTION` a profile name, `CERTIFICATE_SELECTION` a certificate id, `DB_ALIAS_SELECTOR` a database alias, `REGEX_EDITOR` a regular expression, `DATETEMPLATE_HELPER` a Java date pattern, `CHARSET_SELECTION` an encoding name.", "examples": [ "CHANNEL_SELECTION" ] }, "mandatory": { "type": "boolean", "description": "Whether the parameter needs a value. A parameter that is not mandatory may be empty, but must still be sent as an entry of `functionParameters`." }, "name": { "type": "string", "description": "The parameter's letter, as the function's name refers to it: `a` for the first, `b` for the second, and so on.", "examples": [ "a" ] }, "possibleValues": { "type": "array", "description": "The fixed values this parameter accepts, e.g. `[\"hex\", \"base64\", \"raw\"]`, passed as a `VALUE`. Absent when the parameter has no fixed set.", "items": { "type": "string" } }, "secret": { "type": "boolean", "description": "Whether the parameter carries a credential. A `VALUE` in such a position is returned encrypted; send it as `PLAIN:`, or send the encrypted value back unchanged." }, "type": { "$ref": "#/components/schemas/core.ValueType", "description": "The type the function expects. Absent when it accepts any type. A `VALUE` parameter carries numbers and booleans as text.", "title": "ValueType" } }, "title": "MappingFunctionParameter" }, "core.ValueType": { "type": "string", "description": "A value's data type in the mapping: the `dataType` of a source or target field, and the type a mapping function returns or expects. A value is converted to the field's type silently, so a text that is not a number becomes `0` in an `INTEGER` field. The JSON integration unit writes number types as JSON numbers and `STRING` as JSON strings.\n\n- `STRING`: Text. The default for a field.\n- `INTEGER`: A 32-bit whole number.\n- `DOUBLE`: A floating-point number; written without trailing zeros (`7.5`, a whole number as `13.0`), so for a fixed number of decimals use a `STRING` field and format the value.\n- `DATE`: A date; the field's `template`, a Java date pattern such as `dd.MM.yyyy`, sets how a text is parsed (and, with `useTemplate` on a target field, how it is written).\n- `BOOLEAN`: `true` or `false`.\n- `FLOAT`: A single-precision floating-point number.\n- `BIG_DECIMAL`: A decimal number of arbitrary precision, e.g. for amounts.\n- `BIG_INTEGER`: A whole number of arbitrary size.\n- `TIMESTAMP`: A date with time; `template` works as for `DATE`, e.g. `yyyy-MM-dd HH:mm:ss`.\n- `BLOB`: Binary or large content.", "enum": [ "STRING", "INTEGER", "DOUBLE", "DATE", "BOOLEAN", "FLOAT", "BIG_DECIMAL", "BIG_INTEGER", "TIMESTAMP", "BLOB" ], "title": "ValueType" }, "ErrorResponse": { "type": "object", "description": "Standard Platform API error envelope: every failed request carries a single `error` object. Every response carries exactly one of `data` (success) or `error` (failure) at top level.", "properties": { "error": { "$ref": "#/components/schemas/Error", "description": "What went wrong: branch on its `code`, show its `message`, and read `details` for one entry per failed member." } }, "required": [ "error" ] }, "Error": { "type": "object", "description": "The error that made the request fail.", "properties": { "code": { "type": "string", "description": "Stable machine-readable `UPPER_SNAKE` error code for programmatic handling, e.g. `PARTNER_NOT_FOUND`, `VALIDATION_FAILED` or `FORBIDDEN`. New codes may be added over time; treat an unknown code according to the HTTP status class. The HTTP status itself is carried by the status line only, never duplicated here." }, "message": { "type": "string", "description": "Human-readable, non-localized explanation. Branch on `code`, never on this text." }, "details": { "type": "array", "description": "Individual failures within the request, e.g. one entry per violated field.", "items": { "$ref": "#/components/schemas/ErrorDetail" } } }, "required": [ "code", "message" ] }, "ErrorDetail": { "type": "object", "description": "A single failure within the request.", "properties": { "code": { "type": "string", "description": "Stable machine-readable `UPPER_SNAKE` code of this individual failure, e.g. `FIELD_REQUIRED`, `FIELD_INVALID` or `VALUE_OUT_OF_RANGE`." }, "message": { "type": "string", "description": "Human-readable, non-localized explanation of this individual failure." }, "target": { "type": "string", "description": "What this failure refers to, e.g. the violated field." } }, "required": [ "code", "message" ] } }, "responses": { "BadRequest": { "description": "The request could not be understood. `BAD_REQUEST` for a body that does not decode — its `message` names the property at fault — and `VALIDATION_FAILED` with one `details` entry per offending parameter for a malformed request target (an unknown query parameter or sort key). Also `BAD_REQUEST` for a response unit naming a channel this client cannot reference.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "example": { "error": { "code": "BAD_REQUEST", "message": "The request is invalid." } } } } }, "Unauthorized": { "description": "Authentication is required or the supplied credentials are invalid.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "example": { "error": { "code": "UNAUTHORIZED", "message": "Authentication is required to access this resource." } } } } }, "Forbidden": { "description": "The caller lacks the permission for this operation on this resource (`FORBIDDEN`).", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "example": { "error": { "code": "FORBIDDEN", "message": "Access to this resource is denied." } } } } }, "NotFound": { "description": "The requested resource does not exist. The code is resource-specific, e.g. `PARTNER_NOT_FOUND`, `PROFILE_NOT_FOUND` or `CHANNEL_NOT_FOUND`.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "example": { "error": { "code": "PARTNER_NOT_FOUND", "message": "Partner not found: 42" } } } } }, "ServerError": { "description": "An unexpected server error occurred.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" }, "example": { "error": { "code": "INTERNAL_ERROR", "message": "An unexpected error occurred." } } } } } }, "securitySchemes": { "OAuth2": { "type": "oauth2", "description": "OAuth2 client-credentials flow for machine-to-machine access.\nExchange a client id/secret at `/dw/register/oauth/token` for a bearer token, then send it\nas `Authorization: Bearer `. Client credentials are provisioned in the\nLobster administration UI.\n\nThis is the client-credentials token endpoint of the Platform API. `/oauth/token`, the\n`token_endpoint` advertised at `/.well-known/oauth-authorization-server`, serves the authorization\ncode flow of the `OAuth2AuthorizationCode` scheme.", "flows": { "clientCredentials": { "tokenUrl": "/dw/register/oauth/token", "refreshUrl": "/dw/register/oauth/token", "scopes": {} } } }, "OAuth2AuthorizationCode": { "type": "oauth2", "description": "OAuth 2.1 authorization code flow with PKCE, for acting as a signed-in user. It works with Microsoft and other single sign-on providers: the provider only confirms the user's identity to the platform, which then issues its own token.\n\n1. `POST /oauth/register` (no authentication) with the JSON body `{\"redirect_uris\": [\"\"]}` returns a `client_id`. The user's browser has to reach the redirect URI.\n2. Open `/oauth/authorize` in the user's browser with `response_type=code`, `client_id`, `redirect_uri`, `state` and a `code_challenge` with `code_challenge_method=S256`. `state` is a fresh unguessable value per request, and `code_challenge` is the S256 hash of a `code_verifier` freshly generated per request from a cryptographically secure random source (43 to 128 characters, RFC 7636). The user signs in on the platform's login page, and the browser is redirected to the redirect URI with `code` and `state`; a callback whose `state` differs from the one sent is to be rejected.\n3. The code is valid for 30 seconds. Exchange it at `POST /oauth/token`, form-encoded, with `grant_type=authorization_code`, `code`, `redirect_uri`, `code_verifier` and `client_id`.\n4. The answer carries `access_token` (valid 30 minutes), `refresh_token` (valid 48 hours) and `expires_in` **in milliseconds**. Refresh with `grant_type=refresh_token`, `refresh_token` and `client_id`.", "flows": { "authorizationCode": { "authorizationUrl": "/oauth/authorize", "tokenUrl": "/oauth/token", "refreshUrl": "/oauth/token", "scopes": {} } } }, "SessionBearer": { "type": "http", "description": "Bearer token obtained from an authenticated browser or guest-user session.\n\n**Flow 1 — UI login:** Log in via the Lobster web UI at `/`, then call\n`GET /auth/sessionBearerToken` to exchange the session cookie for a bearer token.\n\n**Flow 2 — Guest user login token:** Append a GuestUser `loginToken` as a URL\nquery parameter to the base URL to establish a password-free session:\n```\nGET ?loginToken=\n```\nThen call `GET /auth/sessionBearerToken` to obtain the bearer token.", "scheme": "bearer" } } } } ````