---
title: "Validates and refreshes the access token if necessary."
method: POST
path: "/validateAccessToken"
---

# Validates and refreshes the access token if necessary.

`POST /validateAccessToken`

This function checks the validity of the current access token. If the token is invalid, it attempts to refresh it using the refresh token. The function is useful for maintaining an active session and ensuring API requests have valid authentication.

## Request body

- object
  - `body` object — Body of the validateAccessToken sls call
    - `arguments` unknown[], required
      - unknown
    - `auth` object — Authentication object
      - `strategy` 'oauth2' — Authentication strategy
      - `variables` unknown[] — Variables for the authentication strategy
        - unknown
    - `packageName` string — @microfox/google-sheets

## Response `200`

Successful response

- object
  - `isValid` boolean — Indicates whether the access token is valid

## Other responses

- `400` — Bad Request - Invalid input or unable to refresh token
- `401` — Unauthorized - Both access token and refresh token are invalid
- `500` — Internal Server Error

## Changes

- **2025-05-29** `470b95f73df9` — 3 breaking, 1 info
  - the response property `error` became optional for the status `400`
  - the response property `error` became optional for the status `500`
  - the response property `isValid` became optional for the status `200`
  - added the non-success response with the status `401`
- **2025-05-28** `77260ff78232` — 4 info
  - removed the non-success response with the status `401`
  - the response property `error` became required for the status `400`
  - the response property `error` became required for the status `500`
  - the response property `isValid` became required for the status `200`

[Change history](https://skmtc.dev/microfox-ai/apis/google-sheets-sdk-api/changes/validateAccessToken/post.md)

---

[API](https://skmtc.dev/microfox-ai/apis/google-sheets-sdk-api.md) · [All operations](https://skmtc.dev/microfox-ai/apis/google-sheets-sdk-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/microfox-ai/google-sheets-sdk-api/revisions/85db428f2808/schema)
