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.Server information object
version()
Get the server version as a parsed tuple for easy version comparison.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.Dictionary of registered apps
create_token()
Create a new personal API token programmatically.A descriptive name for the token
List of scope names to grant
Token lifespan in seconds
The newly created token string
The token is only shown once when created. Store it securely immediately!
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.The token string to revoke
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.Server name
Company name
Server description
Admin contact email
Server canonical URL
Server version string (e.g., “3.0.0”)
Available API scopes
name(str) - Scope namedescription(str) - Scope description
Available authentication strategies
id(str) - Strategy IDname(str) - Strategy nameicon(str, optional) - Icon URL
Workspace feature information
workspacesEnabled(bool) - Whether workspaces are enabled
App
Represents an application registered on the Speckle server.App ID
App name
App description
Terms and conditions URL
Whether app is trusted by default
App logo URL
App author information
id(str) - Author user IDname(str) - Author nameavatar(str, optional) - Author avatar URL
Frequently Asked Questions
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: