Appearance
API Overview
SearchTweak API is a token-based REST API for managing search models and evaluations.
Base URL
Use your deployment host:
text
https://<your-host>/api/v1Examples in this section use:
text
https://searchtweak.local/api/v1Authentication
All endpoints require a team API token via Laravel Sanctum.
http
Authorization: Bearer <API_TOKEN>
Accept: application/jsonHow to Get API Token
Generate/revoke token in the web UI:
- Open
Current Team. - Click
API. - Click
Generate New Token(or revoke existing token and generate a new one). - Copy the token and store it securely (password manager / secret storage).
Important notes:
- The token is shown in plain text only right after generation.
- If token is lost, generate a new one and update your integrations.
- API access is team-scoped and depends on the current team context in UI.
Response Format
- Collections are returned as plain JSON arrays (no
datawrapper). - Resource objects are returned as plain JSON objects.
- Timestamps are ISO-8601 strings.
Common HTTP Statuses
| Code | Meaning |
|---|---|
200 | Success |
201 | Created |
401 | Missing/invalid token |
404 | Entity not found in current team scope |
422 | Validation error or business rule violation |
Typical business-rule error payload:
json
{
"message": "Evaluation is not pending"
}Typical validation error payload (Laravel default):
json
{
"message": "The given data was invalid.",
"errors": {
"scale_type": [
"The selected scale type is invalid."
]
}
}Endpoints
Models
GET /models— list models in current teamGET /models/{id}— get model details
Evaluations
GET /evaluations— list evaluations with optional filtersGET /evaluations/{id}— get evaluation detailsPOST /evaluations— create evaluationPOST /evaluations/{id}/start— queue start jobPOST /evaluations/{id}/stop— queue stop jobPOST /evaluations/{id}/finish— finish evaluation immediatelyDELETE /evaluations/{id}— delete evaluationGET /evaluations/{id}/judgements— export aggregated final grades
Quickstart Flow
GET /modelsand choosemodel_id.POST /evaluations.POST /evaluations/{id}/start.- Poll
GET /evaluations/{id}untilstatus = finished. - Export with
GET /evaluations/{id}/judgements.
Execution Model
POST /evaluations/{id}/startandPOST /evaluations/{id}/stopare asynchronous (queue jobs are dispatched).POST /evaluations/{id}/finishis synchronous (request returns when finish action is completed).
Notes
- API is team-scoped: IDs from another team return
404. - Judge management and judge logs are currently available only in the web UI.