Snippets

Load all snippets

Beta
POST

Query parameters

pageintegerOptional

Request

This endpoint expects an object.
orgId
stringOptional
If the same API is defined across multiple organization, you must specify an organization ID.
apiId
stringOptional
If you have more than one API, you must specify its ID.
sdks
list of unionsOptional
The SDKs for which to load snippets. If unspecified, snippets for the latest published SDKs will be returned.
loadLevel
enumOptional
The level of detail to load for the snippet. If unspecified, the full snippet will be returned.
Allowed values: fullendpoint

Response

This endpoint returns an object
snippets
map from strings to maps from enums to lists of unions

The snippets are returned as a map of endpoint path (e.g. /api/users) to a map of endpoint method (e.g. POST) to snippets.

Allowed values: PUTPOSTGETPATCHDELETE
next
integerOptional

If present, pass this into the page query parameter to load the next page.

POST
1curl -X POST "https://api.buildwithfern.com/snippets/load?page=1" \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "orgId": "vellum",
6 "apiId": "vellum-ai",
7 "sdks": [
8 {
9 "type": "python",
10 "package": "vellum-ai",
11 "version": "1.2.1"
12 }
13 ]
14}'
200
Successful
1{
2 "snippets": {
3 "/v1/search": {
4 "GET": [
5 {
6 "type": "python",
7 "async_client": "import Vellum from vellum.client\n\nclient = Vellum(api_key=\"YOUR_API_KEY\")\nclient.search(query=\"Find documents written in the last 5 days\")\n",
8 "sdk": {
9 "package": "vellum-ai",
10 "version": "1.2.1"
11 },
12 "sync_client": "import Vellum from vellum.client\n\nclient = Vellum(api_key=\"YOUR_API_KEY\")\nclient.search(query=\"Find documents written in the last 5 days\")\n"
13 },
14 {
15 "type": "typescript",
16 "client": "import { VellumClient } from \"vellum-ai\";\n\nconst vellum = VellumClient({\n apiKey=\"YOUR_API_KEY\"\n})\nvellum.search({\n query: \"Find documents written in the last 5 days\"\n})\n",
17 "sdk": {
18 "package": "vellum-ai",
19 "version": "1.2.1"
20 }
21 }
22 ]
23 },
24 "v1/document-indexes": {
25 "POST": [
26 {
27 "type": "python",
28 "async_client": "import VellumAsync from vellum.client\n\nclient = VellumAsync(api_key=\"YOUR_API_KEY\")\nawait client.document_indexes.create(name=\"meeting-reports\", status=\"ACTIVE\")\n",
29 "sdk": {
30 "package": "vellum-ai",
31 "version": "1.2.1"
32 },
33 "sync_client": "import Vellum from vellum.client\n\nclient = Vellum(api_key=\"YOUR_API_KEY\")\nclient.document_indexes.create(name=\"meeting-reports\", status=\"ACTIVE\")\n"
34 },
35 {
36 "type": "typescript",
37 "client": "import { VellumClient } from \"vellum-ai\";\n\nconst vellum = VellumClient({\n apiKey=\"YOUR_API_KEY\"\n})\nvellum.documentIndexes.create({\n name: \"meeting-reports\",\n status: \"ACTIVE\"\n})\n",
38 "sdk": {
39 "package": "vellum-ai",
40 "version": "1.2.1"
41 }
42 }
43 ]
44 }
45 },
46 "next": 2
47}