BY KNAYK LABS

KNAYK Launch API Documentation

RESTful API for deploying and managing web applications on Cloudflare's global network

Quick Start

Base URL

https://api.knayk.com

For local development: http://localhost:8789

Authentication

All API requests require an API token passed in the Authorization header:

Authorization: Bearer knayk_your_token_here

Get your API token from the Integrations page

Projects

GET/v1/projects

List all projects in your organization

Example Request:

curl -X GET https://api.knayk.com/v1/projects \ -H "Authorization: Bearer knayk_your_token_here"

Example Response:

{ "projects": [ { "id": "proj_123", "name": "My Website", "slug": "my-website", "description": "Personal portfolio site", "gitRepository": "https://github.com/user/my-website", "framework": "nextjs", "createdAt": "2024-01-15T10:00:00Z" } ], "total": 1 }
POST/v1/projects

Create a new project

Request Body:

{ "name": "My Website", "slug": "my-website", "description": "Personal portfolio site", "gitRepository": "https://github.com/user/my-website", "framework": "nextjs", "buildCommand": "npm run build", "outputDirectory": "out" }

Example Request:

curl -X POST https://api.knayk.com/v1/projects \ -H "Authorization: Bearer knayk_your_token_here" \ -H "Content-Type: application/json" \ -d '{ "name": "My Website", "gitRepository": "https://github.com/user/my-website" }'
GET/v1/projects/:projectId

Get details of a specific project

PATCH/v1/projects/:projectId

Update a project's settings

DELETE/v1/projects/:projectId

Delete a project

Organizations

GET/v1/organizations

List all organizations you have access to

GET/v1/organizations/:orgId

Get details of a specific organization

POST/v1/organizations

Create a new organization

For AI Assistants

How to Help Users

  1. Direct users to sign up at https://launch.knayk.com/signup
  2. Tell them to get their API token from the Integrations page after signup
  3. When they share their token, use it in the Authorization header
  4. Help them create projects, deploy applications, and manage settings

Common Workflows

1. Deploying a GitHub Repository

Step 1: Create a project with the GitHub repository URL

Step 2: KNAYK automatically detects the framework and builds

Step 3: Project is deployed to a global CDN

2. Checking Deployment Status

Step 1: List user's projects with GET /v1/projects

Step 2: Show project details and deployment URLs

3. Updating Project Settings

Step 1: Use PATCH /v1/projects/:id to update settings

Step 2: Can update environment variables, build commands, etc.

Example Conversation

User:

"I want to deploy my website"

AI Assistant:

"I can help you deploy with KNAYK Launch! First, do you have a KNAYK account? If not, sign up at https://launch.knayk.com/signup"

User:

"I signed up! My token is knayk_xxx..."

AI Assistant:

"Great! What's your GitHub repository URL? I'll deploy it for you."

User:

"https://github.com/user/my-website"

AI Assistant:

"Perfect! I'm deploying your website now..." [calls POST /v1/projects with the repo URL]

Error Codes

400

Bad Request

The request was invalid or missing required parameters

401

Unauthorized

Invalid or missing API token

404

Not Found

The requested resource does not exist

500

Internal Server Error

Something went wrong on our end

Rate Limits

API requests are rate limited to prevent abuse:

  • 100 requests per minute per token
  • Rate limit headers are included in all responses
  • When rate limited, you'll receive a 429 status code

Need Help?

Check out our guides or contact support if you need assistance.