Technical reference for the Bottin REST API endpoints. All API endpoints require authentication unless otherwise noted.
http://localhost:8080
API endpoints use HTTP Basic authentication. Provide credentials via the Authorization header:
Authorization: Basic base64(username:password)
Resolves NIP-05 identities. Public endpoint - no authentication required.
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | Username to resolve |
Response:
{
"names": {
"alice": "pubkey-hex-string"
},
"relays": {
"pubkey-hex-string": ["wss://relay.example.com"]
}
}Example:
curl "http://localhost:8080/.well-known/nostr.json?name=alice"List all NIP-05 records with pagination.
Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
page |
int | 0 | Page number |
size |
int | 20 | Page size |
Response: Paginated list of records.
Get a specific record by ID.
Get a record by NIP-05 identifier (e.g., alice@example.com).
Create a new NIP-05 record.
Request Body:
{
"username": "alice",
"domain": "example.com",
"pubkey": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
"relays": ["wss://relay.example.com"]
}Update an existing record.
Request Body:
{
"relays": ["wss://new-relay.example.com"],
"enabled": true
}Delete a record.
Toggle the enabled status of a record.
List domains with pagination.
List all domains without pagination.
Get a domain by ID.
Get a domain by name.
Create a new domain.
Request Body:
{
"name": "example.com",
"ownerPubkey": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"
}Delete a domain.
List all verified domains.
List all unverified domains.
Initiate domain verification.
Request Body:
{
"method": "DNS_TXT"
}Get verification status for a domain.
Attempt to verify a domain using the previously initiated method.
Initiate and attempt verification with a specific method (DNS_TXT or HTTP_FILE).
Verify an external NIP-05 identifier.
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
nip05 |
string | Yes | NIP-05 identifier to verify |
Response:
{
"nip05": "alice@example.com",
"valid": true,
"pubkey": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
"relays": ["wss://relay.example.com"]
}All errors follow this format:
{
"timestamp": "2024-01-15T10:30:00Z",
"status": 400,
"errorCode": "VALIDATION_ERROR",
"message": "Description of the error",
"path": "/api/v1/records"
}| Code | Description |
|---|---|
| 200 | Success |
| 201 | Created |
| 204 | No Content (successful deletion) |
| 400 | Bad Request (validation error) |
| 401 | Unauthorized |
| 404 | Not Found |
| 409 | Conflict (duplicate record) |
| 500 | Internal Server Error |
When enabled, interactive API documentation is available:
- OpenAPI Spec: http://localhost:8080/v3/api-docs
- Swagger UI: http://localhost:8080/swagger-ui.html
Enable with environment variables:
BOTTIN_API_DOCS_ENABLED=true
BOTTIN_SWAGGER_ENABLED=true