---
title: "API keys"
description: "Create, store and rotate project keys."
canonical_url: "https://docs.logstrace.dev/guides/teams/api-keys"
---
# API keys

> Create, store and rotate project keys.

Keys belong to one project and start with `lgk_`. Admins and owners manage them under **API keys** in the project.

## Access

<table>
<thead>
  <tr>
    <th>
      Access
    </th>
    
    <th>
      Use for
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Send logs
      </strong>
    </td>
    
    <td>
      Servers and apps. Can only write, so a leaked key can't read your data
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Read logs
      </strong>
    </td>
    
    <td>
      Scripts and tools that query logs through the <a href="https://docs.logstrace.dev/api-reference/endpoints/query-logs">
        read API
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Send and read
      </strong>
    </td>
    
    <td>
      Both
    </td>
  </tr>
</tbody>
</table>

Read keys can also get **Show IPs, emails and tokens**. Only someone who can see those values themselves can give a key that option.

## Storing keys

- The full key is shown **once**. LogsTrace stores only a SHA-256 hash.
- Put it in an environment variable or secret store, never in source code or client-side code (browsers, mobile apps).
- Use one key per service so you can revoke one without touching the others. The list shows when each key was last used.

## Rotating

1. Create a new key and deploy it.
2. Check that **Last used** on the old key stops moving.
3. Revoke the old key. It stops working within a minute.

Creating and revoking keys is recorded in the audit log.


## Sitemap

See the full [sitemap](https://docs.logstrace.dev/sitemap.md) for all pages.
