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

# Update a connected ad account

> Saves the defaults new forms start with and, with `apply_to_forms`, copies the settings to the ad
account's existing forms too.



## OpenAPI

````yaml put /v1/tiktok-lead-ads/advertisers/{id}
openapi: 3.1.0
info:
  title: Flextell API
  version: 0.0.1
  description: >-
    Flextell REST API referansı. Kimlik doğrulama, scope ve istek kuralları için
    API sekmesindeki rehberlere bakın.
servers:
  - url: https://app.flextell.ai/api
    description: Üretim
security:
  - oauth2: []
  - bearer: []
paths:
  /v1/tiktok-lead-ads/advertisers/{id}:
    put:
      tags:
        - TikTokLeadAds
      summary: Update a connected ad account
      description: >-
        Saves the defaults new forms start with and, with `apply_to_forms`,
        copies the settings to the ad

        account's existing forms too.
      operationId: tiktok-lead-ads.advertisers.update
      parameters:
        - name: id
          in: path
          required: true
          description: The connected ad account identifier
          schema:
            type: integer
        - name: X-Tenant
          in: header
          required: true
          description: >-
            Tenant identifier. Send the Tenant ID in the `X-Tenant` header to
            scope API requests to a specific tenant.
          schema:
            type: number
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TikTokLeadAdvertiserUpdateRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: string
                  data:
                    $ref: '#/components/schemas/TikTokLeadAdvertiserResource'
                required:
                  - success
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '404':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  error_code:
                    type: string
                    const: RESOURCE_NOT_FOUND
                  message:
                    type: string
                  errors:
                    type: 'null'
                  data:
                    type: 'null'
                required:
                  - success
                  - error_code
                  - message
                  - errors
                  - data
        '422':
          $ref: '#/components/responses/ValidationException'
        '428':
          description: >-
            Mandatory setup is incomplete. Finish the setup wizard first;
            `data.next_step` names the step to continue with.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    examples:
                      - false
                  error_code:
                    type: string
                    enum:
                      - SETUP_REQUIRED
                    examples:
                      - SETUP_REQUIRED
                  message:
                    type: string
                    examples:
                      - Complete the required setup steps to continue.
                  data:
                    type: object
                    properties:
                      next_step:
                        type:
                          - string
                          - 'null'
                        examples:
                          - clinic_info
                    required:
                      - next_step
                required:
                  - success
                  - error_code
                  - message
                  - data
components:
  schemas:
    TikTokLeadAdvertiserUpdateRequest:
      type: object
      properties:
        auto_enable_new_forms:
          type: boolean
          description: >-
            Switch forms on as soon as Flextell first sees them (new forms
            created in the ad account later).
        settings:
          type: array
          description: >-
            The lead settings new forms of the ad account start with, keyed as
            listed by the integration-entities endpoint; replaces the stored
            ones.
          items:
            type: string
        apply_to_forms:
          type: boolean
          description: >-
            Also overwrite the settings of the ad account's existing forms with
            these.
      title: TikTokLeadAdvertiserUpdateRequest
    TikTokLeadAdvertiserResource:
      type: object
      properties:
        id:
          type: integer
        advertiser_id:
          type: string
          description: The TikTok ad account (advertiser) id.
        name:
          type: string
        status:
          type: string
          description: >-
            `connected`, or `needs_reconnect` when TikTok stopped accepting the
            ad account's token or delivering its leads.
        error_message:
          type:
            - string
            - 'null'
          description: >-
            Why the ad account needs reconnecting, localized; `null` while
            connected.
        auto_enable_new_forms:
          type: boolean
          description: >-
            Whether forms Flextell sees for the first time are switched on right
            away.
        settings:
          type: object
          description: >-
            The lead settings new forms start with, keyed as listed by the
            integration-entities endpoint.
          additionalProperties: {}
        connected_by:
          type:
            - object
            - 'null'
          properties:
            id:
              type: integer
            name:
              type: string
          required:
            - id
            - name
        forms_count:
          type: integer
        enabled_forms_count:
          type: integer
          description: Forms whose leads are being written to Flextell.
        subscribed_at:
          type:
            - string
            - 'null'
          format: date-time
        connected_at:
          type:
            - string
            - 'null'
          format: date-time
        last_lead_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - advertiser_id
        - name
        - status
        - error_message
        - auto_enable_new_forms
        - settings
        - connected_by
        - forms_count
        - enabled_forms_count
        - subscribed_at
        - connected_at
        - last_lead_at
        - created_at
        - updated_at
      title: TikTokLeadAdvertiserResource
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://app.flextell.ai/oauth/authorize
          tokenUrl: https://app.flextell.ai/oauth/token
          scopes:
            '*': all
    bearer:
      type: http
      scheme: bearer

````

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