Knapsack

Create a Knap

Create a new Knap with specified configuration.

Create a new Knap for the authenticated user.

Endpoint

POST /api/studio/knap-tools

Request Body

{
  "name": "Weekly Report Generator",
  "schedule_type": "scheduled",
  "is_active": true,
  "visibility": "private",
  "active_by_default": true,
  "tool_metadata": {
    "action_description": "Generate weekly reports from emails and meetings",
    "schedule_description": "every Monday at 9am"
  }
}

Request Fields

FieldTypeRequiredDescription
namestringYesName of the Knap (1-255 characters)
schedule_typestringNoSchedule type: manual (default), scheduled, or post_meeting_transcription
is_activebooleanNoWhether the Knap is active (default: true)
visibilitystringNoVisibility: private (default), public, or organization name
active_by_defaultbooleanNoDefault active state for shared Knaps (default: true)
tool_metadataobjectNoMetadata object containing action description and schedule description

tool_metadata Fields

FieldTypeRequiredDescription
action_descriptionstringNoDescription of what the Knap does
schedule_descriptionstringRequired for scheduledNatural language schedule (e.g., "every Monday at 9am")

Response

Returns the created Knap with all fields populated, including the generated uuid:

{
  "uuid": "550e8400-e29b-41d4-a716-446655440000",
  "name": "Weekly Report Generator",
  "creation_user_id": 123,
  "schedule_type": "scheduled",
  "is_active": true,
  "visibility": "private",
  "can_toggle_default_active": false,
  "active_by_default": true,
  "tool_metadata": {
    "action_description": "Generate weekly reports from emails and meetings",
    "schedule_description": "every Monday at 9am"
  },
  "creation_timestamp": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:00Z",
  "schedule_info": {
    "schedule_type": "weekly",
    "schedule_time": "09:00",
    "days_of_week": [1],
    "days_of_month": null,
    "weeks_of_month": null,
    "months_of_year": null
  },
  "next_run_at": "2024-01-22T09:00:00Z"
}

Error Responses

Status CodeDescription
400Invalid request body or schedule description
500Failed to create Knap

Examples

Create a Manual Knap

curl -X POST https://api.knapsack.ai/api/studio/knap-tools \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Email Summarizer",
    "schedule_type": "manual",
    "tool_metadata": {
      "action_description": "Summarize important emails"
    }
  }'

Create a Scheduled Knap

curl -X POST https://api.knapsack.ai/api/studio/knap-tools \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Daily CRM Update",
    "schedule_type": "scheduled",
    "visibility": "private",
    "tool_metadata": {
      "action_description": "Update CRM with daily activities",
      "schedule_description": "daily at 5:00 PM"
    }
  }'

Create a Post-Meeting Knap

curl -X POST https://api.knapsack.ai/api/studio/knap-tools \
  -H "Authorization: Bearer {access_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Meeting Notes Generator",
    "schedule_type": "post_meeting_transcription",
    "tool_metadata": {
      "action_description": "Generate structured meeting notes from transcripts"
    }
  }'