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

# Update Campaign Approval

> Move the campaign through the approval state machine.

Allowed transitions:

* ``DRAFT`` → ``PENDING_APPROVAL``
* ``PENDING_APPROVAL`` → ``APPROVED`` | ``REJECTED`` | ``DRAFT`` (recall)
* ``APPROVED`` → ``DRAFT`` (re-edit; campaign should be paused first)
* ``REJECTED`` → ``DRAFT`` (revise + resubmit)

Anything else is a 400 — owners can't skip review by self-approving
a DRAFT, can't re-approve a previously-rejected campaign without
revising, etc. Auth controls *who* can move things, this rule
controls *what* moves are coherent.



## OpenAPI

````yaml post /opportunity/campaign/{campaign_id}/approval
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /opportunity/campaign/{campaign_id}/approval:
    post:
      tags:
        - Campaigns
      summary: Update Campaign Approval
      description: >-
        Move the campaign through the approval state machine.


        Allowed transitions:


        * ``DRAFT`` → ``PENDING_APPROVAL``

        * ``PENDING_APPROVAL`` → ``APPROVED`` | ``REJECTED`` | ``DRAFT``
        (recall)

        * ``APPROVED`` → ``DRAFT`` (re-edit; campaign should be paused first)

        * ``REJECTED`` → ``DRAFT`` (revise + resubmit)


        Anything else is a 400 — owners can't skip review by self-approving

        a DRAFT, can't re-approve a previously-rejected campaign without

        revising, etc. Auth controls *who* can move things, this rule

        controls *what* moves are coherent.
      operationId: >-
        update_campaign_approval_opportunity_campaign__campaign_id__approval_post
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
        - name: campaign_id
          in: path
          required: true
          schema:
            type: string
            title: Campaign Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignApprovalUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignApprovalSummary'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CampaignApprovalUpdate:
      properties:
        approvalState:
          $ref: '#/components/schemas/CampaignApprovalState'
      type: object
      required:
        - approvalState
      title: CampaignApprovalUpdate
      description: Manual moves through the campaign approval workflow.
    CampaignApprovalSummary:
      properties:
        id:
          type: string
          title: Id
        approvalState:
          $ref: '#/components/schemas/CampaignApprovalState'
      type: object
      required:
        - id
        - approvalState
      title: CampaignApprovalSummary
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CampaignApprovalState:
      type: string
      enum:
        - DRAFT
        - PENDING_APPROVAL
        - APPROVED
        - REJECTED
      title: CampaignApprovalState
      description: Approval lifecycle for a `Campaign`. Independent of `is_active`.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````