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

# Post apiv2organizations campaigns autopilotruns



## OpenAPI

````yaml https://api.osiro.com/doc post /api/v2/organizations/{orgId}/campaigns/{campaignId}/autopilot/runs
openapi: 3.0.0
info:
  title: osiro API
  version: 2.0.0
servers: []
security: []
tags:
  - name: Funnel
    description: Public funnel rendering, submission, MFA, and analytics.
  - name: Booking
    description: A lead's cancel and reschedule of their booking, via the manage link.
  - name: Training
    description: Org-scoped sales-training catalogs, sessions, and call records.
  - name: Attribution
    description: Cross-domain PostHog identity handoff for the marketing site.
  - name: Billing
    description: Org-scoped checkouts, plans, trials and the Stripe billing portal.
  - name: Leads
    description: Org-scoped lead reads and actions.
  - name: Ad copy
    description: Org-scoped ad guidelines and Meta ad copy generation.
paths:
  /api/v2/organizations/{orgId}/campaigns/{campaignId}/autopilot/runs:
    post:
      tags:
        - Autopilot
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: orgId
          in: path
        - schema:
            type: string
            format: uuid
          required: true
          name: campaignId
          in: path
      responses:
        '202':
          description: >-
            The run started; it carries on in the background. Follow it through
            the latest run.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AutopilotRun'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    AutopilotRun:
      type: object
      properties:
        id:
          type: string
          format: uuid
        campaign_id:
          type: string
          format: uuid
        trigger:
          type: string
          enum:
            - schedule
            - manual
        status:
          type: string
          enum:
            - running
            - succeeded
            - failed
        started_at:
          type: string
        finished_at:
          type: string
          nullable: true
        summary:
          type: string
          nullable: true
        error:
          type: string
          nullable: true
        proposals:
          type: integer
          minimum: 0
        dropped_proposals:
          type: array
          items:
            type: object
            properties:
              proposal:
                oneOf:
                  - type: object
                    properties:
                      kind:
                        type: string
                        enum:
                          - pause_ad
                      ad_id:
                        type: string
                        pattern: ^\d+$
                        description: The Meta ad to pause.
                      reason:
                        type: string
                        minLength: 1
                        maxLength: 1000
                        description: >-
                          Why, in one or two sentences the user can judge
                          quickly.
                    required:
                      - kind
                      - ad_id
                      - reason
                  - type: object
                    properties:
                      kind:
                        type: string
                        enum:
                          - add_variant
                      ad_set_id:
                        type: string
                        pattern: ^\d+$
                        description: The Meta ad set to add the new ad to.
                      creative_brief:
                        type: object
                        properties:
                          angle:
                            type: string
                            minLength: 1
                            maxLength: 500
                            description: The ad's selling angle.
                          hook:
                            type: string
                            minLength: 1
                            maxLength: 500
                            description: The opening line idea that stops the scroll.
                          image_prompt:
                            type: string
                            minLength: 1
                            maxLength: 2000
                            description: A prompt for the ad's image.
                        required:
                          - angle
                          - hook
                          - image_prompt
                      reason:
                        type: string
                        minLength: 1
                        maxLength: 1000
                        description: >-
                          Why, in one or two sentences the user can judge
                          quickly.
                    required:
                      - kind
                      - ad_set_id
                      - creative_brief
                      - reason
              reason:
                type: string
                enum:
                  - out_of_scope
                  - ad_not_active
                  - duplicate
                  - last_active_ad
                  - too_many_variants
                  - too_many_active_ads
                  - ad_set_all_good
            required:
              - proposal
              - reason
        snapshot:
          nullable: true
        output:
          nullable: true
      required:
        - id
        - campaign_id
        - trigger
        - status
        - started_at
        - finished_at
        - summary
        - error
        - proposals
        - dropped_proposals
    ApiError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
      required:
        - error

````

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