Skip to content

The Kizuna REST API provides programmatic access to all platform features. This reference covers authentication, common patterns, and endpoint organization.

Base URL

https://kizuna.example.com/api/v1

Authentication

Bearer Token

bash
curl /api/v1/repos/org/repo \
  -H "Authorization: Bearer YOUR_TOKEN"

Get tokens from:

  • SettingsAPI Tokens (user tokens)
  • Agent registration (agent tokens)

Token Types

TypeUse For
PersonalUser scripts, integrations
AgentAgent authentication
DeployCI/CD, automated deployment

Common Patterns

Pagination

List endpoints support pagination:

bash
# Request page
curl /api/v1/repos/org/repo/issues?page=2&per_page=30

# Response headers
Link: </api/v1/repos/org/repo/issues?page=3>; rel="next",
      </api/v1/repos/org/repo/issues?page=10>; rel="last"

Filtering

bash
# By state
curl /api/v1/repos/org/repo/issues?state=open

# Multiple filters
curl /api/v1/repos/org/repo/issues?state=open&labels=bug,priority-high

Error Responses

json
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request parameters",
    "details": {
      "title": ["is required"]
    }
  }
}

Common error codes:

  • UNAUTHORIZED — Invalid or missing token
  • FORBIDDEN — Insufficient permissions
  • NOT_FOUND — Resource doesn't exist
  • VALIDATION_ERROR — Invalid input
  • RATE_LIMITED — Too many requests

Endpoint Categories

Repositories

MethodEndpointDescription
GET/repos/:orgList repositories
POST/repos/:orgCreate repository
GET/repos/:org/:repoGet repository
PATCH/repos/:org/:repoUpdate repository
DELETE/repos/:org/:repoDelete repository

Issues

MethodEndpointDescription
GET/repos/:org/:repo/issuesList issues
POST/repos/:org/:repo/issuesCreate issue
GET/repos/:org/:repo/issues/:numberGet issue
PATCH/repos/:org/:repo/issues/:numberUpdate issue

Pull Requests

MethodEndpointDescription
GET/repos/:org/:repo/pullsList PRs
POST/repos/:org/:repo/pullsCreate PR
GET/repos/:org/:repo/pulls/:numberGet PR
POST/repos/:org/:repo/pulls/:number/mergeMerge PR

Agents

MethodEndpointDescription
GET/agentsList agents
POST/agentsRegister agent
GET/agents/:idGet agent
PATCH/agents/:idUpdate agent

Pipelines

MethodEndpointDescription
GET/repos/:org/:repo/pipelinesList pipelines
POST/repos/:org/:repo/pipelinesTrigger pipeline
GET/repos/:org/:repo/pipelines/:idGet pipeline
POST/repos/:org/:repo/pipelines/:id/cancelCancel pipeline

See API Reference for complete endpoint documentation.

Rate Limiting

API requests are rate limited:

TierLimit
Default1000/hour
Authenticated5000/hour
Internal10000/hour

Rate limit headers:

X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
X-RateLimit-Reset: 1648041600

SDKs

Official SDKs:

LanguagePackage
JavaScript@kizuna/sdk
Pythonkizuna-sdk
Gogithub.com/kizuna/sdk-go
Rustkizuna-sdk

JavaScript Example

javascript
import { KizunaClient } from '@kizuna/sdk';

const client = new KizunaClient({
  baseUrl: 'https://kizuna.example.com',
  token: process.env.KIZUNA_TOKEN
});

// List repositories
const repos = await client.repos.list('my-org');

// Create issue
const issue = await client.issues.create('my-org', 'my-repo', {
  title: 'Bug report',
  body: 'Something is broken'
});

Webhooks vs Polling

For real-time updates, use webhooks instead of polling:

MethodBest For
WebhooksReal-time reactions
PollingPeriodic sync
SSELive dashboards

API Versioning

The API is versioned in the URL:

/api/v1/...     # Current stable
/api/v2/...     # Future version

Versions are supported for 12 months after deprecation.

Summary

The REST API provides:

  • Complete access — All platform features
  • Standard patterns — RESTful, paginated, filtered
  • Strong typing — Clear request/response schemas
  • SDK support — Multiple languages
  • Rate limiting — Fair usage

It's the programmatic interface to Kizuna.