The API Request Logs in your Skribby dashboard provide visibility into every API call made to your organization. Use these logs to debug integration issues, trace failed requests, and understand API behavior.

## Accessing Logs

Navigate to **API Request Logs** in the [Skribby Dashboard](https://platform.skribby.io?to=api-request-logs) to view your recent API activity.

Each log entry shows:

- **Timestamp**: When the request was made
- **Method**: HTTP method (POST, GET, DELETE, etc.)
- **Path**: API endpoint called
- **Status**: HTTP response code
- **Request Body**: What you sent
- **Response Body**: What Skribby returned

## Common HTTP Status Codes

### Success Codes

| Code | Meaning | Notes                            |
| :--- | :------ | :------------------------------- |
| 200  | OK      | Request succeeded                |
| 201  | Created | Resource created (e.g., new bot) |

### Client Error Codes

| Code | Meaning              | Common Causes                         |
| :--- | :------------------- | :------------------------------------ |
| 400  | Bad Request          | Invalid parameters, malformed JSON    |
| 401  | Unauthorized         | Invalid or missing API key            |
| 403  | Forbidden            | Plan limits exceeded, blocked account |
| 404  | Not Found            | Invalid bot/recording ID              |
| 422  | Unprocessable Entity | Validation failed                     |

### Server Error Codes

| Code | Meaning               | Action                               |
| :--- | :-------------------- | :----------------------------------- |
| 500  | Internal Server Error | Retry, contact support if persistent |
| 502  | Bad Gateway           | Temporary issue, retry               |
| 503  | Service Unavailable   | System maintenance, retry later      |

## Debugging Common Issues

### Authentication Errors (401)

**Symptoms:**

```json
{
    "message": "Unauthenticated."
}
```

**Checklist:**

- [ ] API key is included in the `Authorization` header
- [ ] Format is `Bearer YOUR_API_KEY` (note the space after Bearer)
- [ ] API key is not expired or revoked
- [ ] No extra whitespace or newlines in the key

**Correct format:**

```bash
curl -H "Authorization: Bearer sk_live_abc123..." \
  https://platform.skribby.io/api/v1/bot
```

### Validation Errors (400/422)

**Symptoms:**

```json
{
    "message": "The transcription model field is required.",
    "errors": {
        "transcription_model": ["The transcription model field is required."]
    }
}
```

**Common validation issues:**

| Field                 | Issue                     | Fix                                                          |
| :-------------------- | :------------------------ | :----------------------------------------------------------- |
| `transcription_model` | Invalid value             | Check [valid models](https://platform.skribby.io?to=billing) |
| `meeting_url`         | Not a valid URL           | Include full URL with protocol                               |
| `service`             | Doesn't match URL         | Use `gmeet`, `teams`, or `zoom`                              |
| `webhook_url`         | Not HTTPS                 | Use HTTPS URLs only                                          |
| `lang`                | Unsupported language code | Check [language guide](./bot-language.md)                    |

### Plan Limit Errors (403)

**Symptoms:**

```json
{
    "message": "You have reached the limit of concurrent meeting bots for your plan."
}
```

**Possible causes:**

- Too many bots running simultaneously
- Monthly hour limit exceeded (Free plan)
- Transcription model not available on your plan

**Resolution:**

- Wait for active bots to finish
- Upgrade your plan
- Use an available transcription model

## Correlating Requests with Bots

### Using Bot ID

Every successful bot creation returns an `id`:

```json
{
    "id": "3c09b2aa-6708-42c1-8145-aa55ee223613",
    "status": "booting",
    ...
}
```

Use this ID to:

- Fetch bot status: `GET /bot/{id}`
- Fetch bot pricing: `GET /bot/{id}/pricing`
- Stop the bot: `POST /bot/{id}/stop`
- Delete the bot: `DELETE /bot/{id}`
- Correlate webhook events

### Using Custom Metadata

Add `custom_metadata` to track requests in your system:

```json
{
    "transcription_model": "openai/whisper-large-v3",
    "meeting_url": "...",
    "custom_metadata": {
        "internal_id": "meeting-123",
        "user_id": "user-456",
        "source": "calendar-sync"
    }
}
```

Metadata appears in:

- API responses
- Webhook payloads
- Dashboard bot details

## Payload Troubleshooting

### JSON Formatting

**Wrong:**

```bash
curl -d "{'transcription_model': 'openai/whisper-large-v3'}"
```

**Right:**

```bash
curl -d '{"transcription_model": "openai/whisper-large-v3"}'
```

### Content-Type Header

Always include for JSON requests:

```bash
curl -H "Content-Type: application/json" \
  -d '{"..."}' \
  https://platform.skribby.io/api/v1/bot
```

### URL Encoding

Meeting URLs with special characters need proper handling:

```json
{
    "meeting_url": "https://teams.microsoft.com/l/meetup-join/..."
}
```

Don't URL-encode the value inside JSON, the JSON parser handles it.

## Debugging Workflow

1. **Find the failed request**: Look through recent logs for errors
2. **Check the request body**: Verify parameters are correct
3. **Read the response**: Error messages explain what's wrong
4. **Correlate with bot ID**: If the bot was created, check its status
5. **Check webhooks**: Some errors surface in webhook events
6. **Review bot events**: Dashboard shows detailed status history

## Contacting Support

When reaching out to support, include:

- Request timestamp
- Request ID (if shown)
- Bot ID (if applicable)
- Full error message
- What you expected vs. what happened