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

# Update a portal

> Update a portal to account



## OpenAPI

````yaml /openapi.json patch /api/v1/accounts/{account_id}/portals/{portal_slug}
openapi: 3.1.0
info:
  title: ChatClean API
  description: API REST do ChatClean.
  version: 1.1.0
  contact:
    email: contato@chatclean.com.br
servers:
  - url: https://chat.chatclean.com.br
security: []
tags:
  - name: Account AgentBots
    description: Account-specific Agent Bots
  - name: Agents
    description: Agent management APIs
  - name: Campaigns
    description: >-
      Create, schedule, and manage campaigns. Requires an account administrator
      and API access enabled for the account.
  - name: Canned Responses
    description: Pre-defined responses for common queries
  - name: Contacts
    description: Contact management APIs
  - name: Contact Labels
    description: Manage contact labels
  - name: Conversation Assignments
    description: Manage conversation assignments
  - name: Conversation Labels
    description: Manage conversation labels
  - name: Conversations
    description: Conversation management APIs
  - name: Custom Attributes
    description: Custom fields for contacts and conversations
  - name: Custom Filters
    description: Saved filters for conversations
  - name: Inboxes
    description: Communication channels setup
  - name: Integrations
    description: Third-party integrations
  - name: Labels
    description: Account label management APIs
  - name: Messages
    description: Message management APIs
  - name: Profile
    description: User profile APIs
  - name: Reports
    description: Analytics and reporting APIs
  - name: Teams
    description: Team management APIs
  - name: Webhooks
    description: Event notification webhooks
  - name: Automation Rule
    description: Workflow automation rules
  - name: Help Center
    description: Knowledge base management
  - name: Contacts API
    description: Public contact APIs
  - name: Conversations API
    description: Public conversation APIs
  - name: Messages API
    description: Public message APIs
paths:
  /api/v1/accounts/{account_id}/portals/{portal_slug}:
    parameters:
      - $ref: '#/components/parameters/account_id'
      - $ref: '#/components/parameters/portal_slug'
    patch:
      tags:
        - Help Center
      summary: Update a portal
      description: Update a portal to account
      operationId: update-portal-to-account
      parameters:
        - $ref: '#/components/parameters/account_id'
        - $ref: '#/components/parameters/portal_slug'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/portal_create_update_payload'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/portal_single'
              example:
                payload:
                  id: 123
                  archived: false
                  color: '#1F93FF'
                  config:
                    allowed_locales:
                      - code: en
                        articles_count: 32
                        categories_count: 9
                  custom_domain: ajuda.exemplo.com.br
                  header_text: Handbook
                  homepage_link: https://www.exemplo.com.br
                  name: Handbook
                  slug: handbook
                  page_title: Handbook
                  account_id: 123
                  inbox:
                    id: 123
                    name: ChatClean
                    website_url: exemplo.com.br
                    channel_type: Channel::WebWidget
                    avatar_url: https://example.com/avatar.png
                    widget_color: '#1F93FF'
                    website_token: 4cWzuf9i9jxN9tbnv8K9STKU
                    enable_auto_assignment: true
                    web_widget_script: <script>...</script>
                    welcome_title: Hi there ! 🙌🏼
                    welcome_tagline: We make it simple to connect with us.
                    greeting_enabled: true
                    greeting_message: Hey there 👋, Thank you for reaching out to us.
                    channel_id: 123
                    working_hours_enabled: true
                    enable_email_collect: true
                    csat_survey_enabled: true
                    timezone: America/Los_Angeles
                    business_name: ChatClean
                    hmac_mandatory: true
                  logo:
                    id: 123
                    portal_id: 123
                    file_type: image/png
                    account_id: 123
                    file_url: https://example.com/logo.png
                    blob_id: 123
                    filename: square.png
                  meta:
                    all_articles_count: 32
                    categories_count: 9
                    default_locale: en
        '403':
          description: Access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_error'
        '404':
          description: Portal not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_error'
      security:
        - userBearerAuth: []
        - userApiKey: []
