Snippets

Get snippet for endpoint

Beta
POST
Get snippet by endpoint method and path

Request

This endpoint expects an object.
endpoint
objectRequired
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 a list of unions
TypeScript
OR
Python
OR
Java
OR
Go
POST
1curl -X POST https://api.buildwithfern.com/snippets \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "endpoint": {
6 "path": "/v1/search",
7 "method": "GET"
8 }
9}'
200
Successful
1[
2 {
3 "type": "python",
4 "async_client": "import VellumAsync from vellum.client\n\nclient = VellumAsync(api_key=\"YOUR_API_KEY\")\nawait client.search(query=\"Find documents written in the last 5 days\")\n",
5 "sdk": {
6 "package": "vellum-ai",
7 "version": "1.2.1"
8 },
9 "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"
10 },
11 {
12 "type": "typescript",
13 "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",
14 "sdk": {
15 "package": "vellum-ai",
16 "version": "1.2.1"
17 }
18 }
19]