# logsSubscribe

## logsSubscribe WebSocket Method

> Subscribe to transaction logging to receive notifications when transactions occur that match specified filter criteria. This method establishes a persistent WebSocket connection that will send real-time log notifications whenever transactions matching your filters are processed by the network. You can filter by all transactions, transactions with votes, or transactions mentioning specific accounts.<br>

````json
{"openapi":"3.0.3","info":{"title":"Solana WebSocket API - logsSubscribe Method","version":"1.0.0"},"tags":[{"name":"Transaction Logs","description":"Methods related to real-time transaction log subscriptions via WebSocket. These methods allow you to monitor transaction executions and receive detailed log information including program outputs, errors, and execution details. You can filter by all transactions, specific programs, or transactions mentioning particular accounts.\n"}],"servers":[{"url":"wss://public.rpc.solanavibestation.com","description":"SVS Public WebSocket Node Endpoint"},{"url":"wss://basic.rpc.solanavibestation.com"},{"url":"wss://ultra.rpc.solanavibestation.com"},{"url":"wss://elite.rpc.solanavibestation.com"},{"url":"wss://epic.rpc.solanavibestation.com"},{"url":"wss://basic.swqos.solanavibestation.com"},{"url":"wss://ultra.swqos.solanavibestation.com"},{"url":"wss://elite.swqos.solanavibestation.com"}],"security":[{},{"AuthHeader":[]},{"URLParameter":[]}],"components":{"securitySchemes":{"AuthHeader":{"type":"apiKey","in":"header","name":"Authorization","description":"Authorization header for API key authentication.\n\n**Example:**\n```\nAuthorization: your-api-key-here\n```\n"},"URLParameter":{"type":"apiKey","in":"query","name":"api_key","description":"API key passed as a URL parameter for authentication.\n\n**Example:**\n```\nwss://public.rpc.solanavibestation.com/?api_key=your-api-key-here\n```\n"}},"schemas":{"LogsSubscribeRequest":{"type":"object","description":"Request object for subscribing to transaction logs via WebSocket","required":["jsonrpc","id","method","params"],"properties":{"jsonrpc":{"type":"string","description":"JSON-RPC protocol version","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"number"}],"description":"Request identifier that will be returned in the response"},"method":{"type":"string","description":"The WebSocket method name","enum":["logsSubscribe"]},"params":{"type":"array","description":"Method parameters array containing the filter criteria and optional configuration object\n","minItems":1,"maxItems":2,"items":{"oneOf":[{"$ref":"#/components/schemas/LogsFilter"},{"$ref":"#/components/schemas/LogsSubscribeOptions"}]}}}},"LogsFilter":{"description":"Filter criteria for selecting which transaction logs to receive. Can be a string for predefined filters or an object for specific mentions.\n","oneOf":[{"type":"string","description":"Predefined filter types","enum":["all","allWithVotes"]},{"type":"object","description":"Custom filter object for transactions mentioning specific accounts","required":["mentions"],"properties":{"mentions":{"type":"array","description":"Array containing a single Pubkey (base58 encoded string). Currently only supports one address per subscription. Subscribe to transactions that mention this address.\n","items":{"type":"string","pattern":"^[A-HJ-NP-Za-km-z1-9]{32,44}$","description":"Base58 encoded public key"},"maxItems":1,"minItems":1}}}]},"LogsSubscribeOptions":{"type":"object","description":"Optional configuration parameters for log subscriptions","properties":{"commitment":{"type":"string","description":"Commitment level for querying the state. Higher commitment levels provide more finality but may have higher latency.\n","enum":["processed","confirmed","finalized"],"default":"finalized"}}},"LogsNotification":{"type":"object","description":"WebSocket notification sent when a transaction log matches the subscription filter","required":["jsonrpc","method","params"],"properties":{"jsonrpc":{"type":"string","description":"JSON-RPC protocol version","enum":["2.0"]},"method":{"type":"string","description":"Notification method name indicating this is a logs notification","enum":["logsNotification"]},"params":{"type":"object","description":"Notification parameters containing the transaction log data","required":["result","subscription"],"properties":{"result":{"type":"object","description":"Transaction log result data","required":["context","value"],"properties":{"context":{"$ref":"#/components/schemas/Context"},"value":{"$ref":"#/components/schemas/TransactionLog"}}},"subscription":{"type":"integer","description":"Subscription ID that triggered this notification. Matches the ID returned from the initial logsSubscribe call.\n","minimum":0}}}}},"Context":{"type":"object","description":"Context information about when the transaction log occurred","required":["slot"],"properties":{"slot":{"type":"integer","description":"The slot number at which this transaction log notification was generated. Slots represent the fundamental unit of time in Solana.\n","minimum":0}}},"TransactionLog":{"type":"object","description":"Transaction log information including signature, error status, and log messages","required":["signature","err","logs"],"properties":{"signature":{"type":"string","description":"The transaction signature base58 encoded. This is the unique identifier for the transaction on the Solana blockchain.\n","pattern":"^[A-HJ-NP-Za-km-z1-9]{87,88}$"},"err":{"description":"Error if transaction failed, null if transaction succeeded. Contains detailed error information when the transaction fails.\n","oneOf":[{"type":"null","description":"Transaction succeeded"},{"type":"object","description":"Transaction error details","additionalProperties":true}]},"logs":{"type":"array","description":"Array of log messages that the transaction instructions output during execution. These provide detailed information about what happened during transaction processing.\n","items":{"type":"string","description":"Individual log message from transaction execution"}}}},"LogsSubscribeResponse":{"type":"object","description":"Response containing the subscription ID for the logs subscription","required":["jsonrpc","id"],"properties":{"jsonrpc":{"type":"string","description":"JSON-RPC protocol version","enum":["2.0"]},"id":{"oneOf":[{"type":"string"},{"type":"number"}],"description":"Request identifier matching the original request"},"result":{"type":"integer","description":"Unique subscription ID for this logs subscription. Use this ID to unsubscribe from notifications using the logsUnsubscribe method.\n","minimum":0},"error":{"$ref":"#/components/schemas/RpcError"}}},"RpcError":{"type":"object","description":"Standard JSON-RPC error object","required":["code","message"],"properties":{"code":{"type":"integer","description":"Numeric error code following JSON-RPC 2.0 specification:\n- `-32700`: Parse error - Invalid JSON was received\n- `-32600`: Invalid request - The JSON sent is not a valid request object\n- `-32601`: Method not found - The method does not exist\n- `-32602`: Invalid params - Invalid method parameter(s)\n- `-32603`: Internal error - Internal JSON-RPC error\n- `-32000`: Server error - WebSocket connection issues or subscription limits\n- `-32001`: Invalid filter - The provided filter format is invalid\n- `-32002`: Multiple mentions not supported - Only one mention address allowed per subscription\n"},"message":{"type":"string","description":"Human-readable error message describing the error"},"data":{"type":"object","description":"Additional structured error information (optional). May contain specific details about what caused the error.\n","additionalProperties":true}}},"ErrorResponse":{"type":"object","description":"JSON-RPC error response for failed requests","required":["jsonrpc","error","id"],"properties":{"jsonrpc":{"type":"string","description":"JSON-RPC protocol version","enum":["2.0"]},"error":{"$ref":"#/components/schemas/RpcError"},"id":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"null"}],"description":"Request identifier from the original request, or null if the request was malformed and no ID could be extracted."}}}}},"paths":{"/":{"post":{"summary":"logsSubscribe WebSocket Method","description":"Subscribe to transaction logging to receive notifications when transactions occur that match specified filter criteria. This method establishes a persistent WebSocket connection that will send real-time log notifications whenever transactions matching your filters are processed by the network. You can filter by all transactions, transactions with votes, or transactions mentioning specific accounts.\n","operationId":"logsSubscribe","tags":["Transaction Logs"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogsSubscribeRequest"}}}},"responses":{"101":{"description":"WebSocket notification for transaction logs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogsNotification"}}}},"200":{"description":"Subscription successfully created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogsSubscribeResponse"}}}},"400":{"description":"Bad Request - Invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"text/plain":{"schema":{"type":"string"}}}},"403":{"description":"Forbidden","content":{"text/plain":{"schema":{"type":"string"}}}},"429":{"description":"Too Many Requests","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal Server Error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}}}
````
