5.2 Authentication & API Keys

All API requests must include a valid API key to be authenticated. You can generate and manage your API keys from your account dashboard. To authenticate, include your API key in the Authorization header of each request using the Bearer token format. Below is a simple example using curl:

curl -X GET https://api.layerz.io/v1/contracts \
  -H "Authorization: Bearer YOUR_API_KEY_HERE" \
  -H "Content-Type: application/json"
 Or, using JavaScript with fetch:

fetch("https://api.layerz.io/v1/contracts", {
  method: "GET",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY_HERE",
    "Content-Type": "application/json"
  }
})
  .then(res => res.json())
  .then(data => console.log(data))
  .catch(err => console.error(err));
Ensure that your API key is kept secret and never exposed in public 
codebases or client-side applications.

Last updated