Skip to content

Authentication

View as Markdown

The base address of the API is:

https://towers-api.vinsa.dev

The public operations POST /towers, POST /placements and POST /recoveries require an API key. Send it with every request in the Authorization header:

Terminal window
curl "https://towers-api.vinsa.dev/api/v1/towers" \
-H "Authorization: Bearer twr_..." \
-H "Content-Type: application/json" \
-d @program.json

If your HTTP client makes the Authorization header awkward, X-API-Key: twr_... is accepted as well. Send one or the other.

A request with no key, an unknown key, or a revoked key gets 401:

{
"message": "This API key is not valid or has been revoked.",
"error": "Unauthorized",
"statusCode": 401
}
Message Cause
An API key is required. Send it as "Authorization: Bearer <key>". No key in either header.
This API key is not valid or has been revoked. The key is mistyped, was revoked, or belongs to a different deployment.

The API is built for server-to-server calls. A key placed in browser code is visible to every visitor, and browsers on other sites are blocked from calling the API in any case. Put the call in your backend and send the result to your page, as shown in the Next.js and existing portal guides.