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

# Update Platform Asset

> Advanced immediate provider operation to rename, pause, resume, archive, or rebudget supported campaigns and ad sets, plus supported ad-level actions. Normal Ads Manager requests should saveAdDraft first, read/review it, then explicitly publishAdDraft. Meta and Google budget writes require the version 1 budgetGuard from read-asset-budget, exact selected native owner/parent and a budget-only update with the unchanged cadence. Old unguarded absolute/relative budget bodies require a new review and submit no budget change. Bily never rebases the saved absolute amount or retargets an inherited Meta ad set. Google shared scope must be complete and at most 100; CUSTOM_PERIOD is unsupported. Generic Google status/name/removal is checked against the exact fresh native campaign and parent; classic VIDEO and budgets affecting VIDEO are read only. Dedicated Demand Gen video remains supported; the native v24+ responsive Video-ad-info and experiment exceptions are not generic update-asset operations. Native-owner arbitration covers separate jobs and authorized aliases. New unguarded budget drafts fail Save; overbound mixed financial jobs require a split review. Busy or unknown outcomes never replay automatically; unknown outcomes quarantine the exact owner with its original receipt beyond job retirement. ARCHIVED maps to native removal for Google, TikTok and Snapchat; require separate exact destructive approval rather than treating it as a reversible pause. Authorized Slack requests use this same workspace-scoped capability; pausing an ad requires its exact platform, asset type, and asset ID. This generic outer sourceAuthority remains GOOGLE_ADS only; Meta budget source is bound inside budgetGuard. Other providers and nonbudget fields keep their previous contracts. This is an execution endpoint. For a reviewed user change, save its supported capability/body as an immutable action draft, review it, and explicitly publish that draft. Check action-jobs/capabilities before staging; a catalog entry alone does not make it stageable.



## OpenAPI

````yaml /openapi.json post /platform/{resourceUrl}/actions/update-asset
openapi: 3.1.0
info:
  title: Bily API
  version: 1.0.0
  description: >-
    Discover stores, read analytics and commerce data, inspect connections, and
    run explicitly authorized actions with the Bily API.
  contact:
    name: Bily support
    email: support@bily.ai
servers:
  - url: https://app.bily.ai/api/customer/v1
    description: Production
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Identity
    description: Discover the identity and organizations attached to a key.
  - name: Stores
    description: Discover stores within an organization.
  - name: Store data
    description: Read store profiles, readiness, catalogs, and connected accounts.
  - name: Commerce
    description: Run scoped commerce reads and explicitly approved GraphQL mutations.
  - name: Analytics
    description: >-
      Read normalized advertising, attribution, product, customer, and cohort
      metrics.
  - name: Analytics SQL
    description: Run constrained read-only SQL over store-scoped Bily datasets.
  - name: Customer journeys
    description: Read customer touchpoints within an authenticated store scope.
  - name: Connections
    description: Inspect available connections, support, and advertising assets.
  - name: Supported actions
    description: Synchronize connections and update supported advertising assets.
  - name: Campaign actions
    description: Create or clone supported advertising campaign resources.
  - name: Ad drafts and jobs
    description: Save, review, publish and reconcile immutable advertising changes.
  - name: Creative library
    description: >-
      Analyze references and retain generated images separately from ad
      publication.
  - name: Tracking connections
    description: >-
      List and manage store-scoped tracking connections without returning
      credential secrets.
  - name: Tracking evidence
    description: >-
      Inspect installation, incoming receipts, reviewed events and destination
      evidence within one workspace.
