Search

POST /search

Request

Parameters

nametypedata typedescription
Nonerequiredobject (JSON or YAML)N/A

Responses

http codecontent-typeresponse
201text/plain;charset=UTF-8Configuration created successfully
400application/json{"code":"400","message":"Bad Request"}
405text/html;charset=utf-8None

Examples

cURL

curl -X POST \
	-H "Content-Type: application/json" \
	--data @post.json \
	"http://localhost:8889"	

Python

import requests
body = {
	'query': 'value1',
	'collections': [
		'notes',
		'papers'
	],
	'topK': 3
}
r = requests.post('https://fluffyvectors.com/api/v1/search', data=body)

JavaScript

fetch("https://fluffyvectors.com/api/v1/search", {
	method: "POST",
	headers: {
		"Content-Type": "application/json"
	},
	body: JSON.stringify({
		query: "this is a search query",
		collections: [
		  "notes",
		  "papers"
		],
		topK: 3
	})
})
Response
Parameters
nametypedata typedescription
Nonerequiredobject (JSON or YAML)N/A
Responses
http codecontent-typeresponse
201text/plain;charset=UTF-8Configuration created successfully
400application/json{"code":"400","message":"Bad Request"}
405text/html;charset=utf-8None
Example cURL
 curl -X POST -H "Content-Type: application/json" --data @post.json http://localhost:8889/

Listing existing stubs & proxy configs as YAML string

GET / (gets all in-memory stub & proxy configs)
Parameters

None

Responses
http codecontent-typeresponse
200text/plain;charset=UTF-8YAML string
Example cURL
 curl -X GET -H "Content-Type: application/json" http://localhost:8889/
GET /{stub_numeric_id} (gets stub by its resource-id-{stub_numeric_id} in the YAML config)
Parameters
nametypedata typedescription
stub_numeric_idrequiredint ($int64)The specific stub numeric id
Responses
http codecontent-typeresponse
200text/plain;charset=UTF-8YAML string
400application/json{"code":"400","message":"Bad Request"}
Example cURL
 curl -X GET -H "Content-Type: application/json" http://localhost:8889/0
GET /{uuid} (gets stub by its defined uuid property)
Parameters
nametypedata typedescription
uuidrequiredstringThe specific stub unique idendifier
Responses
http codecontent-typeresponse
200text/plain;charset=UTF-8YAML string
400application/json{"code":"400","message":"Bad Request"}
Example cURL
 curl -X GET -H "Content-Type: application/json" http://localhost:8889/some-unique-uuid-string
GET /proxy-config/default (gets default proxy-config)
Parameters

None

Responses
http codecontent-typeresponse
200text/plain;charset=UTF-8YAML string
400application/json{"code":"400","message":"Bad Request"}
Example cURL
 curl -X GET -H "Content-Type: application/json" http://localhost:8889/proxy-config/default
GET /proxy-config/{uuid} (gets proxy config by its uuid property)
Parameters
nametypedata typedescription
uuidrequiredstringThe specific proxy config unique idendifier
Responses
http codecontent-typeresponse
200text/plain;charset=UTF-8YAML string
400application/json{"code":"400","message":"Bad Request"}
Example cURL
 curl -X GET -H "Content-Type: application/json" http://localhost:8889/proxy-config/some-unique-uuid-string

Updating existing stubs & proxy configs

PUT /{stub_numeric_id} (updates stub by its resource-id-{stub_numeric_id} in the config)
Parameters
nametypedata typedescription
stub_numeric_idrequiredint ($int64)The specific stub numeric id
Responses
http codecontent-typeresponse
201text/plain;charset=UTF-8Stub request index#<stub_numeric_id> updated successfully"
400application/json{"code":"400","message":"Bad Request"}
405text/html;charset=utf-8None
Example cURL
 curl -X PUT -H "Content-Type: application/json" --data @put.json http://localhost:8889/0
PUT /{uuid} (updates stub by its defined uuid property)
Parameters
nametypedata typedescription
uuidrequiredstringThe specific stub unique idendifier
Responses
http codecontent-typeresponse
201text/plain;charset=UTF-8Stub request uuid#<uuid> updated successfully
400application/json{"code":"400","message":"Bad Request"}
405text/html;charset=utf-8None
Example cURL
 curl -X PUT -H "Content-Type: application/json" --data @put.json http://localhost:8889/some-unique-uuid-string
PUT /proxy-config/default (updates default proxy-config)
Parameters

None

Responses
http codecontent-typeresponse
201text/plain;charset=UTF-8Proxy config uuid#default updated successfully
400application/json{"code":"400","message":"Bad Request"}
405text/html;charset=utf-8None
Example cURL
 curl -X PUT -H "Content-Type: application/json" --data @put.json http://localhost:8889/proxy-config/default
PUT /proxy-config/{uuid} (updates proxy-config by its uuid property)
Parameters
nametypedata typedescription
uuidrequiredstringThe specific proxy config unique idendifier
Responses
http codecontent-typeresponse
201text/plain;charset=UTF-8Proxy config uuid#<uuid> updated successfully
400application/json{"code":"400","message":"Bad Request"}
405text/html;charset=utf-8None
Example cURL
 curl -X PUT -H "Content-Type: application/json" --data @put.json http://localhost:8889/proxy-config/some-unique-uuid-string

Deleting existing stubs & proxy configs

DELETE / (deletes all in-memory stub & proxy configs)
Parameters

None

Responses
http codecontent-typeresponse
200text/plain;charset=UTF-8All in-memory YAML config was deleted successfully
Example cURL
 curl -X DELETE -H "Content-Type: application/json" http://localhost:8889/
DELETE /{stub_numeric_id} (deletes stub by its resource-id-{stub_numeric_id} in the config)
Parameters
nametypedata typedescription
stub_numeric_idrequiredint ($int64)The specific stub numeric id
Responses
http codecontent-typeresponse
200text/plain;charset=UTF-8Stub request index#<stub_numeric_id> deleted successfully
400application/json{"code":"400","message":"Bad Request"}
Example cURL
 curl -X DELETE -H "Content-Type: application/json" http://localhost:8889/0
DELETE /{uuid} (updates stub by its defined uuid property)
Parameters
nametypedata typedescription
uuidrequiredstringThe specific stub unique idendifier
Responses
http codecontent-typeresponse
200text/plain;charset=UTF-8Stub request uuid#<uuid> deleted successfully
400application/json{"code":"400","message":"Bad Request"}
Example cURL
 curl -X DELETE -H "Content-Type: application/json" http://localhost:8889/some-unique-uuid-string
DELETE /proxy-config/{uuid} (deletes proxy-config by its uuid property)
Parameters
nametypedata typedescription
uuidrequiredstringThe specific proxy config unique idendifier
Responses
http codecontent-typeresponse
200text/plain;charset=UTF-8Proxy config uuid#<uuid> deleted successfully
400application/json{"code":"400","message":"Bad Request"}
Example cURL
 curl -X DELETE -H "Content-Type: application/json" http://localhost:8889/proxy-config/some-unique-uuid-string