Overview
TheServerResource provides methods for retrieving server information, managing API tokens, and checking server capabilities. Access it via client.server after creating your SpeckleClient.
Methods
get()
Get detailed information about the Speckle server.ServerInfo
Server information object
version()
Get the server version as a parsed tuple for easy version comparison.Tuple
Version tuple in format
(major, minor, patch) or (major, minor, patch, tag, build) for
pre-release versionsapps()
Get the list of apps registered on the server.Dict
Dictionary of registered apps
App for property details.
create_token()
Create a new personal API token programmatically.str
required
A descriptive name for the token
List[str]
required
List of scope names to grant
int
required
Token lifespan in seconds
str
The newly created token string
streams:read- Read project/stream datastreams:write- Write project/stream dataprofile:read- Read user profileprofile:email- Access user emailprofile:delete- Delete user profileusers:read- Read other user informationusers:email- Access other user emailstokens:read- Read token informationtokens:write- Create/revoke tokens
revoke_token()
Revoke (delete) a personal API token.str
required
The token string to revoke
bool
True if the token was successfully revokedYou can only revoke tokens that belong to your authenticated account.
Types
ServerInfo
Represents detailed information about a Speckle server.str
Server name
str
Company name
str
Server description
str
Admin contact email
str
Server canonical URL
str
Server version string (e.g., “3.0.0”)
List[Scope]
Available API scopes -
name (str) - Scope name - description (str) - Scope descriptionList[AuthStrategy]
Available authentication strategies -
id (str) - Strategy ID - name (str) - Strategy name -
icon (str, optional) - Icon URLWorkspacesInfo
Workspace feature information -
workspacesEnabled (bool) - Whether workspaces are enabledApp
Represents an application registered on the Speckle server.str
App ID
str
App name
str
App description
str
Terms and conditions URL
bool
Whether app is trusted by default
str
App logo URL
dict
App author information -
id (str) - Author user ID - name (str) - Author name - avatar (str,
optional) - Author avatar URLFAQ
How do I check if a server supports specific features?
How do I check if a server supports specific features?
Use
get() to retrieve server information and check capabilities:How do I compare server versions in my code?
How do I compare server versions in my code?
Use the
version() method which returns a comparable tuple:What scopes should I request for my token?
What scopes should I request for my token?
Request only the scopes you need:
- Read-only access:
["streams:read", "profile:read"] - Basic read/write:
["streams:read", "streams:write", "profile:read"] - Automation/CI:
["streams:read", "streams:write", "profile:read", "tokens:write"] - Admin operations: Check server’s available scopes with
get()
client.server.get().scopes to see all available scopes and their descriptions.How long should I set my token lifespan?
How long should I set my token lifespan?
Token lifespan recommendations:
- Development/testing: 7-30 days (
604800-2592000seconds) - CI/CD pipelines: 90-365 days (
7776000-31536000seconds) - Production services: 365 days, with rotation strategy
- Temporary access: 1-7 days (
86400-604800seconds)
Can I list all my existing tokens?
Can I list all my existing tokens?
The
ServerResource doesn’t provide a method to list tokens directly. To manage your tokens:- Log in to the Speckle web interface
- Go to your profile settings
- Navigate to “Personal Access Tokens”
- View and manage all your tokens there
ActiveUserResource methods if available in your version.What happens if I create a token with invalid scopes?
What happens if I create a token with invalid scopes?
The server will reject the request if you specify scopes that don’t exist or that you don’t have access to. Always check available scopes first:
Related Resources
SpeckleClient
Main client documentation
ActiveUserResource
User profile operations