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

# Google Search Console Callback



## OpenAPI

````yaml /openapi.json post /api/v1/brands/{brand_id}/integrations/google-search-console/callback
openapi: 3.1.0
info:
  title: AITasker
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/brands/{brand_id}/integrations/google-search-console/callback:
    post:
      tags:
        - Brand Integrations
      summary: Google Search Console Callback
      operationId: >-
        google_search_console_callback_api_v1_brands__brand_id__integrations_google_search_console_callback_post
      parameters:
        - name: brand_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Brand Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IntegrationCallbackRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IntegrationStatusResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    IntegrationCallbackRequest:
      properties:
        code:
          type: string
          title: Code
        state:
          type: string
          title: State
      type: object
      required:
        - code
        - state
      title: IntegrationCallbackRequest
    IntegrationStatusResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        provider:
          type: string
          title: Provider
        account_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Account Id
        account_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Account Name
        status:
          type: string
          title: Status
        scopes:
          items:
            type: string
          type: array
          title: Scopes
        has_oauth_credentials:
          type: boolean
          title: Has Oauth Credentials
          default: false
        last_synced_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Synced At
        token_expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Token Expires At
        created_at:
          type: string
          format: date-time
          title: Created At
        meta_pages:
          items:
            $ref: '#/components/schemas/MetaPageRef'
          type: array
          title: Meta Pages
          default: []
        ig_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Ig User Id
        meta_ad_account:
          anyOf:
            - $ref: '#/components/schemas/MetaAdAccountRef'
            - type: 'null'
      type: object
      required:
        - id
        - provider
        - account_id
        - account_name
        - status
        - scopes
        - last_synced_at
        - token_expires_at
        - created_at
      title: IntegrationStatusResponse
      description: >-
        Integration status — includes has_oauth_credentials so UI knows when

        the user has saved their own Google Cloud OAuth app credentials.


        SECURITY — ``extra_data`` is deliberately NOT a field here. This model
        is

        the ``response_model`` for the workspace/brand integration-status routes

        (``GET /brands/{id}/integrations/status``,

        ``GET /workspaces/{id}/integrations/status``) and for the nested

        ``WorkspaceDetailResponse.integration_credentials`` list. FastAPI's

        ``response_model`` + Pydantic ``from_attributes`` is a strict
        allow-list:

        only the fields declared below are read off the ORM row and serialized,
        so

        ``IntegrationCredential.extra_data`` is dropped before it reaches the

        client. That matters because OAuth providers (e.g. Meta) stash secrets
        in

        ``extra_data`` — workspace/team Meta publishing flows store encrypted
        Page

        tokens for selection, and brand Meta Ads stores the encrypted Marketing
        API

        user token. Adding an ``extra_data`` field to this model would leak
        those

        tokens to the browser — the exact class of bug fixed for the TEAM status

        endpoint in PR #2079. If a future edit UI needs config from
        ``extra_data``,

        expose a NEW field carrying only the non-secret keys (as

        ``meta_ad_account`` does below) — never the raw dict. Pinned by

        ``tests/contracts/shapes/test_integration_status_response_no_extra_data.py``.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MetaPageRef:
      properties:
        id:
          type: string
          title: Id
        name:
          type: string
          title: Name
      type: object
      required:
        - id
        - name
      title: MetaPageRef
      description: >-
        Non-secret Facebook Page reference for the workspace settings
        page-picker.


        Carries ONLY the page id + display name. NEVER the ``page_access_token``

        that lives alongside these in ``IntegrationCredential.extra_data``.
    MetaAdAccountRef:
      properties:
        account_id:
          type: string
          title: Account Id
        name:
          type: string
          title: Name
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency
      type: object
      required:
        - account_id
        - name
      title: MetaAdAccountRef
      description: Selected Meta Marketing API account, safe to expose to the browser.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````