Documentation Index Fetch the complete documentation index at: https://docs.toolrouter.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
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.
Endpoint
GET https://api.toolrouter.ai/v1/stacks/{stack_id}/servers/{server_id}/credentials
Authentication
This endpoint requires an API key. Include it in the Authorization header:
Authorization: Bearer YOUR_API_KEY
Path Parameters
The unique identifier of the stack containing the server
The unique identifier of the server to check credentials for
Response
Status of required credentials for this server Each key is a credential field ID, and each value is either “added” or “missing”
Status of optional credentials for this server Each key is a credential field ID, and each value is either “added” or “missing”
Whether all required and optional credentials have been added
required_credentials_added
Whether all required credentials have been added
Example Request
curl -X GET "https://api.toolrouter.ai/v1/stacks/stack_123e4567-e89b-12d3-a456-426614174000/servers/gmail/credentials" \
-H "Authorization: Bearer YOUR_API_KEY"
Example Response
{
"required_credentials" : {
"gmail_oauth_token" : "added" ,
"gmail_client_id" : "added" ,
"gmail_client_secret" : "added"
},
"optional_credentials" : {
"gmail_signature" : "added" ,
"gmail_default_sender" : "added"
},
"all_credentials_added" : true ,
"required_credentials_added" : true
}
Some Credentials Missing
{
"required_credentials" : {
"gmail_oauth_token" : "added" ,
"gmail_client_id" : "missing" ,
"gmail_client_secret" : "missing"
},
"optional_credentials" : {
"gmail_signature" : "missing" ,
"gmail_default_sender" : "missing"
},
"all_credentials_added" : false ,
"required_credentials_added" : false
}
{
"required_credentials" : {
"gmail_oauth_token" : "missing" ,
"gmail_client_id" : "missing" ,
"gmail_client_secret" : "missing"
},
"optional_credentials" : {
"gmail_signature" : "missing" ,
"gmail_default_sender" : "missing"
},
"all_credentials_added" : false ,
"required_credentials_added" : false
}
Understanding the Response
Status Values
“added” : The credential has been configured and is available for use
“missing” : The credential has not been configured yet
Boolean Flags
required_credentials_added : true if all required credentials are configured. Tools may not work properly if this is false.
all_credentials_added : true if both required and optional credentials are configured. This indicates full functionality is available.
Use Cases
Check credential status before using tools to ensure they will work:
# Check credentials first
status_response = requests.get( f "https://api.toolrouter.ai/v1/stacks/ { stack_id } /servers/ { server_id } /credentials" , headers = headers)
status = status_response.json()
if not status[ "required_credentials_added" ]:
print ( "Required credentials missing. Please configure them before using tools." )
# Handle missing credentials
else :
# Proceed with tool usage
pass
Configuration Validation
Verify credential setup after adding a server to a stack:
# Add server to stack
add_response = requests.post( f "https://api.toolrouter.ai/v1/stacks/ { stack_id } /servers" , headers = headers, json = server_data)
# Check credential status
status_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 configured
for cred_id, status_value in status[ "required_credentials" ].items():
if status_value == "missing" :
print ( f "Required credential ' { cred_id } ' needs to be configured" )
Monitoring and Alerts
Use this endpoint to monitor credential health across your stacks:
# Check all servers in a stack
for 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" )
Error Responses
Invalid or missing API key {
"detail" : "Unauthorized"
}
Stack, server, or server not found in stack {
"detail" : "Stack not found"
}
{
"detail" : "Server gmail not found in stack stack_123e4567-e89b-12d3-a456-426614174000"
}
Rate limit exceeded {
"detail" : "Too many requests"
}
500 Internal Server Error
Server error occurred {
"detail" : "Failed to get credentials status"
}
Next Steps
After checking credentials status:
Configure missing credentials : Use Update Credentials to add missing credentials
Test functionality : Try invoking tools to ensure credentials work properly
Monitor regularly : Check credentials status periodically to ensure they remain valid