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

# Scan for new competitor ads

> Reads every tracked competitor's ads again for one brand, in the background (a few minutes). Charges 30 credits on the call; a scan that reads nothing gives them back. Once per brand every 12 hours. `GET /v1/competitors` says `scan_running` until it ends; then `GET /v1/competitor-ads?new_only=true`. Needs a write key and a plan that includes Trends.



## OpenAPI

````yaml /openapi.json post /v1/competitor-ads/scan
openapi: 3.1.0
info:
  title: Creatorline API
  version: 1.0.0
  description: >-
    Generate AI influencer photos and videos, and publish them to your brands'
    social

    accounts — from your own backend, your scripts, or a coding agent.


    Every request authenticates with an organization-scoped API key and is
    charged against

    that organization's credits, at the same prices the studio shows.
servers:
  - url: https://api.creatorline.io
    description: Production
  - url: http://localhost:3000/api
    description: Local development (the same routes, under the app's own /api prefix)
security:
  - bearerAuth: []
  - apiKeyHeader: []
tags:
  - name: Account
    description: Who the key belongs to, and what it can spend.
  - name: Catalog
    description: The live tool and model catalog. Read it, do not hardcode it.
  - name: Brands
    description: >-
      What a generation or a post belongs to: niche, language, content, a
      default avatar, and the connections it posts through.
  - name: Avatars
    description: The reusable identities (face, voice, persona) a run renders with.
  - name: Connections
    description: The social accounts a brand posts through, and the avatar pinned to each.
  - name: Competitors
    description: >-
      What a brand's tracked competitors post and advertise: Trends and Ad
      Intelligence, and the scan that reads new ads.
  - name: Generations
    description: Start, price and poll image and video runs.
  - name: Assets
    description: The media library, and uploading your own files.
  - name: Folders
    description: >-
      A brand's Library folders: one tree per brand, two levels, an item in one
      folder or none.
  - name: Tags
    description: >-
      The workspace's own labels for its Library items. A tag is a label only:
      tagging starts nothing and publishes nothing.
  - name: Posts
    description: Turn media into a post and publish it to social platforms.
  - name: Credits
    description: Balance and the consumption ledger.
paths:
  /v1/competitor-ads/scan:
    post:
      tags:
        - Competitors
      summary: Scan for new competitor ads
      description: >-
        Reads every tracked competitor's ads again for one brand, in the
        background (a few minutes). Charges 30 credits on the call; a scan that
        reads nothing gives them back. Once per brand every 12 hours. `GET
        /v1/competitors` says `scan_running` until it ends; then `GET
        /v1/competitor-ads?new_only=true`. Needs a write key and a plan that
        includes Trends.
      operationId: scanCompetitorAds
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                brand_id:
                  type: string
              required:
                - brand_id
      responses:
        '202':
          description: The scan started.
          headers:
            x-request-id:
              description: >-
                Correlation id for this request. Quote it in any support
                question.
              schema:
                type: string
            x-ratelimit-limit:
              description: Requests allowed per minute.
              schema:
                type: integer
            x-ratelimit-remaining:
              description: Requests left in the current window.
              schema:
                type: integer
            x-ratelimit-reset:
              description: Unix seconds when the window resets.
              schema:
                type: integer
          content:
            application/json:
              schema:
                type: object
                properties:
                  brand_id:
                    type: string
                  credits:
                    type: integer
                  started_at:
                    type: string
                    format: date-time
        '400':
          description: Invalid request. `param` names the offending field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: invalid_request_error
                  code: invalid_parameter
                  message: '`brand_id` is required: a brand id from GET /v1/brands.'
                  param: brand_id
                request_id: req_8fQ2mRxK1pLd
        '401':
          description: Missing, malformed, revoked or expired key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: authentication_error
                  code: invalid_api_key
                  message: Missing or invalid API key.
                request_id: req_8fQ2mRxK1pLd
        '402':
          description: >-
            Nothing was charged and nothing was started. `insufficient_credits`:
            the balance does not cover the run; `upgrade_url` is the page where
            the person tops up or moves up a plan. `trial_not_started`: the
            workspace is in its free trial, which pays for nothing, so nothing
            that spends credits runs until its plan is started
            (`start_plan_url`); a top-up does not change that.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                insufficient_credits:
                  summary: The balance is short
                  value:
                    error:
                      type: insufficient_credits_error
                      code: insufficient_credits
                      message: >-
                        This request costs 30 credits and the workspace has 12.
                        The person can top up, or move up a plan for more
                        credits every month, here:
                        https://app.creatorline.io/upgrade-plan?for=credits&cost=30
                    request_id: req_8fQ2mRxK1pLd
                    required_credits: 30
                    credit_balance: 12
                    upgrade_url: >-
                      https://app.creatorline.io/upgrade-plan?for=credits&cost=30
                trial_not_started:
                  summary: The workspace is in its free trial
                  value:
                    error:
                      type: insufficient_credits_error
                      code: trial_not_started
                      message: >-
                        Generating is for paying customers. This workspace is in
                        its free trial, which pays for nothing yet, so nothing
                        that spends credits runs until its plan is started (a
                        top-up does not change that). Nothing was charged and
                        nothing was made. An owner or admin of the workspace can
                        start the plan now: https://app.creatorline.io/upsell
                    request_id: req_8fQ2mRxK1pLd
                    required_credits: 30
                    credit_balance: 0
                    start_plan_url: https://app.creatorline.io/upsell
        '403':
          description: The key exists but may not do this (read-only key).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: permission_error
                  code: insufficient_scope
                  message: >-
                    This API key is read-only. Create a key with the `write`
                    scope to run generations.
                request_id: req_8fQ2mRxK1pLd
        '404':
          description: No such resource — including one that belongs to another workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  type: not_found_error
                  code: resource_missing
                  message: No such generation.
                request_id: req_8fQ2mRxK1pLd
components:
  schemas:
    Error:
      type: object
      description: >-
        Every failure has this shape. `param` names the offending field when
        there is one.
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - not_found_error
                - rate_limit_error
                - insufficient_credits_error
                - api_error
            code:
              type: string
            message:
              type: string
            param:
              type: string
          required:
            - type
            - code
            - message
        request_id:
          type: string
        required_credits:
          type: number
          description: 402 only.
        credit_balance:
          type: number
          description: 402 only.
        start_plan_url:
          type: string
          description: >-
            402 `trial_not_started` only: where an owner or admin of the
            workspace starts its plan, which ends the free trial.
        upgrade_url:
          type: string
          description: >-
            402 `insufficient_credits` and 403 `plan_required`: the page where
            an owner or admin of the workspace gets past the limit, by a top-up
            or the next plan up. Give it to the person as a link.
      required:
        - error
        - request_id
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your organization's API key, from Settings → MCP. `Authorization: Bearer
        crl_sk_live_…`
    apiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: Alternative to the Authorization header, for tooling that prefers it.

````

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