Create index
POST
https://example.com
/
api
/
indexes
Create index
curl --request POST \
--url https://example.com/api/indexes \
--header 'Content-Type: application/json' \
--cookie better-auth.session_token= \
--data '
{
"fieldMappings": [
{
"name": "<string>",
"type": "text",
"description": "<string>",
"fast": true,
"fieldnorms": true,
"indexed": true,
"stored": true
}
],
"indexId": "<string>",
"timestampField": "<string>"
}
'const options = {
method: 'POST',
headers: {cookie: 'better-auth.session_token=', 'Content-Type': 'application/json'},
body: JSON.stringify({
fieldMappings: [
{
name: '<string>',
type: 'text',
description: '<string>',
fast: true,
fieldnorms: true,
indexed: true,
stored: true
}
],
indexId: '<string>',
timestampField: '<string>'
})
};
fetch('https://example.com/api/indexes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://example.com/api/indexes"
payload = {
"fieldMappings": [
{
"name": "<string>",
"type": "text",
"description": "<string>",
"fast": True,
"fieldnorms": True,
"indexed": True,
"stored": True
}
],
"indexId": "<string>",
"timestampField": "<string>"
}
headers = {
"cookie": "better-auth.session_token=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://example.com/api/indexes"
payload := strings.NewReader("{\n \"fieldMappings\": [\n {\n \"name\": \"<string>\",\n \"type\": \"text\",\n \"description\": \"<string>\",\n \"fast\": true,\n \"fieldnorms\": true,\n \"indexed\": true,\n \"stored\": true\n }\n ],\n \"indexId\": \"<string>\",\n \"timestampField\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "better-auth.session_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))
}{
"displayName": "<string>",
"indexId": "<string>",
"isTraceIndex": true
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}Authorizations
Body
application/json
Minimum array length:
1- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
Show child attributes
Show child attributes
Pattern:
^[a-zA-Z][a-zA-Z0-9_-]{2,254}$Minimum string length:
1Required range:
x >= 1Minimum string length:
1Show child attributes
Show child attributes
Minimum string length:
1Required range:
x >= 1Available options:
dynamic, lenient, strict Minimum string length:
1Show child attributes
Show child attributes
Minimum string length:
1⌘I
Create index
curl --request POST \
--url https://example.com/api/indexes \
--header 'Content-Type: application/json' \
--cookie better-auth.session_token= \
--data '
{
"fieldMappings": [
{
"name": "<string>",
"type": "text",
"description": "<string>",
"fast": true,
"fieldnorms": true,
"indexed": true,
"stored": true
}
],
"indexId": "<string>",
"timestampField": "<string>"
}
'const options = {
method: 'POST',
headers: {cookie: 'better-auth.session_token=', 'Content-Type': 'application/json'},
body: JSON.stringify({
fieldMappings: [
{
name: '<string>',
type: 'text',
description: '<string>',
fast: true,
fieldnorms: true,
indexed: true,
stored: true
}
],
indexId: '<string>',
timestampField: '<string>'
})
};
fetch('https://example.com/api/indexes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://example.com/api/indexes"
payload = {
"fieldMappings": [
{
"name": "<string>",
"type": "text",
"description": "<string>",
"fast": True,
"fieldnorms": True,
"indexed": True,
"stored": True
}
],
"indexId": "<string>",
"timestampField": "<string>"
}
headers = {
"cookie": "better-auth.session_token=",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://example.com/api/indexes"
payload := strings.NewReader("{\n \"fieldMappings\": [\n {\n \"name\": \"<string>\",\n \"type\": \"text\",\n \"description\": \"<string>\",\n \"fast\": true,\n \"fieldnorms\": true,\n \"indexed\": true,\n \"stored\": true\n }\n ],\n \"indexId\": \"<string>\",\n \"timestampField\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("cookie", "better-auth.session_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))
}{
"displayName": "<string>",
"indexId": "<string>",
"isTraceIndex": true
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"requestId": "<string>",
"statusCode": 123,
"details": [
{
"message": "<string>",
"path": "<string>"
}
]
}
}
