---
title: "Introduction"
description: "Base URL, authentication, errors and limits."
canonical_url: "https://docs.logstrace.dev/api-reference/overview/introduction"
---
# Introduction

> Base URL, authentication, errors and limits.

## Base URL

```text
https://logstrace.dev/api
```

## Authentication

Send a project [API key](https://docs.logstrace.dev/guides/teams/api-keys) as a bearer token:

```http
Authorization: Bearer lgk_...
```

<table>
<thead>
  <tr>
    <th>
      Status
    </th>
    
    <th>
      Message
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        401
      </code>
    </td>
    
    <td>
      Missing or malformed key, or the key is revoked
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        403
      </code>
    </td>
    
    <td>
      The key doesn't have the access the endpoint needs (for example a read-only key on ingest)
    </td>
  </tr>
</tbody>
</table>

## Requests

- JSON bodies with `Content-Type: application/json`.
- A `Content-Length` header is required; chunked bodies are rejected with `411`.
- Ingest bodies are limited to 2 MB (`413` above that).

## Errors

Every error has the same shape:

```json
{ "statusCode": 400, "statusMessage": "Invalid event. events.3.level: Invalid option" }
```

<table>
<thead>
  <tr>
    <th>
      Status
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        400
      </code>
    </td>
    
    <td>
      The body failed validation. The message names the field
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        401
      </code>
      
       / <code>
        403
      </code>
    </td>
    
    <td>
      See authentication above
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        411
      </code>
    </td>
    
    <td>
      <code>
        Content-Length
      </code>
      
       missing
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        413
      </code>
    </td>
    
    <td>
      Body too large
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        429
      </code>
    </td>
    
    <td>
      Rate limit reached. Wait for the <code>
        Retry-After
      </code>
      
       header (seconds)
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        5xx
      </code>
    </td>
    
    <td>
      Server problem. Retry with backoff
    </td>
  </tr>
</tbody>
</table>

## Rate limits

<table>
<thead>
  <tr>
    <th>
      Endpoint
    </th>
    
    <th>
      Limit
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        POST /api/ingest
      </code>
    </td>
    
    <td>
      1,200 requests per minute per key
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        GET /api/v1/logs
      </code>
      
      , <code>
        GET /api/v1/logs/trace/:id
      </code>
    </td>
    
    <td>
      120 requests per minute per key
    </td>
  </tr>
</tbody>
</table>

Limits are shared across all servers, so spreading requests over machines doesn't raise them. Batch events instead: one request can carry 500.


## Sitemap

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