Skip to main content

Internal REST API

Istek includes a built-in REST API that enables external integrations, automation, and AI assistant connectivity.

Overview

When Istek starts, it automatically launches an internal REST API server on port 47835. This API provides programmatic access to:

  • Workspaces
  • Collections and Requests
  • Environments and Variables
  • Request History
  • Secret Provider Integrations

API Base URL

http://localhost:47835/api

Documentation

Swagger UI

Interactive API documentation is available at:

http://localhost:47835/api/docs

OpenAPI Specification

The OpenAPI 3.0 spec is available at:

http://localhost:47835/api/openapi.json

Authentication

The API is designed for local use only and does not require authentication. It only accepts connections from localhost.

Endpoints

Health Check

GET /api/health

Returns API status and version.

Response:

{
"status": "ok",
"version": "0.1.0"
}

Workspaces

MethodEndpointDescription
GET/api/workspacesList all workspaces
POST/api/workspacesCreate a workspace
GET/api/workspaces/:idGet a workspace
PUT/api/workspaces/:idUpdate a workspace
DELETE/api/workspaces/:idDelete a workspace
PUT/api/workspaces/:id/activateSet as active workspace

Collections

MethodEndpointDescription
GET/api/workspaces/:wid/collectionsList collections
POST/api/workspaces/:wid/collectionsCreate a collection
GET/api/workspaces/:wid/collections/:idGet a collection
PUT/api/workspaces/:wid/collections/:idUpdate a collection
DELETE/api/workspaces/:wid/collections/:idDelete a collection
POST/api/workspaces/:wid/collections/:id/requestsAdd a request
PUT/api/workspaces/:wid/collections/:id/requests/:ridUpdate a request
DELETE/api/workspaces/:wid/collections/:id/requests/:ridDelete a request

Environments

MethodEndpointDescription
GET/api/workspaces/:wid/environmentsList environments
POST/api/workspaces/:wid/environmentsCreate an environment
GET/api/workspaces/:wid/environments/:idGet an environment
PUT/api/workspaces/:wid/environments/:idUpdate an environment
DELETE/api/workspaces/:wid/environments/:idDelete an environment
PUT/api/workspaces/:wid/environments/:id/activateActivate environment

Global Variables

MethodEndpointDescription
GET/api/workspaces/:wid/variablesList global variables
POST/api/workspaces/:wid/variablesCreate a variable
PUT/api/workspaces/:wid/variables/:idUpdate a variable
DELETE/api/workspaces/:wid/variables/:idDelete a variable

History

MethodEndpointDescription
GET/api/workspaces/:wid/historyList history items
GET/api/workspaces/:wid/history/:idGet a history item
DELETE/api/workspaces/:wid/history/:idDelete a history item
DELETE/api/workspaces/:wid/historyClear all history

Pagination

List endpoints support pagination:

GET /api/workspaces?limit=50&offset=0

Response:

{
"items": [...],
"total": 100,
"limit": 50,
"offset": 0
}

Error Handling

Errors return appropriate HTTP status codes with a JSON body:

{
"error": {
"code": "NOT_FOUND",
"message": "Workspace not found"
}
}
StatusCodeDescription
400BAD_REQUESTInvalid request data
404NOT_FOUNDResource not found
500INTERNAL_ERRORServer error

MCP Integration

The Istek MCP Server uses this API to enable AI assistants to interact with Istek. See MCP Protocol for details.

Setting Up MCP

Add Istek to your AI assistant's MCP configuration:

Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

{
"mcpServers": {
"istek": {
"command": "npx",
"args": ["-y", "@anthropic/mcp-istek"]
}
}
}

Available MCP Tools

When connected via MCP, AI assistants can:

ToolDescription
list_workspacesList all workspaces
create_workspaceCreate a new workspace
list_collectionsList collections in a workspace
create_collectionCreate a new collection
add_request_to_collectionAdd an API request
list_environmentsList environments
create_environmentCreate an environment
create_variableCreate a global variable
list_historyView request history
check_istek_statusCheck if Istek is running

Available MCP Prompts

PromptDescription
create_rest_api_collectionCreate a complete REST API collection
setup_environmentSet up dev/staging/prod environments
create_crud_collectionCreate CRUD endpoints for a resource
import_from_curlConvert cURL to Istek request
setup_auth_environmentSet up authentication variables
create_graphql_collectionCreate GraphQL queries/mutations
create_webhook_collectionCreate webhook test collection
api_testing_guideGet a guided API testing workflow

Example Usage

cURL

# List workspaces
curl http://localhost:47835/api/workspaces

# Create a collection
curl -X POST http://localhost:47835/api/workspaces/ws_123/collections \
-H "Content-Type: application/json" \
-d '{"name": "My API"}'

# Add a request to collection
curl -X POST http://localhost:47835/api/workspaces/ws_123/collections/col_456/requests \
-H "Content-Type: application/json" \
-d '{
"request": {
"name": "Get Users",
"method": "GET",
"url": "https://api.example.com/users"
}
}'

JavaScript

const ISTEK_API = 'http://localhost:47835/api';

// List workspaces
const workspaces = await fetch(`${ISTEK_API}/workspaces`)
.then(r => r.json());

// Create environment
await fetch(`${ISTEK_API}/workspaces/${workspaceId}/environments`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
name: 'Production',
color: '#ef4444',
variables: [
{ key: 'API_URL', value: 'https://api.prod.example.com', isSecret: false }
]
})
});

Viewing API in Istek

  1. Open Istek
  2. Go to Settings (gear icon)
  3. Click the API tab
  4. View API status and quick access to Swagger UI