Skip to main content

REST operations

REST operations also have their specialities, since the request and response types are completely dynamic. For example, an endpoint may receive JSON and reply with XML or a PDF.

Creating a REST operation

Add a new operation by clicking the icon. Next, choose a descriptive name for your operation and hit enter.

If you imported REST API definitions, you can use an imported API operation as a template by clicking the edit button in the operation header.

Changing the request content type

By default, Kreya generates an example request based on the OpenAPI definition. If Kreya cannot find a request definition, the default request content is empty. To change that, click on the request content type tab and select the desired type.

REST multipart form requests

Sending multipart requests with Kreya is pretty easy. Simply select the "Multipart" request type. Then, you can start adding and removing "parts". Note that a "part" must have a name. To delete parts, hover over the part header and click the trash can icon twice.

Path parameters

Path parameters let you parameterize parts of a request URL without editing the path itself. Kreya recognizes any {name} placeholder in the path (single curly braces) as a path parameter. For example, the path

/users/{userId}/orders/{orderId}

defines two path parameters, userId and orderId.

info

A pair of curly braces ({{ ... }}) is reserved for Scriban templating and is not treated as a path parameter. Use single braces ({userId}) for path parameters and double braces ({{ env.userId }}) for templating.

Editing path parameter values

Whenever the path contains placeholders, a "Path params" section appears in the operation's Params tab. Each placeholder is listed as a key with an editable value. Keys cannot be renamed or removed here — they are derived from the path. To add, rename or remove a path parameter, edit the request path itself.

When Kreya sends the request, every {name} placeholder in the path is replaced with the value you entered. Values are URL-encoded automatically, so characters like spaces or / are escaped to produce a valid URL.

Templating in path parameter values

Path parameter values support templating. For example, you can reference an environment variable as the value of a path parameter:

{{ env.userId }}

Inherited path parameter values

When an inherited value is available for a path parameter, for example through directory default settings, it is shown as a greyed-out placeholder in the value field. The inherited value is used as long as the operation does not set its own non-empty value, which always takes precedence.