paths:
  /platform/{resourceUrl}/actions/update-asset:
    post:
      tags:
        - Campaign actions
      summary: Update Platform Asset
      description: >-
        Advanced immediate provider operation to rename, pause, resume, archive,
        or rebudget supported campaigns and ad sets, plus supported ad-level
        actions. Normal Ads Manager requests should saveAdDraft first,
        read/review it, then explicitly publishAdDraft. Meta and Google budget
        writes require the version 1 budgetGuard from read-asset-budget, exact
        selected native owner/parent and a budget-only update with the unchanged
        cadence. Old unguarded absolute/relative budget bodies require a new
        review and submit no budget change. Bily never rebases the saved
        absolute amount or retargets an inherited Meta ad set. Google shared
        scope must be complete and at most 100; CUSTOM_PERIOD is unsupported.
        Generic Google status/name/removal is checked against the exact fresh
        native campaign and parent; classic VIDEO and budgets affecting VIDEO
        are read only. Dedicated Demand Gen video remains supported; the native
        v24+ responsive Video-ad-info and experiment exceptions are not generic
        update-asset operations. Native-owner arbitration covers separate jobs
        and authorized aliases. New unguarded budget drafts fail Save; overbound
        mixed financial jobs require a split review. Busy or unknown outcomes
        never replay automatically; unknown outcomes quarantine the exact owner
        with its original receipt beyond job retirement. ARCHIVED maps to native
        removal for Google, TikTok and Snapchat; require separate exact
        destructive approval rather than treating it as a reversible pause.
        Authorized Slack requests use this same workspace-scoped capability;
        pausing an ad requires its exact platform, asset type, and asset ID.
        This generic outer sourceAuthority remains GOOGLE_ADS only; Meta budget
        source is bound inside budgetGuard. Other providers and nonbudget fields
        keep their previous contracts. This is an execution endpoint. For a
        reviewed user change, save its supported capability/body as an immutable
        action draft, review it, and explicitly publish that draft. Check
        action-jobs/capabilities before staging; a catalog entry alone does not
        make it stageable.
      operationId: ads-update-asset
      parameters:
        - name: resourceUrl
          in: path
          required: true
          description: Exact workspace URL returned by GET /context.
          schema:
            type: string
        - $ref: '#/components/parameters/OrganizationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAssetRequest'
      responses:
        '200':
          description: >-
            Request completed. Inspect the returned state and any verification
            fields.
          headers:
            x-request-id:
              schema:
                type: string
              description: Keep this identifier for diagnostics.
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  parameters:
    OrganizationId:
      name: x-bily-organization-id
      in: header
      required: false
      description: >-
        An organization ID returned by GET /context or GET /organizations. Omit
        it when a scoped key supplies the organization. Otherwise provide it
        when no organization is selected.
      schema:
        type: string
        example: org_01J8W7T9G3E6ZQ4M2K5N8P1R0S
  schemas:
    UpdateAssetRequest:
      type: object
      required:
        - platform
        - assetType
        - assetId
        - updates
      allOf:
        - if:
            required:
              - sourceAuthority
          then:
            properties:
              platform:
                const: GOOGLE_ADS
                type: string
        - if:
            required:
              - platform
              - updates
            properties:
              platform:
                enum:
                  - FACEBOOK
                  - GOOGLE_ADS
                type: string
              updates:
                anyOf:
                  - required:
                      - budget
                  - required:
                      - budgetType
          then:
            required:
              - adAccountId
              - budgetGuard
        - if:
            required:
              - budgetGuard
          then:
            required:
              - adAccountId
              - budgetGuard
            properties:
              platform:
                enum:
                  - FACEBOOK
                  - GOOGLE_ADS
                type: string
              assetType:
                enum:
                  - campaign
                  - adset
                type: string
              updates:
                type: object
                additionalProperties: false
                required:
                  - budget
                  - budgetType
                properties:
                  budget:
                    type: number
                    exclusiveMinimum: 0
                  budgetType:
                    enum:
                      - daily
                      - lifetime
                    type: string
        - if:
            properties:
              platform:
                const: GOOGLE_ADS
                type: string
            required:
              - platform
              - budgetGuard
          then:
            required:
              - sourceAuthority
            properties:
              assetType:
                const: campaign
                type: string
      properties:
        platform:
          type: string
          enum:
            - FACEBOOK
            - GOOGLE_ADS
            - MICROSOFT
            - LINKEDIN
            - SNAPCHAT
            - TIKTOK
            - PINTEREST
        assetType:
          type: string
          enum:
            - campaign
            - adset
            - ad
        assetId:
          type: string
        parentAssetId:
          type: string
          pattern: ^[1-9]\d{0,19}$
        adAccountId:
          type: string
        budgetGuard:
          $ref: '#/components/schemas/NativeBudgetGuard'
        sourceAuthority:
          type: object
          description: >-
            GOOGLE_ADS only: use the exact enabled account and connector pair
            from the current workspace selection. Omit for other platforms.
          additionalProperties: false
          required:
            - dataSourceAdAccountId
            - dataSourceConnectorId
          properties:
            dataSourceAdAccountId:
              type: string
              minLength: 1
              maxLength: 512
            dataSourceConnectorId:
              type: string
              minLength: 1
              maxLength: 512
        updates:
          type: object
          minProperties: 1
          additionalProperties: false
          properties:
            name:
              type: string
              minLength: 1
            status:
              type: string
              enum:
                - ACTIVE
                - PAUSED
                - ARCHIVED
            budget:
              type: number
              exclusiveMinimum: 0
            budgetType:
              type: string
              enum:
                - daily
                - lifetime
      description: >-
        For Meta/Google budget changes, first read the native budget and keep
        the returned guard unchanged. Send only budget and budgetType inside
        updates. Meta omits top-level sourceAuthority; its source is inside
        budgetGuard. Google supplies the exact top-level sourceAuthority pair.
        The path supplies resourceUrl; do not repeat it in the body.
    NativeBudgetGuard:
      oneOf:
        - type: object
          additionalProperties: false
          required:
            - version
            - resourceUrl
            - sourceAuthority
            - currency
            - amountUnits
            - fingerprint
            - platform
            - adAccountId
            - selection
            - owner
            - cadence
            - unitsPerCurrency
          properties:
            version:
              const: 1
              type: integer
            resourceUrl:
              type: string
              pattern: ^[a-z0-9.-]{1,253}$
            sourceAuthority:
              type: object
              additionalProperties: false
              required:
                - dataSourceAdAccountId
                - dataSourceConnectorId
              properties:
                dataSourceAdAccountId:
                  type: string
                  minLength: 1
                  maxLength: 512
                dataSourceConnectorId:
                  type: string
                  minLength: 1
                  maxLength: 512
            currency:
              type: string
              pattern: ^[A-Z]{3}$
            amountUnits:
              type: string
              pattern: ^[1-9]\d{0,18}$
            fingerprint:
              type: string
              pattern: ^[a-f0-9]{64}$
            platform:
              const: FACEBOOK
              type: string
            adAccountId:
              type: string
              pattern: ^(?:act_)?[1-9]\d{0,19}$
            selection:
              oneOf:
                - type: object
                  additionalProperties: false
                  required:
                    - assetType
                    - assetId
                  properties:
                    assetType:
                      const: campaign
                      type: string
                    assetId:
                      type: string
                      pattern: ^[1-9]\d{0,19}$
                - type: object
                  additionalProperties: false
                  required:
                    - assetType
                    - assetId
                    - parentAssetId
                  properties:
                    assetType:
                      const: adset
                      type: string
                    assetId:
                      type: string
                      pattern: ^[1-9]\d{0,19}$
                    parentAssetId:
                      type: string
                      pattern: ^[1-9]\d{0,19}$
            owner:
              type: object
              additionalProperties: false
              required:
                - assetType
                - assetId
              properties:
                assetType:
                  enum:
                    - campaign
                    - adset
                  type: string
                assetId:
                  type: string
                  pattern: ^[1-9]\d{0,19}$
            cadence:
              type: string
              enum:
                - daily
                - lifetime
            unitsPerCurrency:
              enum:
                - 1
                - 100
                - 1000
              type: integer
        - type: object
          additionalProperties: false
          required:
            - version
            - resourceUrl
            - sourceAuthority
            - currency
            - amountUnits
            - fingerprint
            - platform
            - adAccountId
            - selection
            - owner
            - cadence
            - unitsPerCurrency
            - period
            - budgetType
            - explicitlyShared
            - referenceCount
            - affectedCampaignIds
          properties:
            version:
              const: 1
              type: integer
            resourceUrl:
              type: string
              pattern: ^[a-z0-9.-]{1,253}$
            sourceAuthority:
              type: object
              additionalProperties: false
              required:
                - dataSourceAdAccountId
                - dataSourceConnectorId
              properties:
                dataSourceAdAccountId:
                  type: string
                  minLength: 1
                  maxLength: 512
                dataSourceConnectorId:
                  type: string
                  minLength: 1
                  maxLength: 512
            currency:
              type: string
              pattern: ^[A-Z]{3}$
            amountUnits:
              type: string
              pattern: ^[1-9]\d{0,18}$
            fingerprint:
              type: string
              pattern: ^[a-f0-9]{64}$
            platform:
              const: GOOGLE_ADS
              type: string
            adAccountId:
              type: string
              pattern: ^[1-9]\d{0,19}$
            selection:
              type: object
              additionalProperties: false
              required:
                - assetType
                - assetId
              properties:
                assetType:
                  const: campaign
                  type: string
                assetId:
                  type: string
                  pattern: ^[1-9]\d{0,19}$
            owner:
              type: object
              additionalProperties: false
              required:
                - assetType
                - resourceName
              properties:
                assetType:
                  const: campaign_budget
                  type: string
                resourceName:
                  type: string
                  pattern: ^customers/[1-9]\d{0,19}/campaignBudgets/[1-9]\d{0,19}$
            cadence:
              const: daily
              type: string
            unitsPerCurrency:
              const: 1000000
              type: integer
            period:
              const: DAILY
              type: string
            budgetType:
              const: STANDARD
              type: string
            explicitlyShared:
              type: boolean
            referenceCount:
              type: integer
              minimum: 1
              maximum: 100
            affectedCampaignIds:
              type: array
              minItems: 1
              maxItems: 100
              uniqueItems: true
              items:
                type: string
                pattern: ^[1-9]\d{0,19}$
      description: >-
        Use the live quote unchanged. amountUnits must fit a positive signed
        64-bit integer (at most 9223372036854775807). Selection, owner,
        currency, cadence and source must match the exact request. Google
        affectedCampaignIds is the complete unique lexically sorted scope,
        includes the selected campaign, and matches referenceCount. A
        JSON-shaped guard without a current matching fingerprint is not
        executable authority.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          example: Store not found
        requestId:
          type: string
          description: Present on some server errors.
        details:
          description: Optional safe details for an action failure.
        retryAfter:
          type:
            - string
            - 'null'
      additionalProperties: true
  responses:
    BadRequest:
      description: The request path, query, or body is invalid.
      headers:
        x-request-id:
          description: The request identifier selected or generated by Bily.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Authentication is missing or invalid.
      headers:
        x-request-id:
          description: The request identifier selected or generated by Bily.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: The identity or API key is not allowed to perform this request.
      headers:
        x-request-id:
          description: The request identifier selected or generated by Bily.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The resource was not found in the caller's accessible scope.
      headers:
        x-request-id:
          description: The request identifier selected or generated by Bily.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: The request conflicts with the current resource state.
      headers:
        x-request-id:
          description: The request identifier selected or generated by Bily.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: The request rate is too high.
      headers:
        x-request-id:
          description: The request identifier selected or generated by Bily.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: Bily could not complete the request.
      headers:
        x-request-id:
          description: The request identifier selected or generated by Bily.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadGateway:
      description: A dependent Bily operation was temporarily unavailable.
      headers:
        x-request-id:
          description: The request identifier selected or generated by Bily.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServiceUnavailable:
      description: >-
        Authentication or a required data source is temporarily unavailable.
        Honor Retry-After when present; do not interpret this as an invalid key
        or an empty dataset.
      headers:
        x-request-id:
          description: The request identifier selected or generated by Bily.
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        A server-side Bily API key created under Settings > AI tools > Access
        keys. Select the intended workspace before creating it.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Bily API key
      description: An alternative way to send the same server-side Bily API key.

````

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