HTTP Collections#

Scope: advanced template API surface. This guide consumes REST/RPC endpoints generated by the advanced template — it is not a client for the pgmi deployment CLI.

For ad-hoc API exploration without codegen, generate importable request files from /openapi.json. Download openapi.json with session handles first; see Client generation .

VS Code REST Client (.http files)#

Generate .http files from the spec using jq:

jq -r '
  .paths | to_entries[] | .key as $path |
  .value | to_entries[] |
  "\(.key | ascii_upcase) http://localhost:8080/api\($path)\n\n###\n"
' openapi.json > api-requests.http

Open api-requests.http in VS Code with the REST Client extension. Click “Send Request” above any block.

For authenticated endpoints, add the session cookie. Sign in as the client guide shows (POST /auth/dev-login on a gateway started with DEV_LOGIN=1), send the __Host-session value in a Cookie header and, on a write, the __Host-csrf value as X-CSRF-Token. POST /api/organization-sessions opens an organization session.

### Authenticated request
GET http://localhost:8080/api/me
Cookie: __Host-session=ls_your-login-session-handle

###

Bruno#

Import the OpenAPI spec directly into Bruno:

  1. Open Bruno
  2. Collection > Import Collection
  3. Select OpenAPI V3 as the format
  4. Select the downloaded openapi.json

Bruno creates a request for each operation, organized by path.

IntelliJ / JetBrains#

JetBrains IDEs natively support .http files. Use the same jq recipe above, or import via:

  1. File > New > HTTP Request
  2. Convert from > OpenAPI Specification
  3. Select the downloaded openapi.json

Insomnia / Postman#

Both import OpenAPI specs directly:

  1. Import > File
  2. Select the downloaded openapi.json

Download the spec again and re-import when handlers change.

curl one-liner#

List every endpoint the session may call:

curl -fsS -H "Cookie: __Host-session=$LOGIN_SESSION" -H "x-organization-session: $ORGANIZATION_SESSION" \
  http://localhost:8080/api/openapi.json | \
  jq -r '.paths | to_entries[] | .key as $p | .value | keys[] | "\(. | ascii_upcase) \($p)"'