Skip to content

Capsules API

API Key

The Capsules API allows you to create, retrieve, and manage AI-generated content capsules. These capsules are dynamic, intelligent documents that can be regenerated with updated prompts or integrated with other processed documents.

API Endpoints

Create a new capsule

POST /capsules

Create a new content capsule. You can optionally provide a name and slug for the capsule. If slug is not provided, it will be auto-generated from the name.

Terminal window
curl -X POST https://api.shrinked.com/capsules \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Bioengineering Lecture Summary",
"slug": "bioengineering-lecture-summary"
}'

Get a single capsule by ID

GET /capsules/ID

Retrieve a specific content capsule by its ID.

Terminal window
curl -X GET https://api.shrinked.com/capsules/capsule123456 \
-H "x-api-key: YOUR_API_KEY"

Regenerate capsule by ID

GET /capsules/ID/regenerate

Regenerate the content of a specific capsule by its ID. You can optionally provide an overridePrompt as a query parameter to guide the regeneration.

The overridePrompt parameter allows you to provide a detailed set of instructions to the AI model, overriding the default prompt for the capsule. This is useful for generating content with a specific format, persona, or set of constraints.

Here is an example of a detailed overridePrompt:

You are David Martinez, a certified home inspector with 18 years of experience creating clear, actionable reports.
Source Material:
|<context_buffer> {{fullContext}} </context_buffer>
CRITICAL: Every finding must be tied to exact timestamps. ONLY include explicit information. Aggregate facts across all provided inspection sources to identify cross-inspection patterns. *Scale output length beyond 1000 words when more context data is available.*
Create an inspection report with:
**Critical Finding**
Open with the most impactful safety or financial finding from the inspected properties or data (with timestamps).
**Executive Summary & Risk Assessment**
Overall condition, safety concerns, and limitations (with timestamps).
**Immediate Action Required**
- [timestamp] Safety hazard or code violation
If none, state “No immediate concerns.”
**Major Systems Assessment**
Focus on significant findings (with timestamps):
- Structural & Foundation
- Electrical System
- Plumbing System
- HVAC System
- Roofing & Exterior
Note limitations concisely.
**Economic Impact Analysis**
- Immediate Repairs (0–30 days)
- Short-term Maintenance (1–12 months)
- Long-term Considerations (1–5 years)
Cite timestamps.
**Comprehensive Findings**
Detailed observations by severity (with timestamps).
**Ongoing Maintenance Strategy**
Preventive recommendations (with timestamps).
**Property Viability**
Synthesize the overall condition and patterns across inspected properties or data, with implications for buyers (with timestamps).
Focus on observed findings, weaving timestamps naturally. Target *1000–1500 words, expanding with additional context data*.

When using the overridePrompt in a curl request, make sure to URL-encode the prompt string.

Retrieve all capsules owned by the current user

GET /capsules

Retrieve a list of all content capsules owned by the authenticated user.

Terminal window
curl -X GET https://api.shrinked.com/capsules \
-H "x-api-key: YOUR_API_KEY"

Add a document (processed doc) to a capsule

POST /capsules/ID/files

Add one or more processed documents to an existing capsule.

Terminal window
curl -X POST https://api.shrinked.com/capsules/capsule123456/files \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"fileIds": ["file789012", "file345678"]
}'

Remove a document from a capsule

DELETE /capsules/ID/files/FILE_ID

Remove a specific document from a capsule.

Terminal window
curl -X DELETE https://api.shrinked.com/capsules/capsule123456/files/file789012 \
-H "x-api-key: YOUR_API_KEY"

Search within capsules

GET /capsules/search

Search for content within all capsules owned by the current user.

Terminal window
curl -X GET "https://api.shrinked.com/capsules/search?query=bioengineering" \
-H "x-api-key: YOUR_API_KEY"