curl --request DELETE \
--url https://www.closient.com/search/api/v1/search/session/{session_id}/constraints/{key}import requests
url = "https://www.closient.com/search/api/v1/search/session/{session_id}/constraints/{key}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://www.closient.com/search/api/v1/search/session/{session_id}/constraints/{key}', 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://www.closient.com/search/api/v1/search/session/{session_id}/constraints/{key}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.closient.com/search/api/v1/search/session/{session_id}/constraints/{key}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://www.closient.com/search/api/v1/search/session/{session_id}/constraints/{key}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.closient.com/search/api/v1/search/session/{session_id}/constraints/{key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"active_constraints": {
"distance_km": 2,
"scope": "local"
},
"base_query": "organic trail mix near me",
"is_expired": false,
"latitude": 48.4284,
"longitude": -123.3656,
"search_history": [
"organic trail mix near me"
],
"session_id": "s_abc123def456"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}Remove a constraint from the session
Remove one constraint by key from the active filter set without affecting the rest. Useful for a UI ‘chip’ pattern where each active constraint renders as a removable pill (e.g. clicking the X on the price_max chip calls DELETE /search/session/{id}/constraints/price_max).
Returns the full updated session state. The session’s TTL is refreshed.
Errors: 404 Not Found when the session is missing/expired or the key is not in active_constraints.
curl --request DELETE \
--url https://www.closient.com/search/api/v1/search/session/{session_id}/constraints/{key}import requests
url = "https://www.closient.com/search/api/v1/search/session/{session_id}/constraints/{key}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://www.closient.com/search/api/v1/search/session/{session_id}/constraints/{key}', 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://www.closient.com/search/api/v1/search/session/{session_id}/constraints/{key}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.closient.com/search/api/v1/search/session/{session_id}/constraints/{key}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://www.closient.com/search/api/v1/search/session/{session_id}/constraints/{key}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.closient.com/search/api/v1/search/session/{session_id}/constraints/{key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"active_constraints": {
"distance_km": 2,
"scope": "local"
},
"base_query": "organic trail mix near me",
"is_expired": false,
"latitude": 48.4284,
"longitude": -123.3656,
"search_history": [
"organic trail mix near me"
],
"session_id": "s_abc123def456"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}Path Parameters
The session identifier returned from POST /search/session.
Refinement constraint keys recognized by session-based search.
The conversational search refinement layer extracts these structured
constraints from natural-language follow-up queries (e.g. "but under
$50" emits price_max). Removing a constraint via
DELETE /search/session/{session_id}/constraints/{key} accepts any
of these values for key.
Mirror of apps.search.services.search_refinement.CONSTRAINT_*.
The trait-based keys (exclude_allergens, require_certifications,
avoid_substances) carry list-of-slug values; the others are scalar.
Trait-based constraints are unified by C-2385 — agents and end users
can both express dietary/allergen/certification preferences through
the same session surface as the existing color/price/distance
constraints rather than per-app endpoints.
color, price_max, price_min, distance_km, availability, scope, exclude_allergens, require_certifications, avoid_substances Response
OK
Response schema for the current state of a search session.
Returned by POST /search/session and DELETE /search/session/{session_id}/constraints/{key}. Reflects the
session's full filter state plus the geographic anchor.
URL-safe session identifier (~32 chars). Use this in the path of every follow-up call (/search/session/{session_id}/...).
The anchor query for this session. Set on session creation and replaced whenever a follow-up is classified as a new search.
Current filter state. Keys are members of ConstraintKeyEnum:
Scalar constraints — set replaces:
color(string),price_max/price_min(float),distance_km(float),availability(string),scope(string).
Trait-based constraints — list-of-slug, set unions additively across successive refinements (C-2385):
exclude_allergens— allergen slugs to drop (peanuts,tree_nuts,dairy,eggs,soy,wheat,gluten,fish,shellfish,sesame,sulfites,mustard).require_certifications— certification slugs that products must carry (vegan,vegetarian,kosher,halal,organic,non_gmo,gluten_free,fair_trade,cruelty_free,rainforest_alliance,usda_organic).avoid_substances— substance slugs to drop (sucralose,aspartame,msg,high_fructose_corn_syrup,red_dye_40,carrageenan,bpa,parabens,phthalates).
Each constraint can be removed individually via DELETE /search/session/{session_id}/constraints/{key}.
Ordered list of every query submitted in this session, oldest first.
true once the session has passed its 30-minute idle expiry. Expired sessions return 404 from query/constraint endpoints.
WGS84 latitude captured at session creation.
-90 <= x <= 90WGS84 longitude captured at session creation.
-180 <= x <= 180