components:
  parameters:
    account_id:
      in: path
      name: account_id
      schema:
        type: integer
      required: true
      description: The numeric ID of the account
    portal_slug:
      in: path
      name: portal_slug
      schema:
        type: string
      required: true
      description: The slug of the portal. The numeric portal ID is not accepted.
      example: handbook
  schemas:
    portal_create_update_payload:
      type: object
      properties:
        color:
          type: string
          description: Header color for help-center in hex format
          example: '#FFFFFF'
        custom_domain:
          type: string
          description: Custom domain to display help center.
          example: ajuda.exemplo.com.br
        header_text:
          type: string
          description: Help center header
          example: Handbook
        homepage_link:
          type: string
          description: link to main dashboard
          example: https://www.exemplo.com.br/
        name:
          type: string
          description: Name for the portal
          example: Handbook
        page_title:
          type: string
          description: Page title for the portal
          example: Handbook
        slug:
          type: string
          description: Slug for the portal to display in link
          example: handbook
        archived:
          type: boolean
          description: Status to check if portal is live
          example: false
        config:
          type: object
          description: Configuration about supporting locales
          example:
            allowed_locales:
              - en
              - es
            default_locale: en
    portal_single:
      type: object
      properties:
        payload:
          $ref: '#/components/schemas/portal_item'
    bad_request_error:
      title: data
      type: object
      properties:
        description:
          type: string
        errors:
          type: array
          items:
            $ref: '#/components/schemas/request_error'
    portal_item:
      type: object
      properties:
        id:
          type: integer
          description: The ID of the portal
        archived:
          type: boolean
          description: Whether the portal is archived
        color:
          type: string
          description: The color code for the portal
        config:
          $ref: '#/components/schemas/portal_config'
        custom_domain:
          type: string
          description: Custom domain for the portal
        header_text:
          type: string
          description: The header text for the portal
        homepage_link:
          type: string
          description: Homepage link for the portal
        name:
          type: string
          description: Name of the portal
        slug:
          type: string
          description: URL slug for the portal
        page_title:
          type: string
          description: Page title for the portal
        account_id:
          type: integer
          description: ID of the account the portal belongs to
        inbox:
          $ref: '#/components/schemas/inbox'
        logo:
          $ref: '#/components/schemas/portal_logo'
        meta:
          $ref: '#/components/schemas/portal_meta'
    request_error:
      type: object
      properties:
        field:
          type: string
        message:
          type: string
        code:
          type: string
    portal_config:
      type: object
      description: Configuration settings for the portal
      properties:
        allowed_locales:
          type: array
          description: List of allowed locales for the portal
          items:
            type: object
            properties:
              code:
                type: string
                description: The language code
              articles_count:
                type: integer
                description: Number of articles in this locale
              categories_count:
                type: integer
                description: Number of categories in this locale
    inbox:
      type: object
      properties:
        id:
          type: number
          description: ID of the inbox
        name:
          type: string
          description: The name of the inbox
        website_url:
          type:
            - string
            - 'null'
          description: Website URL
        page_id:
          type:
            - string
            - 'null'
          description: Facebook Page ID associated with the inbox
        instagram_id:
          type:
            - string
            - 'null'
          description: Instagram account ID associated with the inbox
        business_id:
          type:
            - string
            - 'null'
          description: TikTok business ID associated with the inbox
        provider_name:
          type:
            - string
            - 'null'
          description: Provider username or page name associated with the social inbox
        profile_id:
          type:
            - string
            - 'null'
          description: X profile ID associated with the inbox
        line_channel_id:
          type:
            - string
            - 'null'
          description: LINE channel ID associated with the inbox
        email:
          type:
            - string
            - 'null'
          description: Email address associated with the inbox
        bot_name:
          type:
            - string
            - 'null'
          description: Telegram bot name associated with the inbox
        inbox_identifier:
          type:
            - string
            - 'null'
          description: Public identifier associated with an API inbox
        channel_type:
          type: string
          description: The type of the inbox
        avatar_url:
          type: string
          description: The avatar image of the inbox
        widget_color:
          type:
            - string
            - 'null'
          description: Widget Color used for customization of the widget
        website_token:
          type:
            - string
            - 'null'
          description: Website Token
        enable_auto_assignment:
          type: boolean
          description: The flag which shows whether Auto Assignment is enabled or not
        web_widget_script:
          type:
            - string
            - 'null'
          description: Script used to load the website widget
        welcome_title:
          type:
            - string
            - 'null'
          description: Welcome title to be displayed on the widget
        welcome_tagline:
          type:
            - string
            - 'null'
          description: Welcome tagline to be displayed on the widget
        greeting_enabled:
          type: boolean
          description: The flag which shows whether greeting is enabled
        greeting_message:
          type:
            - string
            - 'null'
          description: A greeting message when the user starts the conversation
        channel_id:
          type: number
          description: ID of the channel this inbox belongs to
        working_hours_enabled:
          type: boolean
          description: The flag which shows whether working hours feature is enabled
        enable_email_collect:
          type: boolean
          description: The flag to enable collecting email from contacts
        csat_survey_enabled:
          type: boolean
          description: The flag to enable CSAT survey
        auto_assignment_config:
          type: object
          description: Configuration settings for auto assignment
        out_of_office_message:
          type:
            - string
            - 'null'
          description: Message to show when agents are out of office
        working_hours:
          type: array
          description: Configuration for working hours of the inbox
          items:
            type: object
            properties:
              day_of_week:
                type: number
                description: Day of the week (0-6, where 0 is Sunday)
              closed_all_day:
                type: boolean
                description: Whether the inbox is closed for the entire day
              open_hour:
                type:
                  - number
                  - 'null'
                description: Hour when inbox opens (0-23)
              open_minutes:
                type:
                  - number
                  - 'null'
                description: Minutes of the hour when inbox opens (0-59)
              close_hour:
                type:
                  - number
                  - 'null'
                description: Hour when inbox closes (0-23)
              close_minutes:
                type:
                  - number
                  - 'null'
                description: Minutes of the hour when inbox closes (0-59)
              open_all_day:
                type: boolean
                description: Whether the inbox is open for the entire day
        timezone:
          type: string
          description: Timezone configuration for the inbox
        callback_webhook_url:
          type:
            - string
            - 'null'
          description: Webhook URL for callbacks
        allow_messages_after_resolved:
          type: boolean
          description: Whether to allow messages after a conversation is resolved
        lock_to_single_conversation:
          type: boolean
          description: Whether to lock a contact to a single conversation
        sender_name_type:
          type: string
          description: Type of sender name to display (e.g., friendly)
        business_name:
          type:
            - string
            - 'null'
          description: Business name associated with the inbox
        branded_email_layout:
          type:
            - string
            - 'null'
          description: >-
            Liquid HTML layout for branded email replies. Available to
            administrators for Email inbox show/update responses.
        hmac_mandatory:
          type:
            - boolean
            - 'null'
          description: Whether HMAC verification is mandatory
        selected_feature_flags:
          type:
            - array
            - 'null'
          description: Selected feature flags for the inbox
          items:
            type: string
        reply_time:
          type:
            - string
            - 'null'
          description: Expected reply time
        messaging_service_sid:
          type:
            - string
            - 'null'
          description: Messaging service SID for SMS providers
        phone_number:
          type:
            - string
            - 'null'
          description: Phone number associated with the inbox
        medium:
          type: string
          description: Medium of communication (e.g., sms, email)
        provider:
          type:
            - string
            - 'null'
          description: Provider of the channel
    portal_logo:
      type: object
      properties:
        id:
          type: integer
          description: ID of the logo file
        portal_id:
          type: integer
          description: ID of the portal this logo belongs to
        file_type:
          type: string
          description: MIME type of the file
        account_id:
          type: integer
          description: ID of the account
        file_url:
          type: string
          description: URL to access the logo file
        blob_id:
          type: integer
          description: ID of the blob
        filename:
          type: string
          description: Name of the file
    portal_meta:
      type: object
      properties:
        all_articles_count:
          type: integer
          description: Total number of articles
        archived_articles_count:
          type:
            - integer
            - 'null'
          description: Number of archived articles
        published_count:
          type:
            - integer
            - 'null'
          description: Number of published articles
        draft_articles_count:
          type:
            - integer
            - 'null'
          description: Number of draft articles
        categories_count:
          type: integer
          description: Number of categories
        default_locale:
          type: string
          description: Default locale for the portal
  securitySchemes:
    userBearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authenticate with `Authorization: Bearer <token>` using a user API token
        from **Profile Settings**.
    userApiKey:
      type: apiKey
      in: header
      name: api_access_token
      description: >-
        Find your API token in **Profile Settings**. The `api_access_token`
        header remains supported, but will be deprecated in a future release.
        For new integrations, use Bearer authentication.

````

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