Skip to content

API endpoints ​

An API Endpoint is one operation of a service: its method, its path, and what goes in and comes out. Endpoints live inside a container, on its Components level.

An endpoint inside a container, its panel, and the request and response in the contract editor.
  1. Open a container with the magnifier on its block.
  2. Press Add block and choose API Endpoint. The menu also has two endpoint presets, GET Endpoint and POST Endpoint.
  3. A block appears with the method and the path on it, GET /api/resource to begin with. Click it to open its panel.

The endpoint's panel ​

FieldWhat to fill in
NameAt the top of the panel. A short name for the operation, for example "Create payment".
DescriptionOne line on what the call does.
MethodGET, POST, PUT, PATCH, DELETE, HEAD or OPTIONS for HTTP; WS or WSS for a WebSocket; GRPC for a gRPC call; SOAP for a SOAP operation. The list is grouped by these kinds.
PathWhere the call goes, for example /api/payments/:id. For gRPC the field is called RPC path and takes /package.Service/Method.
Request and ResponseThe contract of each side. Click the row to open its editor.

The fields under Path change with the method:

  • HTTP. The request editor has tabs Path, Query, Headers and Body. Each parameter has a name, a type, an example, a description and a required flag. Parameters written in the path (:id) can be added in one click. The body can be JSON or text, with an example and an optional JSON Schema. The response editor holds one card per status code, each with its headers and body; describe the failures as well as the success.
  • WebSocket. The two rows become Client → server and Server → client: a list of messages in each direction, each with a name, a description and a payload.
  • gRPC. Request message and Response message take protobuf, with the message name and whether the side is streaming (unary, client streaming, server streaming, bidirectional).
  • SOAP. SOAPAction, then the request and response envelopes as XML. Only well-formed XML is saved.

Tags & group work as for other elements. Press Save.

Importing and exporting OpenAPI ​

You do not have to enter endpoints one by one. On the Containers level, right-click a container and choose Add → Import OpenAPI, then pick a JSON or YAML file. Its operations become endpoints of that container; ones that already exist are updated.

A container with endpoints shows a contract badge on its block ("API contract — 3 endpoints"). It opens the whole contract of the service, with Export OpenAPI.

Endpoints can also be shown inside a documentation page: see Project documentation.