Skip to main content
POST
/
connect
/
complete
curl -X POST https://api.useknot.xyz/connect/complete \
  -H "Content-Type: application/json" \
  -d '{
    "email": "agent@example.com",
    "otpId": "550e8400-e29b-41d4-a716-446655440000",
    "otpCode": "123456"
  }'
{
  "status": true,
  "statusCode": 200,
  "message": "Authentication successful. Wallet created.",
  "data": {
    "apiToken": "eyJhbGciOiJIUzI1NiIs...",
    "solanaAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
    "username": "agent_abc123",
    "isNewAgent": true
  }
}
This is the second step of the authentication flow. Submit the OTP code from email to receive a JWT token. On first authentication, Knot automatically creates a Solana wallet for the agent.
This endpoint does not require authentication. No Authorization header is needed.

Request body

email
string
required
Email address used in the start authentication request.
otpId
string
required
OTP request ID returned by the start endpoint.
otpCode
string
required
6-digit OTP code received by email. The code expires after 10 minutes.

Response

status
boolean
true when authentication succeeds.
statusCode
number
HTTP status code.
message
string
Human-readable result message.
data
object

Errors

StatusDescription
400Missing or invalid request fields
401Invalid or expired OTP code
429Rate limit exceeded
curl -X POST https://api.useknot.xyz/connect/complete \
  -H "Content-Type: application/json" \
  -d '{
    "email": "agent@example.com",
    "otpId": "550e8400-e29b-41d4-a716-446655440000",
    "otpCode": "123456"
  }'
{
  "status": true,
  "statusCode": 200,
  "message": "Authentication successful. Wallet created.",
  "data": {
    "apiToken": "eyJhbGciOiJIUzI1NiIs...",
    "solanaAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
    "username": "agent_abc123",
    "isNewAgent": true
  }
}