Before you start
This page is for the new Visual Investigator user who needs the environment-specific values behind the examples before any snippet can work.
What you need before any example
You need these values from your own Viya environment:
base_url: the root Viya URL, such ashttps://viya.example.com- an auth approach supported by this SDK
- access to the services and object types you want to call
- real entity type names from your deployment
- real document ids or alert ids for id-based examples
- real domain ids, scenario ids, and reference-list values for alerting examples
The docs use placeholders like "<your-entity-type>", "<your-domain-id>", and
"<your-document-id>" on purpose. They are not universal VI values.
Start with one authenticated client
The beginner path in these docs uses interactive Authorization Code + PKCE:
from sasvi import SVIClient
from sasvi.auth import AuthorizationCodeTokenProvider
client = SVIClient(
base_url="https://viya.example.com",
auth=AuthorizationCodeTokenProvider(open_browser=True),
)
client.verify_connection()
Use the Authentication guide if you need a different token provider.
SVIClient(...) construction is side-effect-free, and verify_connection() is the explicit
connectivity check that starts the first authenticated request.
How to discover the values behind the examples
Viya base URL
This is the same host you open in the browser for your SAS Viya environment. The SDK expects the root URL, not an individual REST endpoint.
print(client.runtime_config.base_url)
print(client.environment_host)
Entity type names
Use configuration metadata before you write any document code:
entity_types = client.admin.entity_types.list(exclude_unauthorized=False)
print([item.name for item in entity_types[:10]])
Document ids and alert ids
List first, then reuse one returned id:
alerts = client.alerts.list(limit=5)
print([(item.document_id, item.label) for item in alerts])
For entity documents, use search or a known collection flow to find ids in your own environment:
results = client.search.text("<your-search-text>").summary(limit=5)
print([(hit.entity_type_name, hit.document_id, hit.label) for hit in results])
Domain ids, scenario ids, and strategy ids
These values are deployment-specific. Discover them from the config domain first:
domains = client.admin.domains.list(limit=5)
strategies = client.admin.strategies.list(limit=5)
print([(item.domain_id, item.domain_name) for item in domains])
print([(item.strategy_id, item.strategy_name) for item in strategies])
Reference lists and allowed codes
When an example uses a value like "<your-reference-list-name>" or
"<your-disposition-code>", inspect the configured list first:
reference_lists = client.admin.reference_lists.list()
print([item.name for item in reference_lists[:10]])
Then inspect the items on the list you plan to use:
reference_list = client.admin.reference_lists.get(name="<your-reference-list-name>")
if reference_list is not None:
print([(item.code, item.label) for item in reference_list.items.list()])
Permissions and access assumptions
Examples only work when the authenticated user can see the relevant services and object types. Common failure modes are:
- the user can authenticate but cannot read the requested entity type
- the user can list metadata but cannot mutate alerts, workflows, or config records
- the user can reach Viya generally but one service is blocked or routed differently
If the quickstart connectivity check works but a later guide fails, the next thing to verify is service-level permission for that object type or admin surface.
Copy this checklist
Before you open a task guide, make sure you know:
- your Viya
base_url - which auth flow you will use
- one real entity type name
- one real document id or alert id
- one real domain id if you will create alerts
- one real reference-list name if you will use config examples
Next step
Run the Quickstart once you have those values, then use Discover your environment whenever a task guide needs a real VI identifier or code from your own deployment.