Import from OpenAPI / Swagger
Import from OpenAPI / Swagger
If you already describe your API with an OpenAPI 3.x or Swagger 2.0 specification, you do not have to recreate every endpoint by hand in LoadFocus. Import the spec and LoadFocus generates one API monitor per operation — method, URL and a status-code assertion — in a single step.
It works with OpenAPI 3.x and Swagger 2.0, in either JSON or YAML, and it runs entirely inside your account and active team with your plan limits enforced exactly as in the dashboard.
How it works
- Open API Monitoring and go to the checks list.
- Click Import from OpenAPI.
- Either paste the spec text or give a URL that LoadFocus fetches for you.
- Pick the frequency and whether the imported checks start active.
- Click Import. LoadFocus parses the spec and creates a check for every operation.
For each operation LoadFocus builds:
- the request URL from the spec's
servers(OpenAPI 3) orschemes+host+basePath(Swagger 2), joined with the operation path; - the HTTP method (GET, POST, PUT, PATCH, DELETE …);
- a status-code assertion — the documented success code when the spec declares one, otherwise "status is below 400";
- a readable name from the operation's
operationId(orMETHOD /path).
Path parameters such as /users/{id} are filled in with the parameter's example, default or first enum value when the spec provides one, otherwise a placeholder. Review those checks after import so they point at a real resource.
Source: paste or URL
- Paste — copy your
openapi.json,openapi.yaml,swagger.jsonorswagger.yamlinto the box. JSON and YAML are both accepted. Specs up to a few megabytes are supported. - URL — give the public address of your spec (for example
https://api.example.com/openapi.json). LoadFocus fetches it over HTTPS. Internal or private addresses are rejected.
Base URL
LoadFocus reads the base URL from the spec. If the spec does not declare a server (or you want to point the checks somewhere else, such as a staging host), fill in Base URL override — for example https://api.example.com.
Frequency and activation
- Frequency — how often every imported check runs (5 minutes by default).
- Activate imported checks — when on, the checks start running immediately. Turn it off to import them paused, review them, and activate the ones you want. This is useful when your spec contains write operations (POST, PUT, DELETE) that you do not want a scheduled monitor to call repeatedly.
What you should review after import
- Write operations — a scheduled monitor calls the endpoint on every run. For POST / PUT / PATCH / DELETE operations, confirm you really want them monitored, or import paused and enable only the safe ones.
- Path parameters — make sure substituted values point at a resource that exists.
- Authentication — imported checks have no credentials. Add headers, an API key or a token using secrets and variables so authenticated endpoints return their real status.
- Request bodies — when the spec includes an example body it is used; otherwise the request is sent without one.
Plan limits
Imported checks count against your plan's API-monitor limit, the same as checks you create by hand. If a spec has more operations than your remaining quota, LoadFocus creates as many as fit and reports how many were created and how many were skipped, so nothing is created silently beyond your plan.
Keeping monitors in sync
A one-off import is a fast way to get started. If you want your monitors to stay in lockstep with your API definition over time, manage them as version-controlled files with Monitoring as Code and reconcile them from CI.