Skip to main content

Workspaces API

The Workspaces API allows you to list all workspaces that you have access to.

Authentication Required

All API requests require authentication. See API Overview for details.

List Workspaces

Get all workspaces for the authenticated user.

GET /api/workspaces

Response

Returns an array of workspace objects.

[
{
"_id": "507f1f77bcf86cd799439013",
"name": "Marketing Team",
"role": "admin",
"created_at": "2024-01-10T08:00:00Z"
},
{
"_id": "507f1f77bcf86cd799439014",
"name": "Sales Team",
"role": "member",
"created_at": "2024-01-12T10:30:00Z"
}
]

Response Fields

FieldTypeDescription
_idstringUnique workspace identifier
namestringWorkspace name
rolestringYour role in the workspace: admin, member, viewer
created_atstringISO 8601 timestamp of when the workspace was created

Rate Limiting

  • 30 requests per minute per API key

Example Request

curl -H "X-API-Key: your_api_key_here" \
https://production.viacurrent.com/api/workspaces

Use Cases

Use this endpoint to:

  • Get workspace IDs for use with other API endpoints
  • Display a list of available workspaces to users
  • Check your access level in different workspaces

Error Responses

401 Unauthorized

{
"detail": "Invalid or missing API key"
}

429 Too Many Requests

{
"detail": "Rate limit exceeded"
}

Get Workspace Subscription

Get subscription and credit usage information for a specific workspace.

GET /api/workspaces/{workspace_id}/subscription

Path Parameters

ParameterTypeDescription
workspace_idstringRequired. The ID of the workspace.

Response

Returns a subscription info object.

{
"workspace_id": "507f1f77bcf86cd799439013",
"plan": "pro",
"credits_limit": 5000.0,
"credits_used": 1500.0,
"credits_remaining": 3500.0,
"start_at": "2024-01-01T00:00:00Z",
"end_at": "2024-02-01T00:00:00Z",
"max_signal_count": 10,
"max_team_size": 5
}

Response Fields

FieldTypeDescription
workspace_idstringWorkspace identifier
planstringCurrent subscription plan
credits_limitnumberCredit limit for the current period
credits_usednumberCredits used in the current period
credits_remainingnumberCredits remaining in the current period
start_atstringStart date of the current period
end_atstringEnd date of the current period
max_signal_countintegerMaximum number of active signals allowed
max_team_sizeintegerMaximum number of team members allowed

Rate Limiting

  • 30 requests per minute per API key

Example Request

curl -H "X-API-Key: your_api_key_here" \
https://production.viacurrent.com/api/workspaces/507f1f77bcf86cd799439013/subscription

Error Responses

401 Unauthorized

{
"detail": "Invalid or missing API key"
}

403 Forbidden

{
"detail": "Not a member of this workspace"
}

404 Not Found

{
"detail": "no_active_subscription"
}

429 Too Many Requests

{
"detail": "Rate limit exceeded"
}

Next Steps

Once you have a workspace ID, you can: