> For the complete documentation index, see [llms.txt](https://ailens-organization.gitbook.io/virto-connect/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ailens-organization.gitbook.io/virto-connect/api/vos-mock.md).

# Vos Mock

VOS mock authentication API

## GET /api/health

> Health check endpoint

```json
{"openapi":"3.0.0","info":{"title":"Virto API","version":"0.0.2"},"tags":[{"name":"vos-mock","description":"VOS mock authentication API"}],"paths":{"/api/health":{"get":{"operationId":"VosMockController_health","parameters":[],"responses":{"200":{"description":"Service is healthy","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"},"timestamp":{"type":"string"},"service":{"type":"string"}}}}}},"503":{"description":"Service is unhealthy"}},"summary":"Health check endpoint","tags":["vos-mock"]}}}}
```

## GET /api/attestation

> Initialize WebAuthn registration process

```json
{"openapi":"3.0.0","info":{"title":"Virto API","version":"0.0.2"},"tags":[{"name":"vos-mock","description":"VOS mock authentication API"}],"paths":{"/api/attestation":{"get":{"operationId":"VosMockController_attestation","parameters":[{"name":"id","in":"query","required":true,"description":"User ID","schema":{"type":"string"}},{"name":"name","in":"query","required":false,"description":"User display name (defaults to id if not provided)","schema":{"type":"string"}}],"responses":{"200":{"description":"Registration initialization successful, returns attestation options","content":{"application/json":{"schema":{"type":"object","properties":{"publicKey":{"type":"object","properties":{"rp":{"type":"object","properties":{"name":{"type":"string"}}},"user":{"type":"object","properties":{"id":{"type":"array","items":{"type":"integer"},"description":"Hashed user ID as byte array"},"name":{"type":"string"},"displayName":{"type":"string"}}},"challenge":{"type":"string"},"pubKeyCredParams":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"alg":{"type":"integer"}}}},"authenticatorSelection":{"type":"object","properties":{"userVerification":{"type":"string"}}},"timeout":{"type":"number"},"attestation":{"type":"string"}}},"blockNumber":{"type":"number","description":"Blockchain block number when the challenge was generated"}}}}}},"400":{"description":"Bad request - Invalid or missing user data"},"500":{"description":"Internal server error"}},"summary":"Initialize WebAuthn registration process","tags":["vos-mock"]}}}}
```

## POST /api/register

> Complete WebAuthn registration process

```json
{"openapi":"3.0.0","info":{"title":"Virto API","version":"0.0.2"},"tags":[{"name":"vos-mock","description":"VOS mock authentication API"}],"paths":{"/api/register":{"post":{"operationId":"VosMockController_register","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID"},"attestationResponse":{"type":"object","description":"WebAuthn attestation response","properties":{"id":{"type":"string","description":"Credential ID as base64url string"},"rawId":{"type":"string","description":"Raw credential ID as base64url string"},"type":{"type":"string","description":"Type of credential"},"response":{"type":"object","properties":{"authenticatorData":{"type":"string","description":"Base64url encoded authenticator data"},"clientDataJSON":{"type":"string","description":"Base64url encoded client data JSON"},"publicKey":{"type":"string","description":"Base64url encoded public key"}}}}},"blockNumber":{"type":"number","description":"Blockchain block number from the attestation request"}},"required":["userId","attestationResponse","blockNumber"]}}}},"responses":{"200":{"description":"Registration completed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"ext":{"type":"string","description":"Extrinsic data as hex string"},"address":{"type":"string","description":"Address associated with the registration"}}}}}},"400":{"description":"Bad request - Missing required parameters"},"500":{"description":"Internal server error"}},"summary":"Complete WebAuthn registration process","tags":["vos-mock"]}}}}
```

## GET /api/assertion

> Initialize WebAuthn authentication process

```json
{"openapi":"3.0.0","info":{"title":"Virto API","version":"0.0.2"},"tags":[{"name":"vos-mock","description":"VOS mock authentication API"}],"paths":{"/api/assertion":{"get":{"operationId":"VosMockController_assertion","parameters":[{"name":"userId","in":"query","required":true,"schema":{"type":"string"},"description":"User ID for which to generate authentication assertion"}],"responses":{"200":{"description":"Authentication initialization successful, returns assertion options","content":{"application/json":{"schema":{"type":"object","properties":{"publicKey":{"type":"object","properties":{"challenge":{"type":"string","description":"Challenge as hex string"},"allowCredentials":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Credential ID"},"type":{"type":"string"},"transports":{"type":"array","items":{"type":"string"}}}}},"userVerification":{"type":"string"},"timeout":{"type":"number"}}},"blockNumber":{"type":"number","description":"Blockchain block number when the challenge was generated"}}}}}},"400":{"description":"Bad request - User ID is required or User data not found"},"500":{"description":"Internal server error"}},"summary":"Initialize WebAuthn authentication process","tags":["vos-mock"]}}}}
```

## POST /api/connect

> Complete WebAuthn authentication process

```json
{"openapi":"3.0.0","info":{"title":"Virto API","version":"0.0.2"},"tags":[{"name":"vos-mock","description":"VOS mock authentication API"}],"paths":{"/api/connect":{"post":{"operationId":"VosMockController_connect","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","description":"User ID"},"assertionResponse":{"type":"object","description":"WebAuthn assertion response","properties":{"id":{"type":"string","description":"Credential ID as base64url string"},"rawId":{"type":"string","description":"Raw credential ID as base64url string"},"type":{"type":"string","description":"Type of credential"},"response":{"type":"object","properties":{"authenticatorData":{"type":"string","description":"Base64url encoded authenticator data"},"clientDataJSON":{"type":"string","description":"Base64url encoded client data JSON"},"signature":{"type":"string","description":"Base64url encoded signature"}}}}},"blockNumber":{"type":"number","description":"Blockchain block number from the assertion request"}},"required":["userId","assertionResponse","blockNumber"]}}}},"responses":{"200":{"description":"Authentication completed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"command":{"type":"object","properties":{"url":{"type":"string","description":"WebSocket URL for the command"},"body":{"type":"array","description":"Arguments for the transaction"},"hex":{"type":"string","description":"Extrinsic as hex string"}}}}}}}},"400":{"description":"Bad request - Missing required parameters or User data not found"},"500":{"description":"Internal server error"}},"summary":"Complete WebAuthn authentication process","tags":["vos-mock"]}}}}
```

## GET /api/check-user-registered

> Check if a user is registered with WebAuthn

```json
{"openapi":"3.0.0","info":{"title":"Virto API","version":"0.0.2"},"tags":[{"name":"vos-mock","description":"VOS mock authentication API"}],"paths":{"/api/check-user-registered":{"get":{"operationId":"VosMockController_checkUserRegistered","parameters":[{"name":"userId","required":true,"in":"query","schema":{"type":"string"},"description":"User ID to check if registered"}],"responses":{"200":{"description":"Check completed successfully","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","description":"Indicates if the user is registered"}}}}}},"400":{"description":"Bad request - Missing required parameters"},"500":{"description":"Internal server error"}},"summary":"Check if a user is registered with WebAuthn","tags":["vos-mock"]}}}}
```
