--- title: "REST API: Action block context" slug: "custom-rest-api-action-block-context" status: "update" updated: 2026-11-12T13:56:54Z published: 2026-11-12T13:56:54Z canonical: "docs.lobstersoftware.com/custom-rest-api-action-block-context" --- > ## 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. # REST API: Action block context This topic describes the action block context of a REST API endpoint: declared variables, return value and response type, and endpoint-specific aspects of anonymous access. For an overview of the REST API configuration, see [REST API](https://docs.lobster-world.com/docs/en/custom-rest-api-definition). ## Declared variables (tree view) The tree view to the left of the action block reflects, in its upper area, selected characteristics of the data structure for the endpoint definition. As the last element of the top hierarchy level, the **Declared variables** node appears. It lists all variables for the action block, including type hints. The following variables are declared by the system. You access them in the action block via the [Variable](/v1/docs/en/core-storage-value) value resolver. **NOTE:** If the node contains further declared variables, these originate from configurations in the action block or from the URI definition of the endpoint (see [REST API: URI and URI parameters](https://docs.lobster-world.com/docs/en/custom-rest-api-uri-parameter)). **TIP** During configuration, the tree view partially updates only once you touch the tree. Changed URI parameters, however, appear immediately after you leave the field. | **Variable name** | **Type** | **Description** | **Direction** | | --- | --- | --- | --- | | `requestHeaders` | `Map` | All request headers as a map that assigns `String` values to `String` keys. | Inbound | | `queryParameters` | `Map` | All query parameters from the URL as a map that assigns `String` values to `String` keys. | Inbound | | `response` | `Object` | Data object for the return value. | Outbound | | `responseCode` | `int` | HTTP response status code for the reply. Default on success: `200`. | Outbound | | `responseHeaders` | `Map` | User-defined response headers as a map that assigns `String` values to `String` keys. | Outbound | | `disableContentHandling` | `Boolean` | Controls the handling of a `Content` object as the return value. With `false` (default), the platform returns the payload of a `Content` object assigned to the `response` variable. With `true`, it serializes the `Content` object like any other object, for example, as JSON. | Outbound | | `forceDownload` | `Boolean` | Only relevant when `disableContentHandling` is `false` and `response` is a `Content` object. With `false` (default), the platform sets the `Content-Disposition` header to `inline`. The content is returned directly. With `true`, it sets the header to `attachment`. The content is downloaded. | Outbound | ## Return value and response type You define the regular return value of an endpoint in the action block by assigning it to the `response` variable. The serialization of this data object, specifically the response type, is by default determined by the `Accept` header in the request. EXCEPTION If you assign an object of type **Content** (`Content`) to the `response` variable, no automatic serialization takes place. Instead, the platform returns the payload of the `Content` object. This way, you return any amount of data via [File reference](/v1/docs/en/core-file-reference-content-builder), for example. The platform takes the `Content-Type` header from the `mediaType` field of the `Content` object. **NOTE:** You override this special handling of the **Content** type by assigning `true` to the `disableContentHandling` variable in the action block (see table above). ## Anonymous vs. authorized access For each endpoint, you decide individually via the **Anonymous access** option (`allowAnonymousAccess`) whether access without authorization is possible. The general rules and the platform's behavior for anonymous and authenticated access are described in [Access control for APIs](/v1/docs/en/api-access-control). This section only adds the endpoint-specific aspects. - Review the security aspects of the functionality provided through the action block before releasing an endpoint for anonymous access. - You compensate for the missing session context ([Role of session](/v1/docs/en/base-session-role-value), [Company of session](/v1/docs/en/base-session-company-account-value), [User of session](/v1/docs/en/base-session-user-value)) as needed via the [Run as](/v1/docs/en/base-run-as-actor) event action. - To execute a [Search (Event action)](/v1/docs/en/core-search-actor), you need a [Role of session](/v1/docs/en/base-session-role-value) with read permissions for the entity types being searched. **CAUTION****:** A [Search (Event action)](/v1/docs/en/core-search-actor) with a [Role of session](/v1/docs/en/base-session-role-value) without owner restrictions, such as a "Super User" role, is a security risk. This could allow the anonymous endpoint to grant read access to sensitive data without access control. > [!WARNING] > **IMPORTANT:** > > If you access an endpoint from the same browser in which a **Lobster Data Platform** session is already running, the session cookie automatically takes effect. The call then inherits the existing session context. For genuine anonymous tests, use a private browser window or a REST client independent of the logged-in browser. Otherwise, you authenticate via [OAuth2 for API access](/v1/docs/en/common-login-api-oauth-2). An architecture for web APIs based on HTTP. REST APIs use standard methods such as GET, POST, PUT, and DELETE to access resources. The Lobster Data Platform provides its own REST API and can act as a REST endpoint via an HTTP input agent. JSON (**J**ava**S**cript **O**bject **N**otation) is a lightweight text format for data exchange. The Lobster Data Platform handles JSON in integration profiles, web resources, and API interfaces. Value resolvers convert JSON data to internal objects and vice versa.