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

# Renew a spreadsheet connection

> Use only near access-session expiry, on actual add-on use. Persist the complete command before sending; a lost reply must retry the identical request and next credentials. Successful renewal rotates both credentials and extends the connection inactivity window to 180 days. Reusing a consumed credential for a different command revokes the connection. Current workspace membership, document binding, scopes, network policy and rollout are checked. No idle renewal runs.



## OpenAPI

````yaml POST /api/v2/metrics/client-auth/sessions/{sessionId}/renew
openapi: 3.1.1
info:
  title: chatobserver public API
  version: '2026-09-09'
  description: >-
    Track AI visibility, manage prompts, inspect collected answers and
    citations, and integrate workspace data with your own tools. Visibility
    endpoints use workspace API keys. Data endpoints use scoped service-account
    keys; spreadsheet client endpoints use authorised client sessions. See the
    authentication guide for each credential type.
  contact:
    name: chatobserver support
    url: https://chatobserver.com/contact
    email: support@chatobserver.com
servers:
  - url: https://app.chatobserver.com
    description: Production API
security:
  - WorkspaceKey: []
  - BearerKey: []
tags:
  - name: Workspace
    description: Validate access and list the workspace project and available platforms.
  - name: Prompts
    description: Create, schedule, organise, activate and retrieve tracked prompts.
  - name: Answers
    description: Retrieve collected AI answers, their analysis and visibility trends.
  - name: Brands
    description: Manage brands and compare their visibility in AI answers.
  - name: Sources and citations
    description: Analyse cited domains, pages and ownership across answers.
  - name: Visitor analytics
    description: Read website visitor and crawler analytics for the workspace.
  - name: Content opportunities
    description: Retrieve content-gap findings and recommendations for tracked prompts.
  - name: Usage
    description: Read workspace consumption and allowance summaries.
  - name: Data connections
    description: Discover authorised connections, source accounts and connector catalogues.
  - name: Data queries
    description: >-
      Create versioned queries, publish definitions and inspect integration
      contracts.
  - name: Data operations
    description: >-
      Execute, validate, cancel and inspect operations and page through result
      rows.
  - name: Data delivery
    description: Manage schedules, transfers, destinations and import workflows.
  - name: Data definitions
    description: Manage reusable definitions and their immutable versions.
  - name: Data webhooks
    description: >-
      Configure event delivery, inspect deliveries, replay events and rotate
      secrets.
  - name: Client authorisation
    description: Authorise spreadsheet clients using a user-approved challenge exchange.
  - name: Spreadsheet clients
    description: >-
      Access document-bound client sessions, queries, schedules, bindings and
      write claims.
  - name: AI visibility audits
    description: Create website visibility audits and retrieve their report links.
  - name: Version 1
    description: Integrate with the version 1 visibility and analytics endpoints.
  - name: Tracked coverage
    description: >-
      Track published coverage, maintain its metadata and inspect exact-page
      citation evidence with the same workspace feature access as the dashboard.
  - name: Reports
    description: >-
      Discover accessible native reports and assess exact saved revisions using
      measured, context-specific evidence.
  - name: SEO
    description: >-
      Use authorized workspace SEO tools through the stateless MCP endpoint.
      Availability follows native workspace access and rollout controls; paid
      tools require a separately configured SEO allowance and spending
      admission. OpenSEO AI visibility tools remain unavailable.
paths:
  /api/v2/metrics/client-auth/sessions/{sessionId}/renew:
    post:
      tags:
        - Client authorisation
      summary: Renew a spreadsheet connection
      description: >-
        Use only near access-session expiry, on actual add-on use. Persist the
        complete command before sending; a lost reply must retry the identical
        request and next credentials. Successful renewal rotates both
        credentials and extends the connection inactivity window to 180 days.
        Reusing a consumed credential for a different command revokes the
        connection. Current workspace membership, document binding, scopes,
        network policy and rollout are checked. No idle renewal runs.
      operationId: postV2MetricsClientAuthSessionsSessionIdRenew
      parameters:
        - name: sessionId
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/postV2MetricsClientAuthSessionsSessionIdRenewRequest
      responses:
        '200':
          description: Successful response. Credential replies must not be cached.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/postV2MetricsClientAuthSessionsSessionIdRenewResponse200
        default:
          description: >-
            Inspect the error code and request identifier. Retry only retryable
            failures, respecting retryAfterSeconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataError'
      security: []
