Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

fix: standardize ID format in API documentation and POST /profiles response

Mario279aeb0a0c73
diff --git a/docs/references/api-reference.json b/docs/references/api-reference.json
index 4f24067b..6d63d550 100644
--- a/docs/references/api-reference.json
+++ b/docs/references/api-reference.json
@@ -108,7 +108,7 @@
"examples": {},
"tldr": "Get instance logs",
"cli": false,
- "curlExample": "curl \"http://localhost:9867/instances/abc123/logs?limit=100\"",
+ "curlExample": "curl \"http://localhost:9867/instances/inst_abc123/logs?limit=100\"",
"parameters": "limit (int, query, optional, default: 100)",
"payload": "N/A (GET request)"
},
@@ -121,7 +121,7 @@
"examples": {},
"tldr": "Proxy screencast stream from instance",
"cli": false,
- "curlExample": "curl \"http://localhost:9867/instances/abc123/proxy/screencast?tabId=tab-1\"",
+ "curlExample": "curl \"http://localhost:9867/instances/inst_abc123/proxy/screencast?tabId=tab-1\"",
"parameters": "tabId (string, query, required)",
"payload": "N/A (GET request)"
},
@@ -134,7 +134,7 @@
"examples": {},
"tldr": "Stream screen from instance tab",
"cli": false,
- "curlExample": "curl \"http://localhost:9867/instances/abc123/screencast?tabId=tab-1\"",
+ "curlExample": "curl \"http://localhost:9867/instances/inst_abc123/screencast?tabId=tab-1\"",
"parameters": "tabId (string, query, required), format (string, optional, default: \"webm\")",
"payload": "N/A (GET request)"
},
@@ -275,7 +275,7 @@
"examples": {},
"tldr": "Ensure Chrome is initialized in instance",
"cli": false,
- "curlExample": "curl -X POST http://localhost:9867/instances/abc123/ensure-chrome",
+ "curlExample": "curl -X POST http://localhost:9867/instances/inst_abc123/ensure-chrome",
"parameters": "id (string, path, required): Instance ID",
"payload": "N/A"
},
@@ -288,7 +288,7 @@
"examples": {},
"tldr": "Stop/shutdown an instance",
"cli": false,
- "curlExample": "curl -X POST http://localhost:9867/instances/abc123/stop",
+ "curlExample": "curl -X POST http://localhost:9867/instances/inst_abc123/stop",
"parameters": "id (string, path, required): Instance ID",
"payload": "N/A"
},
@@ -376,10 +376,10 @@
"tldr": "Create a new browser profile",
"cliExample": "pinchtab profile create my-profile",
"curlExample": "curl -X POST http://localhost:9867/profiles -H \"Content-Type: application/json\" -d '{\"name\":\"my-profile\",\"description\":\"For testing\"}'",
- "curlExampleOutput": "{\"status\":\"created\",\"name\":\"my-profile\"}",
+ "curlExampleOutput": "{\"status\":\"created\",\"id\":\"prof_278be87\",\"name\":\"my-profile\"}",
"parameters": "name (string, body, required): Profile name; description (string, body, optional); useWhen (string, body, optional)",
"payload": "{\"name\":\"my-profile\",\"description\":\"For web scraping\",\"useWhen\":\"Production scraping tasks\"}",
- "defaults": "Creates profile directory at ~/.pinchtab/profiles/{name}/Default",
+ "defaults": "Returns profile ID (prof_XXXXXXXX), name, and status",
"examples": {}
},
{
@@ -390,8 +390,8 @@
"cli": false,
"curl": true,
"tldr": "Get profile info by ID or name",
- "curlExample": "curl http://localhost:9867/profiles/278be873adeb",
- "curlExampleOutput": "{\"id\":\"278be873adeb\",\"name\":\"Pinchtab org\",\"created\":\"2026-02-27T20:37:13.599055326Z\",\"diskUsage\":534952089,\"source\":\"created\",\"useWhen\":\"Gmail org\"}",
+ "curlExample": "curl http://localhost:9867/profiles/prof_278be87",
+ "curlExampleOutput": "{\"id\":\"prof_278be87\",\"name\":\"Pinchtab org\",\"created\":\"2026-02-27T20:37:13.599055326Z\",\"diskUsage\":534952089,\"source\":\"created\",\"useWhen\":\"Gmail org\"}",
"parameters": "id (string, path, required): Profile ID or name",
"payload": "N/A (GET request)",
"defaults": "Supports both profile ID (hash) and profile name for backward compatibility",
@@ -406,8 +406,8 @@
"curl": true,
"tldr": "Delete a browser profile",
"cliExample": "pinchtab profile delete my-profile",
- "curlExample": "curl -X DELETE http://localhost:9867/profiles/my-profile",
- "curlExampleOutput": "{\"status\":\"deleted\",\"id\":\"my-profile\",\"name\":\"my-profile\"}",
+ "curlExample": "curl -X DELETE http://localhost:9867/profiles/prof_278be87",
+ "curlExampleOutput": "{\"status\":\"deleted\",\"id\":\"prof_278be87\",\"name\":\"Pinchtab org\"}",
"parameters": "id (string, path, required): Profile ID or name",
"payload": "N/A (DELETE request)",
"defaults": "Recursively deletes profile directory",
@@ -421,8 +421,8 @@
"cli": false,
"curl": true,
"tldr": "Update profile description or useWhen",
- "curlExample": "curl -X PATCH http://localhost:9867/profiles/my-profile -H \"Content-Type: application/json\" -d '{\"description\":\"Updated description\",\"useWhen\":\"New use case\"}'",
- "curlExampleOutput": "{\"status\":\"updated\",\"id\":\"my-profile\",\"name\":\"my-profile\"}",
+ "curlExample": "curl -X PATCH http://localhost:9867/profiles/prof_278be87 -H \"Content-Type: application/json\" -d '{\"description\":\"Updated description\",\"useWhen\":\"New use case\"}'",
+ "curlExampleOutput": "{\"status\":\"updated\",\"id\":\"prof_278be87\",\"name\":\"Pinchtab org\"}",
"parameters": "id (string, path, required): Profile ID or name; description (string, body, optional); useWhen (string, body, optional)",
"payload": "{\"description\":\"For production scraping\",\"useWhen\":\"When extracting data from e-commerce sites\"}",
"defaults": "Only provided fields are updated",
@@ -436,8 +436,8 @@
"cli": false,
"curl": true,
"tldr": "Clear browser cache, cookies, and session data",
- "curlExample": "curl -X POST http://localhost:9867/profiles/my-profile/reset",
- "curlExampleOutput": "{\"status\":\"reset\",\"id\":\"my-profile\",\"name\":\"my-profile\"}",
+ "curlExample": "curl -X POST http://localhost:9867/profiles/prof_278be87/reset",
+ "curlExampleOutput": "{\"status\":\"reset\",\"id\":\"prof_278be87\",\"name\":\"Pinchtab org\"}",
"parameters": "id (string, path, required): Profile ID or name",
"payload": "N/A (POST with no body)",
"defaults": "Clears Sessions, Cache, Cookies, History, etc.",
@@ -451,7 +451,7 @@
"cli": false,
"curl": true,
"tldr": "View actions performed with this profile",
- "curlExample": "curl 'http://localhost:9867/profiles/my-profile/logs?limit=50'",
+ "curlExample": "curl \"http://localhost:9867/profiles/prof_278be87/logs?limit=50\"",
"curlExampleOutput": "[{\"timestamp\":\"2026-03-01T05:12:45Z\",\"action\":\"navigate\",\"url\":\"https://example.com\"},{\"timestamp\":\"2026-03-01T05:12:50Z\",\"action\":\"click\",\"selector\":\"e5\"}]",
"parameters": "id (string, path, required): Profile ID or name; limit (int, query, optional, default: 100)",
"payload": "N/A (GET request)",
@@ -466,7 +466,7 @@
"cli": false,
"curl": true,
"tldr": "View usage statistics and analytics",
- "curlExample": "curl http://localhost:9867/profiles/my-profile/analytics",
+ "curlExample": "curl http://localhost:9867/profiles/prof_278be87/analytics",
"curlExampleOutput": "{\"totalActions\":256,\"averageActionDuration\":2.5,\"topActions\":{\"navigate\":128,\"click\":98,\"type\":30},\"lastUsed\":\"2026-03-01T05:12:50Z\"}",
"parameters": "id (string, path, required): Profile ID or name",
"payload": "N/A (GET request)",
diff --git a/internal/profiles/handlers.go b/internal/profiles/handlers.go
index 8fea4efc..4ad0d91b 100644
--- a/internal/profiles/handlers.go
+++ b/internal/profiles/handlers.go
@@ -90,7 +90,14 @@ func (pm *ProfileManager) handleCreate(w http.ResponseWriter, r *http.Request) {
web.Error(w, 500, err)
return
}
- web.JSON(w, 200, map[string]string{"status": "created", "name": req.Name})
+
+ // Generate and return the profile ID
+ generatedID := profileID(req.Name)
+ web.JSON(w, 200, map[string]any{
+ "status": "created",
+ "id": generatedID,
+ "name": req.Name,
+ })
}
func (pm *ProfileManager) handleImport(w http.ResponseWriter, r *http.Request) {