Create a collection
POST /api/collections with a name: 1 to 64 characters of a-z, 0-9, - and _. Answers 201 with the new collection's id, or 409 if you already have one with that name.
Shell
curl -X POST https://stackgrep.com/api/collections \
-H "Authorization: Bearer $STACKGREP_KEY" -d '{"name": "contracts"}'
# 201 {"id": 18}List your collections
GET /api/collections lists every collection with what was written to it and what it takes in storage now. Free.
Shell
curl https://stackgrep.com/api/collections -H "Authorization: Bearer $STACKGREP_KEY"Response
[{"name": "contracts", "docs_written": 48210, "bytes_written": 391204477,
"stored_bytes": 201338112, "created_at": "2026-10-04T12:01:33Z"}]| Name | Type | What it does |
|---|---|---|
name | string | The collection's name, used in every other URL. |
docs_written | integer | Documents written to it, counting every update. |
bytes_written | integer | Bytes of text written to it. |
stored_bytes | integer | What it takes in storage now: the text and its index, old versions included until they're compacted away. |
created_at | string | When it was made (RFC 3339). |
Delete a collection
DELETE /api/collections/{name} answers 204. The collection is gone at once; its stored documents are deleted in the background.
Shell
curl -X DELETE https://stackgrep.com/api/collections/contracts \
-H "Authorization: Bearer $STACKGREP_KEY"
# 204Next: put documents in it, or feed it from an S3 bucket.
Try it on your own documentsExact and regex search for your agents, from one API. Or see the engine on npm's source first.