Session
Privy-backed session context. The API holds no keys - auth is an opaque bearer session token.
Get the current session context
Authorization
sessionToken AuthorizationBearer <token>
Botanary session token from POST /auth/session. Not a key - a revocable session bearer.
In: header
Response Body
application/json
application/json
curl -X GET "https://api.app.botanary.xyz/auth/session"{
"sessionToken": "string",
"accountId": "acct_01H8...",
"signerAddress": "0x8f2A9c4419aD77b0392bC41D8123aa77c0Fe41D0",
"chains": [
{
"name": "Arbitrum",
"chainId": 42161,
"shortName": "arb",
"testnet": false,
"nativeSymbol": "ETH",
"tier": "botanary",
"explorerUrl": "https://base-sepolia.blockscout.com",
"blockscoutUrl": "https://base-sepolia.blockscout.com",
"gasTokens": [
"native",
"USDC"
]
}
],
"issuedAt": "2019-08-24T14:15:22Z",
"expiresAt": "2019-08-24T14:15:22Z",
"locked": true
}{
"error": {
"code": "unauthorized",
"message": "Session token missing or expired."
}
}Exchange a Privy auth token for a Botanary session token
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
privyToken*string
The Privy-issued auth token to verify.
Response Body
application/json
application/json
application/json
curl -X POST "https://api.app.botanary.xyz/auth/session" \ -H "Content-Type: application/json" \ -d '{ "privyToken": "string" }'{
"sessionToken": "string",
"accountId": "acct_01H8...",
"signerAddress": "0x8f2A9c4419aD77b0392bC41D8123aa77c0Fe41D0",
"chains": [
{
"name": "Arbitrum",
"chainId": 42161,
"shortName": "arb",
"testnet": false,
"nativeSymbol": "ETH",
"tier": "botanary",
"explorerUrl": "https://base-sepolia.blockscout.com",
"blockscoutUrl": "https://base-sepolia.blockscout.com",
"gasTokens": [
"native",
"USDC"
]
}
],
"issuedAt": "2019-08-24T14:15:22Z",
"expiresAt": "2019-08-24T14:15:22Z",
"locked": true
}{
"error": {
"code": "out_of_scope",
"message": "This action exceeds the per-action cap.",
"declineReason": "cap_exceeded",
"details": {},
"requestId": "string"
}
}{
"error": {
"code": "unauthorized",
"message": "Session token missing or expired."
}
}End the session (sign out / session lock)
Authorization
sessionToken AuthorizationBearer <token>
Botanary session token from POST /auth/session. Not a key - a revocable session bearer.
In: header
Response Body
application/json
curl -X DELETE "https://api.app.botanary.xyz/auth/session"Empty
{
"error": {
"code": "unauthorized",
"message": "Session token missing or expired."
}
}