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

# Start RSA generation for an ad group (creates 3 RSAs)

> Start RSA generation for a specific ad group using Gemini AI.

Company info is auto-resolved from the draft's linked customer.
Kicks off a background task. Returns immediately with task_id for polling.



## OpenAPI

````yaml https://dev-api.cattix.com/openapi.json post /api/v1/campaigns/drafts/{draft_id}/ad-groups/{ad_group_id}/rsa/generate
openapi: 3.1.0
info:
  title: CATTIX API
  description: CATTIX Backend API
  version: 0.107.0
servers:
  - url: http://localhost:8000
    description: Local
  - url: https://dev-api.cattix.com
    description: Development
  - url: https://staging-api.cattix.com
    description: Staging
  - url: https://api.cattix.com
    description: Production
security: []
paths:
  /api/v1/campaigns/drafts/{draft_id}/ad-groups/{ad_group_id}/rsa/generate:
    post:
      tags:
        - Campaigns
      summary: Start RSA generation for an ad group (creates 3 RSAs)
      description: >-
        Start RSA generation for a specific ad group using Gemini AI.


        Company info is auto-resolved from the draft's linked customer.

        Kicks off a background task. Returns immediately with task_id for
        polling.
      operationId: >-
        generate_rsa_for_ad_group_endpoint_api_v1_campaigns_drafts__draft_id__ad_groups__ad_group_id__rsa_generate_post
      parameters:
        - name: draft_id
          in: path
          required: true
          schema:
            type: integer
            title: Draft Id
        - name: ad_group_id
          in: path
          required: true
          schema:
            type: integer
            title: Ad Group Id
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateRSAStartResponseSchema'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    GenerateRSAStartResponseSchema:
      properties:
        rsa_ids:
          items:
            type: integer
          type: array
          title: Rsa Ids
          description: IDs of the 3 created RSA records
        task_id:
          type: string
          title: Task Id
        status:
          $ref: '#/components/schemas/TaskGenerationStatus'
          default: in_progress
      type: object
      required:
        - rsa_ids
        - task_id
      title: GenerateRSAStartResponseSchema
      description: Response when starting RSA generation (3 RSAs per ad group).
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TaskGenerationStatus:
      type: string
      enum:
        - not_started
        - pending
        - in_progress
        - completed
        - failed
      title: TaskGenerationStatus
      description: Status of background task generation (ad groups, RSAs).
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: api/v1/users/authorization/token

````