# CompanyAuthorizationLink

**Beta:**
Salaxy API v04 is in beta: it may change, and it is not used in production yet. Build on v03, the current version.

PARTNERS: Creates the links that send a company representative to the authorization flow. The partner account is read from the credentials of the caller, not from the request, so the end user's address bar carries nothing that would change who is being authorized. Test environments additionally have an anonymous variant that names the partner in the request; only link creation differs between the environments, never the flow itself.

Salaxy API v04 (beta), **Finland only**. 2 operations. Interactive version: [REST API reference](https://code.salaxy.com/reference/rest-api-v04.md). Machine-readable: [OpenAPI document](https://code.salaxy.com/openapi/salaxy-04.json).

**The reference wins:**
These pages are generated from the OpenAPI document. If a guide and this reference disagree about a field, follow the reference. Error responses are not in the document — see [Errors](https://code.salaxy.com/reference/errors.md).

## `POST /v04/api/company-authorization/link`

**Creates a start link for the generic company authorization flow.
The link may be sent to the company representative or opened from the partner's own service.**

Request body: `IamStartLinkRequest` (required)

Response: `IamStartLinkResponse`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api-v04.md#tag/companyauthorizationlink/POST/v04/api/company-authorization/link)

## `POST /v04/api/company-authorization/link/test`

**Test environments only: Creates a start link without credentials, naming the partner in the
request. This is the one difference between test and production: The flow that the link
starts is identical, so what is tested is what ships.**

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `partnerAccountId` | query | string |  | Account id of the partner that the authorization is granted to. Kept out of IamStartLinkRequest on purpose, so that the authenticated endpoint above cannot be made to accept one. |

Request body: `IamStartLinkRequest` (required)

Response: `IamStartLinkResponse`

Try it: [interactive reference](https://code.salaxy.com/reference/rest-api-v04.md#tag/companyauthorizationlink/POST/v04/api/company-authorization/link/test)
