Blueprints API

Create, read, update, and delete your blueprints programmatically.

Required Role: BLUEPRINTS_FULL for write operations, BLUEPRINTS_READONLY for read-only access.

Blueprint ID Format

Blueprint IDs use the bp_ prefix for easy identification:

bp_clw2m8k0x0001

Endpoints

GET/api/v1/blueprints

List all blueprints you have access to (your own blueprints).

Query Parameters

ParameterTypeDescription
visibilitystringFilter by visibility: private, team, or public (default: all)
limitnumberPage size, up to 100 (default: 50)
offsetnumberNumber of blueprints to skip (default: 0)

Example Request

curl -H "Authorization: Bearer lp_your_token" \
     "https://lynxprompt.com/api/v1/blueprints?visibility=private"

Response

{
  "blueprints": [
    {
      "id": "bp_clw2m8k0x0001",
      "name": "My React Config",
      "description": "Custom rules for React projects",
      "type": "AGENTS_MD",
      "tier": "SHORT",
      "category": "web",
      "tags": ["react", "typescript"],
      "visibility": "PRIVATE",
      "downloads": 0,
      "favorites": 0,
      "created_at": "2025-01-15T10:30:00.000Z",
      "updated_at": "2025-01-20T14:45:00.000Z",
      "hierarchy_id": null,
      "parent_id": null,
      "repository_path": null,
      "content_checksum": "3f2a9c1d8e7b6a50"
    }
  ],
  "total": 1,
  "limit": 50,
  "offset": 0,
  "has_more": false
}
GET/api/v1/blueprints/:id

Get a specific blueprint by ID, including its full content.

Example Request

curl -H "Authorization: Bearer lp_your_token" \
     https://lynxprompt.com/api/v1/blueprints/bp_clw2m8k0x0001

Response

{
  "blueprint": {
    "id": "bp_clw2m8k0x0001",
    "name": "My React Config",
    "description": "Custom rules for React projects",
    "content": "You are an expert React developer...",
    "type": "AGENTS_MD",
    "tier": "SHORT",
    "category": "web",
    "tags": ["react", "typescript"],
    "visibility": "PRIVATE",
    "variables": { "PROJECT_NAME": "my-app" },
    "downloads": 0,
    "favorites": 0,
    "ai_assisted": false,
    "showcase_url": null,
    "created_at": "2025-01-15T10:30:00.000Z",
    "updated_at": "2025-01-20T14:45:00.000Z",
    "hierarchy_id": null,
    "parent_id": null,
    "repository_path": null,
    "content_checksum": "3f2a9c1d8e7b6a50"
  }
}
POST/api/v1/blueprints

Create a new blueprint.

Request Body

{
  "name": "My New Config",              // required, 3+ characters
  "content": "You are an expert developer...", // required, 10+ characters
  "description": "Description of the blueprint",
  "type": "AGENTS_MD",                  // default AGENTS_MD
  "category": "other",                  // default other
  "tags": ["react"],                    // up to 10
  "visibility": "PRIVATE"               // PRIVATE (default), TEAM or PUBLIC
}

// content_base64 can replace content when a proxy or WAF
// blocks code in the request body.

Example Request

curl -X POST https://lynxprompt.com/api/v1/blueprints \
     -H "Authorization: Bearer lp_your_token" \
     -H "Content-Type: application/json" \
     -d '{
       "name": "My New Config",
       "content": "You are an expert developer...",
       "visibility": "PRIVATE"
     }'

Response

// 201 Created
{
  "success": true,
  "blueprint": {
    "id": "bp_clw2m8k0x0002",
    "name": "My New Config",
    "description": null,
    "type": "AGENTS_MD",
    "tier": "SHORT",
    "category": "other",
    "tags": [],
    "visibility": "PRIVATE",
    "created_at": "2025-01-21T09:00:00.000Z",
    "updated_at": "2025-01-21T09:00:00.000Z",
    "hierarchy_id": null,
    "parent_id": null,
    "repository_path": null,
    "content_checksum": "9b1e4d7c2a3f8e60"
  }
}
PUT/api/v1/blueprints/:id

Update an existing blueprint. Only include fields you want to change. Send expected_checksum (the content_checksum you last read) to refuse the update with 409 Conflict if someone changed the blueprint in between.

Example Request

curl -X PUT https://lynxprompt.com/api/v1/blueprints/bp_clw2m8k0x0001 \
     -H "Authorization: Bearer lp_your_token" \
     -H "Content-Type: application/json" \
     -d '{
       "content": "Updated content with new rules..."
     }'

Response

{
  "success": true,
  "blueprint": {
    "id": "bp_clw2m8k0x0001",
    "name": "My React Config",
    "content": "Updated content with new rules...",
    "visibility": "PRIVATE",
    "updated_at": "2025-01-21T10:00:00.000Z",
    "content_checksum": "c4d2e9a1b7f3086e"
    // ...plus description, type, tier, category, tags, created_at
    // and the hierarchy fields
  }
}
DELETE/api/v1/blueprints/:id

Delete a blueprint. This action cannot be undone.

Example Request

curl -X DELETE https://lynxprompt.com/api/v1/blueprints/bp_clw2m8k0x0001 \
     -H "Authorization: Bearer lp_your_token"

Response

{ "success": true, "message": "Blueprint "My React Config" deleted successfully" }

Platform-Specific Commands

Here are examples for updating blueprints from different operating systems:

Linux / macOS (bash)

# Set your API token
export LYNXPROMPT_API_TOKEN="lp_your_token_here"

# Update blueprint from file
curl -X PUT https://lynxprompt.com/api/v1/blueprints/bp_your_id \
     -H "Authorization: Bearer $LYNXPROMPT_API_TOKEN" \
     -H "Content-Type: application/json" \
     -d "{\"content\": $(cat .cursor/rules | jq -Rs .)}"

Requires jq for JSON escaping. Install with brew install jq (macOS) orsudo apt install jq (Linux).

Windows (PowerShell)

# Set your API token
$env:LYNXPROMPT_API_TOKEN = "lp_your_token_here"

# Read file and update blueprint
$content = (Get-Content ".cursor\rules" -Raw) -replace '"', '\"'
$body = @{ content = $content } | ConvertTo-Json
Invoke-RestMethod -Uri "https://lynxprompt.com/api/v1/blueprints/bp_your_id" `
  -Method PUT `
  -Headers @{ "Authorization" = "Bearer $env:LYNXPROMPT_API_TOKEN"; "Content-Type" = "application/json" } `
  -Body $body

WSL (Windows Subsystem for Linux)

Use the same commands as Linux/macOS. To access Windows files, use /mnt/c/... paths.

Syncing from CI/CD

Use the API to automatically sync your AI configuration files from your CI/CD pipeline. Here's an example GitHub Actions workflow:

# .github/workflows/sync-lynxprompt.yml
name: Sync LynxPrompt

on:
  push:
    paths:
      - '.cursor/rules'
      - 'CLAUDE.md'
    branches: [main]

jobs:
  sync:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Sync to LynxPrompt
        run: |
          curl -X PUT https://lynxprompt.com/api/v1/blueprints/bp_your_id \
               -H "Authorization: Bearer ${{ secrets.LYNXPROMPT_API_TOKEN }}" \
               -H "Content-Type: application/json" \
               -d "{\"content\": $(cat .cursor/rules | jq -Rs .)}"

Error Responses

404 Not Found- Blueprint doesn't exist or you don't have access
400 Bad Request- Missing or invalid fields in request body
403 Forbidden- Token doesn't have required permissions