> ## Documentation Index
> Fetch the complete documentation index at: https://developers.particle.network/llms.txt
> Use this file to discover all available pages before exploring further.

# validateSession

> Learn how to use the validateSession JSON-RPC method.

## Contextualizing `validateSession`

* `validateSession` returns a Boolean, `result`, indicating the validity of a given session key instance. It takes:
  * Account config object:
    * `name` - string.
    * `version` - string.
    * `ownerAddress` - string.
    * `biconomyApiKey` - (optional), string. It should only be used if you'd like to use a Biconomy Paymaster.
  * Array of sessions:
    * Session object:
      * `validUntil` - integer.
      * `validAfter` - integer.
      * `sessionValidationModule` - string.
      * `sessionKeyDataInAbi` (alternative: `sessionKeyData`) - array.

***

## Query example

```json JSON theme={null}
{
    "chainId": 80001,
    "jsonrpc": "2.0",
    "id": "0a7a18a1-53af-45b1-8a7f-4ece06c09e04",
    "method": "particle_aa_validateSession",
    "params": [
        { "name": "BICONOMY", "version": "2.0.0", "ownerAddress": "0xc19dd1f3e212b39a30036EF3DE3F83dEf5a66E41" },
        {
            "sessions": [
                {
                    "validUntil": 0,
                    "validAfter": 0,
                    "sessionValidationModule": "0x4b7f018Fa27a97b6a17b6d4d8Cb3c0e2D9340133",
                    "sessionKeyDataInAbi": [ // or use sessionKeyData to replace
                        ["address", "address", "address", "uint256"],
                        [
                            "0x1dacDa1087C4048774bEce7784EB8EC4CfBeDB2c",
                            "0x909E30bdBCb728131E3F8d17150eaE740C904649",
                            "0x11D266772b85C2C5D4f84A41ca3E08e9f04Fb5D3",
                            1
                        ]
                    ]
                }
            ],
            "targetSession": {
                "validUntil": 0,
                "validAfter": 0,
                "sessionValidationModule": "0x4b7f018Fa27a97b6a17b6d4d8Cb3c0e2D9340133",
                "sessionKeyDataInAbi": [ // or use sessionKeyData to replace
                    ["address", "address", "address", "uint256"],
                    [
                        "0x1dacDa1087C4048774bEce7784EB8EC4CfBeDB2c",
                        "0x909E30bdBCb728131E3F8d17150eaE740C904649",
                        "0x11D266772b85C2C5D4f84A41ca3E08e9f04Fb5D3",
                        1
                    ]
                ]
            }
        }
    ]
}
```


## OpenAPI

````yaml openapi-aa POST /#particle_aa_validateSession
openapi: 3.0.0
info:
  title: Particle Network Account Abstraction RPC
  version: 1.0.0
servers:
  - url: https://rpc.particle.network/evm-chain
security:
  - BasicAuth: []
paths:
  /#particle_aa_validateSession:
    post:
      summary: validateSession
      operationId: particle_aa_validateSession
      requestBody:
        description: Request to validate a session.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ValidateSessionRequest'
      responses:
        '200':
          description: Successful response indicating the session validity.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateSessionResponse'
components:
  schemas:
    ValidateSessionRequest:
      allOf:
        - $ref: '#/components/schemas/RPCRequest'
        - type: object
          properties:
            method:
              enum:
                - particle_aa_validateSession
            params:
              type: array
              description: Parameters for validating a session.
              items:
                type: object
                oneOf:
                  - properties:
                      name:
                        type: string
                        description: Session name.
                        example: Example Session
                      version:
                        type: string
                        description: Session version.
                        example: '1.0'
                      ownerAddress:
                        type: string
                        description: Owner address.
                        example: 0xOwnerAddress
                  - properties:
                      sessions:
                        type: array
                        description: Array of session objects.
                        items:
                          type: object
                      targetSession:
                        type: object
                        description: Target session details.
                        properties:
                          validUntil:
                            type: integer
                            description: Session validity end timestamp.
                            example: 1700000000
                          validAfter:
                            type: integer
                            description: Session validity start timestamp.
                            example: 1600000000
                          sessionValidationModule:
                            type: string
                            description: Session validation module.
                            example: 0xValidationModule
                          sessionKeyDataInAbi:
                            type: array
                            description: Session key data in ABI format.
                            items:
                              oneOf:
                                - type: array
                                  items:
                                    type: string
                                - type: array
                                  items:
                                    type: string
    ValidateSessionResponse:
      allOf:
        - $ref: '#/components/schemas/RPCResponse'
        - type: object
          properties:
            result:
              type: boolean
              description: Indicates if the session is valid.
              example: true
            chainId:
              type: integer
              description: Blockchain chain ID.
              example: 80001
    RPCRequest:
      type: object
      required:
        - jsonrpc
        - id
        - method
        - params
      properties:
        jsonrpc:
          type: string
          default: '2.0'
          description: Version of the JSON-RPC protocol, should be 2.0.
          example: '2.0'
        id:
          type: integer
          default: 1
          description: The request identifier.
          example: 1
        method:
          type: string
          description: API method being called.
        params:
          type: array
          description: Parameters for the API method call.
    RPCResponse:
      type: object
      required:
        - jsonrpc
        - id
        - result
      properties:
        jsonrpc:
          type: string
          default: '2.0'
          description: Version of the JSON-RPC protocol, should be 2.0.
          example: '2.0'
        id:
          type: integer
          default: 1
          description: The request identifier.
          example: 1
        result:
          anyOf:
            - $ref: '#/components/schemas/AnyValue'
        chainId:
          type: integer
          description: The blockchain chain ID.
          example: 80001
    AnyValue:
      anyOf:
        - type: string
        - type: number
        - type: integer
        - type: boolean
        - type: object
        - type: array
          items: {}
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic

````