# Wisnots Netzanmeldung API v2 > Register an installation with the responsible grid operator, for your own firm or for the installer firms you serve. Base URL https://netz-api.wisnots.com, the key in `Authorization: Bearer`, JSON in and out; a file as `multipart/form-data` on `POST /v2/cases/{id}/documents`. A `wnz_test_` key is the sandbox and a `wnz_live_` key is live, on the same host. Keys come from the console at https://www.wisnots.com/netzanmeldung/portal under Developers. v2 is a second contract over the same cases as v1, which is being retired; v1's index stays at https://www.wisnots.com/netz-api/llms.txt for integrations already on it. ## Workflow 1. `POST /v2/cases` with `type` and what you hold in `declared`. 2. `POST /v2/cases/{id}/documents` per document. 3. Wait for `case.documents_read`, or poll the case until `status` leaves `extracting`. 4. Answer the blocking items of `open[]`: PATCH `resolve.field` under `declared`, or a document with `resolves` set to the item's `code`. 5. `POST /v2/cases/{id}/submit`. 6. After the grid operator's yes: `POST /v2/cases/{id}/commissioning`, then the items of `phase: mastr` and `POST /v2/cases/{id}/mastr/submit`. ## Embedded components Our forms in your own page, as a frame on our origin. List the page in the console (Developers, Connect, Embed), mint a session on your server with `POST /v2/cases/{id}/embed-sessions` or `POST /v2/businesses/{id}/embed-sessions` (`origin`, `components`, `platform_name`), and load `/netz-embed/v2/embed.js` on that page with `fetchClientSecret`. `client_secret` is a bearer credential for its session: hand it only to our frame, never log it, never put it in a URL. It ends after 30 minutes, or sooner when the key is revoked, the page removed or the business deactivated: after a 401 the loader asks `fetchClientSecret` for a new one, while a removed page (403) or a deactivated business (409) ends the frame. Logins are typed in the frame and reach only our server, never your page, your server or an event. The frame writes through v2's own rules as `Einbettung ยท `, and your signals are v2's webhooks. Mint only for a case or business the signed-in user of the page may act on, found in your own records, never by an id the browser sends: the secret opens that case to whoever holds it. Choose by the case's `status`: a draft (`extracting`, `needs_input`, `ready`) takes `["case", "upload"]` and is created as `netz.create('upload')`, which follows it through hand-over, commissioning and MaStR; a handed-over case takes `["case"]` (a draft's form on it is a 422). A business session takes `registrations`, `new-registration`, `firm-data` and `hint`, as its page shows them; `new-registration` makes one case per type in `project.types`, and its `complete` event lists them in `cases`. The loader is `WisnotsNetz.loadEmbeds({ fetchClientSecret, appearance, locale })` returning `{ create(component, options), update({ appearance, locale }) }`; each element takes `setOnLoaded`, `setOnSubmitted`, `setOnChange`, `setOnOpen`, `setOnComplete`, `setOnLoginSaved`, `setOnHint` and `setOnLoadError`, also fired as `netz:`. Styling is `appearance.variables` only: `colorPrimary`, `colorBackground`, `colorText`, `colorTextSecondary`, `colorBorder`, `colorDanger`, `colorSuccess` (CSS colours), `fontFamily`, `fontSizeBase`, `borderRadius`, `spacingUnit` (`px`, `rem` or `em`), plus up to three https font stylesheets in `appearance.fonts`; a value of the wrong form is dropped silently, and there is no custom CSS. If the page sends a Content Security Policy, it allows https://www.wisnots.com in `script-src` and `frame-src`. The "Embedded components" section of llms-full.txt has every option, event and default. ## Routes - `POST /v2/cases`: Open a case - `GET /v2/cases`: List cases - `GET /v2/cases/{id}`: Read a case - `PATCH /v2/cases/{id}`: Change a case - `DELETE /v2/cases/{id}`: Delete a draft - `POST /v2/cases/{id}/documents`: Send a document - `POST /v2/cases/{id}/submit`: Submit a case - `POST /v2/cases/{id}/withdraw`: Withdraw a handed-over case - `GET /v2/requirements`: What a case asks - `POST /v2/cases/{id}/commissioning`: Report the commissioning - `POST /v2/cases/{id}/mastr/submit`: Release the MaStR registration - `POST /v2/businesses`: Add a business - `GET /v2/businesses`: List businesses - `GET /v2/businesses/{id}`: Read a business - `PATCH /v2/businesses/{id}`: Change a business - `POST /v2/businesses/{id}/deactivate`: Deactivate a business - `GET /v2/businesses/{id}/logins`: A business's logins - `POST /v2/businesses/{id}/access-links`: The business's login page - `POST /v2/cases/{id}/embed-sessions`: A session for a case's frame - `POST /v2/businesses/{id}/embed-sessions`: A session for a business's frame - `GET /v2/events`: Every event - `GET /v2/cases/{id}/events`: A case's events - `POST /v2/webhooks`: Register an endpoint - `GET /v2/webhooks`: Your endpoints - `DELETE /v2/webhooks/{id}`: Remove an endpoint - `GET /v2/usage`: Credits used in a month - `GET /v2/invoices`: Your invoices - `GET /v2/invoices/{id}/pdf`: An invoice's PDF - `POST /v2/test_helpers/cases/{id}/advance`: Play a test case's next step - `POST /v2/test_helpers/cases/{id}/grid_operator_reply`: Reply as the grid operator - `POST /v2/test_helpers/cases/{id}/requirements/{code}/resolve`: Answer an item as its owner would - `POST /v2/test_helpers/webhooks/{event}`: Send an event again ## Webhooks - `case.created`: A case exists. Always the first event of a case, whichever version opened it. - `case.updated`: Declared values landed, from a create or a PATCH, the operator was settled, or the end customer's signature was recorded (`signature.state` `signed`). Also when our team edits the case, when a wait for the business's portal login ends, when the case's `group` changes (filed with another, or on its own again), when a number of the grid operator's is cancelled with none in its place, which no other event tells (`references`, `cancelled_at`), and when the register took one unit of the case before the last, or its numbers reached us later (`mastr.devices`, `mastr.units`). - `case.status_changed`: The case's stage changed, also where its `stage.code` stays the same (several of our stages share a code, `ready` and `submitted` among them), and when we added a note to the case's timeline without moving it; v2 carries no note. So a status and a stage can come twice in a row: a question of the grid operator's tells `submitted` once more, as the case waits for its answer. A submit tells `ready` (the hand-over), then `submitted` as the filing reaches the operator, then the answer; on the sandbox all three before the call returns at `sandbox_pace: instant`, a few seconds apart at `staged`. `stage` is the stage the case moved to, as it was then; `case` is as it stands now. - `case.requirements_updated`: Items of the registration came into `open[]`, left it, or changed state, the grid operator's requests among them, also one the sandbox operator asks inside an `instant` submit, which its 202 lists as well; `requirements` names them by code. An answered item is `changed` to `in_review` while its answer is with us and `resolved` once the answer has gone to the operator, told once where both come a moment apart. It watches the items that block, that carry a `code`, that are not `open`, and those a request of the grid operator's asks for: an optional item coming or going before the hand-over may go untold, so read `open[]` itself where you need all of it. The commissioning's items (`phase: commissioning`) and the MaStR registration's (`phase: mastr`) are not named here: they come and go with `case.status_changed`, `case.commissioning_reported`, `case.updated` and `case.mastr_registered`. - `case.documents_read`: Nothing is left to read: the fields are worth reading now. - `case.submitted`: The case was handed to Wisnots, and its credit taken. - `case.commissioning_reported`: The commissioning report went out, once per report, whether from the console, the approval mail's page, the API, or recorded by us where the installer sent it by mail or phone. `case.commissioning` says when the installation went into operation. - `case.mastr_registered`: The Marktstammdatenregister took the case, once: every unit of it, PV and storage (`case.mastr.devices`), however we registered each (on a sandbox key, the rehearsed register). A unit registered before the last is a `case.updated`. `case.mastr.units` carries the numbers where we have them, each by its unit. - `case.reference_added`: The grid operator gave the case a number: its own case number, an offer's, the customer's or a completion notice's. `reference` names it; `case.references` lists them all. - `case.withdrawal_requested`: You asked to withdraw the case, and we recorded it: `case.withdrawal` reads `requested`. `case.status_changed` to `withdrawn` follows once it is withdrawn with the grid operator. - `case.stale`: Nothing happened on the case for ten days, also while the grid operator considers it, and it is not closed (`completed`, `rejected`, `withdrawn`) or archived by us. Once per quiet spell: the next event starts the count again. `case.last_activity_at` says since when. - `case.duplicate_detected`: The case just created is likely an open case of yours again: the same site and the same `type`. `duplicate_of` names that case. Nothing is merged or held. A replay of the same `Idempotency-Key` returns the first case and is no duplicate. - `business.created`: A business exists: added through v2, or named by a v1 case's `installer_ref`. - `business.updated`: Its details or registrations changed: through your PATCH, the embedded `firm-data`, or our team adding or removing a registration from a document (only where that changes `registrations`; `updated_at` moves with it). - `business.deactivated`: It was deactivated. - `business.login_required`: Its login at a grid operator of an open case is missing or stopped working. `requirement` names the operator and what it asks. Told once per move, however many cases it holds up; send the business its access link. - `invoice.created`: A purchase of credits was paid, and its invoice is there. ## Documents - [OpenAPI 3.1](https://www.wisnots.com/netz-api/v2/openapi.json): every route, schema, event and error, rendered at https://www.wisnots.com/en/netzanmeldung/api. - [Full text](https://www.wisnots.com/netz-api/v2/llms-full.txt): the overview and every operation in one file. - [Agent skill](https://www.wisnots.com/netz-api/v2/skills/wisnots-netz-v2/SKILL.md): the workflow and the rules as a SKILL.md, for `.agents/skills/wisnots-netz-v2/` or `.claude/skills/wisnots-netz-v2/`. - [Setup prompt](https://www.wisnots.com/netz-api/v2/agent-prompt.txt): what "Set up your agent" copies in the console and on the reference page. - [TypeScript client](https://www.wisnots.com/netz-api/sdk/README.md): `createNetzClient` from `v2.ts` (`@wisnots/netz/v2`), the same dependency-free client as v1's: `v2.ts`, `client.v2.ts`, `http.ts`, `types.v2.gen.ts`, `webhooks.ts`, `README.md`.