Skip to main content
POST
/
v1
/
index
Index code chunks
curl --request POST \
  --url https://api.sharc.dev/v1/index \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "collection": "<string>",
  "chunks": [
    {
      "content": "<string>",
      "relativePath": "<string>",
      "startLine": 123,
      "endLine": 123,
      "metadata": {}
    }
  ],
  "metadata": {}
}
'
{
  "indexed": 123,
  "collection": "<string>"
}

Authorizations

Authorization
string
header
required

Pass your key in Authorization: Bearer .

Body

application/json
collection
string
required
chunks
object[]
required
Minimum array length: 1
metadata
object

Response

200 - application/json

Indexing accepted

indexed
integer
collection
string