Skip to main content

API Overview

The Knowhere API provides a simple interface for document parsing. All endpoints follow RESTful conventions and use JSON for request and response bodies.

Base URL

https://api.knowhereto.ai

Authentication

All requests require an API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

See Authentication for details.

Endpoints

MethodEndpointDescription
POST/v1/jobsCreate a new parsing job
GET/v1/jobs/{job_id}Get job status and results

Request Format

  • Content-Type: application/json
  • Character Encoding: UTF-8
curl -X POST https://api.knowhereto.ai/v1/jobs \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"source_type": "url", "source_url": "https://example.com/doc.pdf"}'

Response Format

All responses follow a consistent structure.

Success Response

{
"job_id": "job_abc123",
"status": "pending",
"source_type": "url",
"created_at": "2025-01-15T10:30:00Z"
}

Error Response

{
"success": false,
"error": {
"code": "INVALID_ARGUMENT",
"message": "source_url is required when source_type is 'url'",
"request_id": "req_xyz789"
}
}

HTTP Status Codes

StatusMeaning
200 OKRequest succeeded
202 AcceptedJob created (for URL source)
400 Bad RequestInvalid request parameters
401 UnauthorizedInvalid or missing API key
403 ForbiddenInsufficient permissions
404 Not FoundResource not found
429 Too Many RequestsRate limit exceeded
500 Internal Server ErrorServer error
503 Service UnavailableService temporarily unavailable

Rate Limiting

API requests are rate-limited per API key:

  • Default limit: 60 requests per minute (RPM)

Rate limit information is included in response headers:

RateLimit-Limit: 60
RateLimit-Remaining: 58
RateLimit-Reset: 1672531200

When rate limited, you'll receive a 429 response:

{
"success": false,
"error": {
"code": "RESOURCE_EXHAUSTED",
"message": "Rate limit exceeded. Please retry after 15 seconds.",
"request_id": "req_abc123",
"details": {
"retry_after": 15
}
}
}

Request IDs

Every response includes a request_id for debugging and support:

{
"error": {
"code": "...",
"message": "...",
"request_id": "req_abc123def456"
}
}

Include this ID when contacting support.

Pagination

Currently, the API does not support listing jobs. Each job must be queried individually using its job_id.

Versioning

The API uses URL path versioning:

https://api.knowhereto.ai/v1/jobs
^^
version

When we release breaking changes, we'll increment the version number. The current version (v1) will remain available and supported.

Next Steps

  • Create Job - Submit documents for parsing
  • Get Job - Check status and retrieve results