curl --request POST \
--url https://api.usehasp.com/v1/solve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"resources": [
"<string>"
],
"slots": [
"<string>"
],
"resources_from": "<string>",
"slots_from": "<string>",
"options": {
"time_limit_seconds": 15
}
}
'import requests
url = "https://api.usehasp.com/v1/solve"
payload = {
"resources": ["<string>"],
"slots": ["<string>"],
"resources_from": "<string>",
"slots_from": "<string>",
"options": { "time_limit_seconds": 15 }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
resources: ['<string>'],
slots: ['<string>'],
resources_from: '<string>',
slots_from: '<string>',
options: {time_limit_seconds: 15}
})
};
fetch('https://api.usehasp.com/v1/solve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usehasp.com/v1/solve",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'resources' => [
'<string>'
],
'slots' => [
'<string>'
],
'resources_from' => '<string>',
'slots_from' => '<string>',
'options' => [
'time_limit_seconds' => 15
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.usehasp.com/v1/solve"
payload := strings.NewReader("{\n \"resources\": [\n \"<string>\"\n ],\n \"slots\": [\n \"<string>\"\n ],\n \"resources_from\": \"<string>\",\n \"slots_from\": \"<string>\",\n \"options\": {\n \"time_limit_seconds\": 15\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.usehasp.com/v1/solve")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"resources\": [\n \"<string>\"\n ],\n \"slots\": [\n \"<string>\"\n ],\n \"resources_from\": \"<string>\",\n \"slots_from\": \"<string>\",\n \"options\": {\n \"time_limit_seconds\": 15\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usehasp.com/v1/solve")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"resources\": [\n \"<string>\"\n ],\n \"slots\": [\n \"<string>\"\n ],\n \"resources_from\": \"<string>\",\n \"slots_from\": \"<string>\",\n \"options\": {\n \"time_limit_seconds\": 15\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"object": "solve_result",
"status": "optimal",
"assignments": [
{
"slot_id": "2026-08-03-day-rn",
"resource_ids": [
"Riley Nguyen"
]
}
],
"objective": 0,
"conflicts": [],
"stats": {
"wall_time_ms": 42,
"seed": 0
},
"engine": "cp-sat"
}
}{
"success": false,
"error": {
"type": "authentication",
"code": "INVALID_API_KEY",
"message": "Bearer token is missing, malformed, or revoked.",
"param": null,
"details": null,
"retryable": false,
"request_id": "01JQREQ7XZQK5N6PZ1VVXHYB8T"
},
"meta": {
"request_id": "01JQREQ7XZQK5N6PZ1VVXHYB8T"
}
}{
"success": false,
"error": {
"type": "permission",
"code": "MISSING_SCOPE",
"message": "The caller is authenticated but lacks the scope or capability this route requires.",
"param": null,
"details": null,
"retryable": false,
"request_id": "01JQREQ7XZQK5N6PZ1VVXHYB8T"
},
"meta": {
"request_id": "01JQREQ7XZQK5N6PZ1VVXHYB8T"
}
}{
"message": "<string>",
"errors": {}
}{
"success": false,
"error": {
"type": "rate_limited",
"code": "RATE_LIMITED",
"message": "Rate limit exceeded (per-key, per-org, or daily cap, depending on which limiter tripped).",
"param": null,
"details": null,
"retryable": true,
"request_id": "01JQREQ7XZQK5N6PZ1VVXHYB8T"
},
"meta": {
"request_id": "01JQREQ7XZQK5N6PZ1VVXHYB8T"
}
}Solve a deterministic constraint-satisfaction / assignment problem
optimal/feasible/infeasible all return HTTP 200 — infeasible
carries the conflicting-constraint subset in data.conflicts, never a
4xx/5xx. A spec the solver rejects against its closed vocabulary
returns 422; the solver sidecar being unreachable returns 503.
POST /v1/solve
curl --request POST \
--url https://api.usehasp.com/v1/solve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"resources": [
"<string>"
],
"slots": [
"<string>"
],
"resources_from": "<string>",
"slots_from": "<string>",
"options": {
"time_limit_seconds": 15
}
}
'import requests
url = "https://api.usehasp.com/v1/solve"
payload = {
"resources": ["<string>"],
"slots": ["<string>"],
"resources_from": "<string>",
"slots_from": "<string>",
"options": { "time_limit_seconds": 15 }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
resources: ['<string>'],
slots: ['<string>'],
resources_from: '<string>',
slots_from: '<string>',
options: {time_limit_seconds: 15}
})
};
fetch('https://api.usehasp.com/v1/solve', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usehasp.com/v1/solve",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'resources' => [
'<string>'
],
'slots' => [
'<string>'
],
'resources_from' => '<string>',
'slots_from' => '<string>',
'options' => [
'time_limit_seconds' => 15
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.usehasp.com/v1/solve"
payload := strings.NewReader("{\n \"resources\": [\n \"<string>\"\n ],\n \"slots\": [\n \"<string>\"\n ],\n \"resources_from\": \"<string>\",\n \"slots_from\": \"<string>\",\n \"options\": {\n \"time_limit_seconds\": 15\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.usehasp.com/v1/solve")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"resources\": [\n \"<string>\"\n ],\n \"slots\": [\n \"<string>\"\n ],\n \"resources_from\": \"<string>\",\n \"slots_from\": \"<string>\",\n \"options\": {\n \"time_limit_seconds\": 15\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usehasp.com/v1/solve")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"resources\": [\n \"<string>\"\n ],\n \"slots\": [\n \"<string>\"\n ],\n \"resources_from\": \"<string>\",\n \"slots_from\": \"<string>\",\n \"options\": {\n \"time_limit_seconds\": 15\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"object": "solve_result",
"status": "optimal",
"assignments": [
{
"slot_id": "2026-08-03-day-rn",
"resource_ids": [
"Riley Nguyen"
]
}
],
"objective": 0,
"conflicts": [],
"stats": {
"wall_time_ms": 42,
"seed": 0
},
"engine": "cp-sat"
}
}{
"success": false,
"error": {
"type": "authentication",
"code": "INVALID_API_KEY",
"message": "Bearer token is missing, malformed, or revoked.",
"param": null,
"details": null,
"retryable": false,
"request_id": "01JQREQ7XZQK5N6PZ1VVXHYB8T"
},
"meta": {
"request_id": "01JQREQ7XZQK5N6PZ1VVXHYB8T"
}
}{
"success": false,
"error": {
"type": "permission",
"code": "MISSING_SCOPE",
"message": "The caller is authenticated but lacks the scope or capability this route requires.",
"param": null,
"details": null,
"retryable": false,
"request_id": "01JQREQ7XZQK5N6PZ1VVXHYB8T"
},
"meta": {
"request_id": "01JQREQ7XZQK5N6PZ1VVXHYB8T"
}
}{
"message": "<string>",
"errors": {}
}{
"success": false,
"error": {
"type": "rate_limited",
"code": "RATE_LIMITED",
"message": "Rate limit exceeded (per-key, per-org, or daily cap, depending on which limiter tripped).",
"param": null,
"details": null,
"retryable": true,
"request_id": "01JQREQ7XZQK5N6PZ1VVXHYB8T"
},
"meta": {
"request_id": "01JQREQ7XZQK5N6PZ1VVXHYB8T"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Validates POST /v1/solve (ADR-KBGV3J).
The request body IS the declarative solve spec (version, resources, slots, constraints, preferences, options) — validation here is deliberately shallow, structure only. The solver service owns the closed-vocabulary validation and returns the full error list on rejection; this FormRequest must not reimplement any of it.
resources_from/slots_from are rejected: unlike the solve workflow
step and the solve.run agent tool, this endpoint is deliberately
literal-only. An integrator calling /v1/solve already holds its own
data and is sending it anyway, so requiring them to additionally name a
HASP project would be the odd requirement here.
resources/slots are required non-empty arrays — the same shallow
presence check {@see \App\Services\Workflow\Steps\SolveStep::fromConfig()}
already applies to the workflow step's spec, not a new validation layer.
Catching an obviously-empty spec here means a 422 VALIDATION_FAILED
instead of an unnecessary round trip to the solver sidecar for a request
that could never be solvable.
Response
A solve result — optimal/feasible satisfy every requirement; infeasible is equally a successful result, carrying the conflicting-constraint subset, never an error.