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

# Create or replace an offer

> Upserts by `key`. The agent never writes a price; it lives here and the server formats it.



## OpenAPI

````yaml /openapi.json post /v1/offers
openapi: 3.0.0
info:
  title: wondeya Developer API
  description: >-
    The public REST API for building on wondeya: agents, projects, pages,
    knowledge, assets, brand, theme, usage, retrieval and chat, authenticated by
    a workspace API key (`Authorization: Bearer wdy_live_…`).
  version: 0.1.0
  contact:
    name: wondeya
    url: https://wondeya.com
    email: team@wondeya.com
  license:
    name: Proprietary
    url: https://wondeya.com/terms
servers:
  - url: https://api.wondeya.com
    description: Production
  - url: http://localhost:8080
    description: Development
security: []
tags:
  - name: Identity
  - name: Agents
  - name: Projects
  - name: Pages
  - name: Knowledge
  - name: Assets
  - name: Brand
  - name: Usage
  - name: Chat
paths:
  /v1/offers:
    post:
      tags:
        - Offers
      summary: Create or replace an offer
      description: >-
        Upserts by `key`. The agent never writes a price; it lives here and the
        server formats it.
      operationId: PublicOffersController_upsert_v1
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertOfferDto'
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicOfferDto'
        '409':
          description: The offer limit is reached
      security:
        - api-key: []
components:
  schemas:
    UpsertOfferDto:
      type: object
      properties:
        key:
          type: string
          description: The kebab-case id the model emits.
        agentId:
          type: object
          nullable: true
          description: The agent this offer belongs to; `null` = the workspace pool.
        name:
          $ref: '#/components/schemas/LocalizedTextDto'
        description:
          type: string
          maxLength: 600
          description: 'ENGLISH, prompt-facing: when to offer it.'
        price:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/OfferPriceDto'
        features:
          maxItems: 6
          type: array
          items:
            $ref: '#/components/schemas/LocalizedTextDto'
        highlight:
          type: boolean
        ctaLinkId:
          type: object
          nullable: true
          description: A link id from the agent, where the button leads.
        ctaLabel:
          nullable: true
          description: >-
            Localized CTA button text. The principal language is required;
            automatic target translations may arrive later.
          type: object
          allOf:
            - $ref: '#/components/schemas/LocalizedTextDto'
      required:
        - key
        - name
        - description
    PublicOfferDto:
      type: object
      properties:
        id:
          type: string
        agentId:
          type: object
          nullable: true
        key:
          type: string
        name:
          $ref: '#/components/schemas/LocalizedTextDto'
        description:
          type: string
        price:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/OfferPriceDto'
        features:
          type: array
          items:
            $ref: '#/components/schemas/LocalizedTextDto'
        highlight:
          type: boolean
        ctaLinkId:
          type: object
          nullable: true
        ctaLabel:
          nullable: true
          type: object
          allOf:
            - $ref: '#/components/schemas/LocalizedTextDto'
        status:
          type: string
          enum:
            - active
            - archived
        createdAt:
          type: string
        updatedAt:
          type: string
      required:
        - id
        - agentId
        - key
        - name
        - description
        - features
        - highlight
        - ctaLinkId
        - status
        - createdAt
        - updatedAt
    LocalizedTextDto:
      type: object
      properties:
        es:
          type: string
          maxLength: 200
        en:
          type: string
          maxLength: 200
    OfferPriceDto:
      type: object
      properties:
        amount:
          type: number
          description: The figure the server formats; never the model.
        currency:
          type: string
          enum:
            - USD
            - EUR
            - CLP
            - MXN
            - ARS
            - COP
            - PEN
            - BRL
            - UYU
            - GBP
        period:
          type: string
          enum:
            - month
            - year
            - once
          nullable: true
      required:
        - amount
        - currency
        - period
  securitySchemes:
    api-key:
      scheme: bearer
      bearerFormat: opaque
      type: http
      description: >-
        A workspace API key: wdy_live_… / wdy_test_…. Created at POST
        /workspaces/{tenantId}/keys and shown exactly once.

````