Workspaces
Workspaces are the top-level container for links, domains, members, and billing.
POST /workspaces
Create a new workspace. New workspaces start on the free plan.
Auth: Required.
curl -X POST https://nobsredir.com/api/workspaces \ -H "X-API-Key: nobs_your_key" \ -H "Content-Type: application/json" \ -d '{"name": "Acme Corp"}'Body:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Workspace display name |
Response 201:
{ "id": "ws_abc123", "name": "Acme Corp", "plan": "free"}Errors:
400- Name is required403- Workspace limit reached for your plan
GET /workspaces
List all workspaces the authenticated user is a member of.
Auth: Required.
curl https://nobsredir.com/api/workspaces \ -H "X-API-Key: nobs_your_key"Response 200:
{ "workspaces": [ { "id": "ws_abc123", "name": "Acme Corp", "plan": "pro", "role": "owner", "member_count": 3, "created_at": "2025-01-15T10:00:00.000Z" } ]}GET /workspaces/:wsId
Get workspace details.
Role: viewer+
curl https://nobsredir.com/api/workspaces/ws_abc123 \ -H "X-API-Key: nobs_your_key"Response 200:
{ "id": "ws_abc123", "name": "Acme Corp", "plan": "pro", "ga_id": "G-XXXXXXXXXX", "ga_api_secret": null, "fb_pixel_id": null, "fb_access_token": null, "retargeting_scripts": null, "default_utm_params": null, "parent_workspace_id": null, "member_count": 3, "created_at": "2025-01-15T10:00:00.000Z"}PATCH /workspaces/:wsId
Update workspace settings. Only send the fields you want to change.
Role: owner
curl -X PATCH https://nobsredir.com/api/workspaces/ws_abc123 \ -H "X-API-Key: nobs_your_key" \ -H "Content-Type: application/json" \ -d '{ "name": "Acme Corp v2", "ga_id": "G-XXXXXXXXXX", "default_utm_params": {"source": "acme", "medium": "shortlink"} }'Body:
| Field | Type | Description |
|---|---|---|
name | string | Workspace display name |
ga_id | string|null | Google Analytics Measurement ID (e.g. G-XXXXXXXXXX) |
ga_api_secret | string|null | GA4 Measurement Protocol API secret |
fb_pixel_id | string|null | Facebook Pixel ID |
fb_access_token | string|null | Facebook Conversions API access token |
retargeting_scripts | string[]|null | Array of script URLs to inject on redirect pages. Requires Team or Agency plan. |
default_utm_params | object|null | Default UTM params applied to all links. {source?, medium?, campaign?, term?, content?} |
All fields optional. Send null to clear a field.
Response 200:
{"ok": true}Errors:
400- No updates provided, invalid retargeting script URL402- Retargeting scripts require a Team or Agency plan
DELETE /workspaces/:wsId
Delete a workspace and all associated data (links, clicks, domains, members, API keys, audit log, usage).
Role: owner
curl -X DELETE https://nobsredir.com/api/workspaces/ws_abc123 \ -H "X-API-Key: nobs_your_key"Response 200:
{"ok": true}This is permanent. No undo.