components:
  schemas:
    postV2MetricsClientAuthSessionsSessionIdRenewRequest:
      type: object
      properties:
        sessionId:
          type: string
          format: uuid
        renewalToken:
          type: string
          pattern: ^mcr_[A-Za-z0-9_-]{43,64}$
        audience:
          type: string
          const: chatobserver-metrics-sheets
        documentReferenceHash:
          type: string
          pattern: ^[a-f0-9]{64}$
        nextRenewalToken:
          type: string
          pattern: ^mcr_[A-Za-z0-9_-]{43,64}$
        nextSessionToken:
          type: string
          pattern: ^mcs_[A-Za-z0-9_-]{43,64}$
        requestId:
          type: string
          format: uuid
      required:
        - sessionId
        - renewalToken
        - audience
        - documentReferenceHash
        - nextRenewalToken
        - nextSessionToken
        - requestId
      additionalProperties: false
    postV2MetricsClientAuthSessionsSessionIdRenewResponse200:
      type: object
      properties:
        data:
          type: object
          properties:
            token:
              type: string
            sessionId:
              type: string
            workspaceId:
              type: string
            actorId:
              type: string
            clientKind:
              enum:
                - google_sheets
                - excel
              type: string
            scopes:
              type: array
              items:
                enum:
                  - client:read
                  - client:write
                  - client:execute
                type: string
            expiresAt:
              type: string
            documentReferenceHash:
              type: string
              pattern: ^[a-f0-9]{64}$
            renewal:
              type: object
              properties:
                token:
                  type: string
                  pattern: ^mcr_[A-Za-z0-9_-]{43,64}$
                expiresAt:
                  type: string
                  format: date-time
              required:
                - token
                - expiresAt
              additionalProperties: false
          required:
            - token
            - sessionId
            - workspaceId
            - actorId
            - clientKind
            - scopes
            - expiresAt
            - documentReferenceHash
            - renewal
      required:
        - data
    DataError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              enum:
                - internal
                - validation_failed
                - authentication_required
                - forbidden
                - not_found
                - conflict
                - precondition_failed
                - idempotency_conflict
                - capability_unavailable
                - connection_unavailable
                - reauthentication_required
                - rate_limited
                - provider_rate_limited
                - workspace_limit_exceeded
                - result_expired
                - operation_failed
                - temporarily_unavailable
              type: string
            fieldPath:
              type: array
              items:
                anyOf:
                  - type: string
                  - type: number
            parameters:
              type: object
              properties: {}
              additionalProperties:
                anyOf:
                  - type: 'null'
                  - type: string
                  - type: number
                  - type: boolean
                    const: false
                  - type: boolean
                    const: true
            repairActions:
              type: array
              items:
                type: string
                minLength: 1
                maxLength: 96
              maxItems: 10
            requestId:
              type: string
              minLength: 1
              maxLength: 160
            retryable:
              anyOf:
                - type: boolean
                  const: false
                - type: boolean
                  const: true
            retryAfterSeconds:
              anyOf:
                - type: 'null'
                - type: integer
                  exclusiveMinimum: 0
          required:
            - code
            - fieldPath
            - parameters
            - repairActions
            - requestId
            - retryable
            - retryAfterSeconds
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  securitySchemes:
    WorkspaceKey:
      type: apiKey
      in: header
      name: x-chatobserver-key
      description: >-
        A workspace API key. Data endpoints require a service-account key with
        the specified scopes.
    BearerKey:
      type: http
      scheme: bearer
      description: The workspace or service-account API key as a bearer token.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.