Retrieves the status of required and optional credentials for a specific server in your stack. This helps you understand which credentials are already configured and which are missing.
Verify credential setup after adding a server to a stack:
Copy
# Add server to stackadd_response = requests.post(f"https://api.toolrouter.ai/v1/stacks/{stack_id}/servers", headers=headers, json=server_data)# Check credential statusstatus_response = requests.get(f"https://api.toolrouter.ai/v1/stacks/{stack_id}/servers/{server_id}/credentials", headers=headers)status = status_response.json()# Show which credentials need to be configuredfor cred_id, status_value in status["required_credentials"].items(): if status_value == "missing": print(f"Required credential '{cred_id}' needs to be configured")
Use this endpoint to monitor credential health across your stacks:
Copy
# Check all servers in a stackfor server in stack_servers: status_response = requests.get(f"https://api.toolrouter.ai/v1/stacks/{stack_id}/servers/{server['server_id']}/credentials", headers=headers) status = status_response.json() if not status["required_credentials_added"]: print(f"Alert: Server {server['server_id']} has missing required credentials")