Overview
The Pwnbook API is a RESTful HTTP API. All requests and responses use JSON. The API is designed to be predictable and consistent — once you understand the patterns used by one endpoint, you’ll find the others work the same way.Base URL
All API endpoints are relative to your Pwnbook instance’s base URL:Versioning
The current API version isv1. All endpoints are prefixed with /api/v1/:
Authentication
All API requests must be authenticated using an API key. Include your API key in theAuthorization header:
Request format
Send request bodies as JSON with theContent-Type: application/json header:
Response format
All responses are JSON objects. Successful responses include adata field containing the response payload:
Error responses
Error responses use standard HTTP status codes and include a JSON body with details:| HTTP Status | Code | Description |
|---|---|---|
| 400 | BAD_REQUEST | The request body or parameters are invalid |
| 401 | UNAUTHORIZED | API key is missing or invalid |
| 403 | FORBIDDEN | The API key doesn’t have permission for this action |
| 404 | NOT_FOUND | The requested resource doesn’t exist |
| 409 | CONFLICT | A conflict with existing data (e.g., duplicate name) |
| 422 | VALIDATION_ERROR | Request data failed validation |
| 429 | RATE_LIMITED | Rate limit exceeded |
| 500 | INTERNAL_ERROR | An unexpected server error occurred |
Rate limiting
API requests are rate-limited per API key. Rate limit headers are included in every response:| Header | Description |
|---|---|
X-RateLimit-Limit | Total requests allowed per window |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp when the rate limit window resets |
429 Too Many Requests response. Implement exponential backoff and retry logic in your client.
Pagination
List endpoints support cursor-based and page-based pagination. Passpage and perPage query parameters:
perPage is 20. Maximum perPage is 100.