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

# Update program



## OpenAPI

````yaml /openapi.json patch /programs/{id}
openapi: 3.1.0
info:
  title: AgentRef REST API
  version: 1.0.0
  description: >-
    REST API v1 for merchants and affiliates. Authentication via API keys
    (Authorization: Bearer ak_...).
servers:
  - url: /api/v1
    description: Current API version
security:
  - ApiKeyAuth: []
tags:
  - name: Auth
  - name: Onboarding
  - name: Programs
  - name: Merchant
  - name: Applications
  - name: Affiliates
  - name: Me
  - name: Coupons
  - name: Invites
  - name: Conversions
  - name: Payouts
  - name: Flags
  - name: Billing
  - name: Marketplace
  - name: Marketing Resources
  - name: Notifications
  - name: Webhooks
  - name: Docs
  - name: Meta
paths:
  /programs/{id}:
    patch:
      tags:
        - Programs
      summary: Update program
      operationId: updateProgram
      parameters:
        - $ref: '#/components/parameters/UuidPathId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProgramInput'
      responses:
        '200':
          description: Updated program
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Program'
                  meta:
                    $ref: '#/components/schemas/RequestMeta'
                required:
                  - data
                  - meta
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
components:
  parameters:
    UuidPathId:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    UpdateProgramInput:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 100
        description:
          type: string
          maxLength: 500
        website:
          type: string
          format: uri
        landingPageUrl:
          type: string
          format: uri
        status:
          type: string
          enum:
            - active
            - paused
            - archived
        commissionType:
          type: string
          enum:
            - one_time
            - recurring
            - recurring_limited
        commissionPercent:
          type: number
          minimum: 1
          maximum: 100
        commissionLimitMonths:
          type: number
          minimum: 1
          maximum: 36
        cookieDuration:
          type: number
          minimum: 1
          maximum: 365
        payoutThreshold:
          type: number
          minimum: 1000
          maximum: 100000
        payoutFrequency:
          type: string
          enum:
            - weekly
            - monthly
            - quarterly
        applicationAccess:
          type: string
          enum:
            - open
            - invite_only
        autoApproveAffiliates:
          type: boolean
        portalSlug:
          anyOf:
            - type: string
              minLength: 3
              maxLength: 63
              pattern: ^[a-z0-9-]+$
            - type: 'null'
        currency:
          type: string
          minLength: 3
          maxLength: 5
    Program:
      type: object
      properties:
        id:
          type: string
          format: uuid
        merchantId:
          type: string
          format: uuid
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        slug:
          type: string
        website:
          type:
            - string
            - 'null'
          format: uri
        landingPageUrl:
          type:
            - string
            - 'null'
          format: uri
        portalSlug:
          type:
            - string
            - 'null'
        portalTheme:
          type: string
          enum:
            - classic
            - ocean
            - ember
        status:
          type: string
          enum:
            - active
            - paused
            - archived
        marketplaceStatus:
          type: string
          enum:
            - private
            - draft
            - public
          default: private
        applicationAccess:
          type: string
          enum:
            - open
            - invite_only
          default: open
        marketplaceCategory:
          type:
            - string
            - 'null'
        marketplaceDescription:
          type:
            - string
            - 'null'
        marketplaceLogoUrl:
          type:
            - string
            - 'null'
          format: uri
        commissionType:
          type: string
          enum:
            - one_time
            - recurring
            - recurring_limited
        commissionPercent:
          type: integer
        commissionLimitMonths:
          type:
            - integer
            - 'null'
        commissionHoldDays:
          type: integer
        cookieDuration:
          type: integer
        trackingRequiresConsent:
          type:
            - boolean
            - 'null'
        trackingParamAliases:
          type:
            - array
            - 'null'
          items:
            type: string
        payoutThreshold:
          type: integer
        payoutFrequency:
          type: string
          enum:
            - weekly
            - monthly
            - quarterly
        currency:
          type: string
        autoApproveAffiliates:
          type: boolean
          default: false
        termsUrl:
          type:
            - string
            - 'null'
          format: uri
        stripeAccountId:
          type:
            - string
            - 'null'
        stripeAccountDisplayName:
          type:
            - string
            - 'null'
        stripeConnectedAt:
          type:
            - string
            - 'null'
          format: date-time
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - id
        - merchantId
        - name
        - description
        - slug
        - website
        - landingPageUrl
        - portalSlug
        - portalTheme
        - status
        - marketplaceStatus
        - applicationAccess
        - marketplaceCategory
        - marketplaceDescription
        - marketplaceLogoUrl
        - commissionType
        - commissionPercent
        - commissionLimitMonths
        - commissionHoldDays
        - cookieDuration
        - trackingRequiresConsent
        - trackingParamAliases
        - payoutThreshold
        - payoutFrequency
        - currency
        - autoApproveAffiliates
        - termsUrl
        - stripeAccountId
        - stripeAccountDisplayName
        - stripeConnectedAt
        - createdAt
        - updatedAt
    RequestMeta:
      type: object
      properties:
        requestId:
          type: string
      required:
        - requestId
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: object
              additionalProperties: true
          required:
            - code
            - message
        meta:
          $ref: '#/components/schemas/RequestMeta'
      required:
        - error
        - meta
  responses:
    ErrorResponse:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Use API key as Bearer token, for example: Bearer ak_live_xxx'

````