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

# Create or Update an Item

> Find and update an existing item, or create a new one.



## OpenAPI

````yaml POST /collections/{collection_id}/items/upsert
openapi: 3.1.0
info:
  title: Moonbase REST API
  version: v0
servers:
  - url: https://api.moonbase.ai/v0
security:
  - bearer: []
tags:
  - name: Inboxes
    description: Manage your inboxes, conversations, and messages
  - name: Collections
    description: Manage your collections and items
  - name: Marketing
    description: Manage your marketing campaigns and forms
  - name: Activities
    description: View activities and capture calls
  - name: Library
    description: Manage your meetings, files, and notes
paths:
  /collections/{collection_id}/items/upsert:
    post:
      tags:
        - Collections
      summary: Create or update an item
      description: Find and update an existing item, or create a new one.
      parameters:
        - name: collection_id
          in: path
          required: true
          schema:
            type: string
          description: ''
          explode: true
        - name: update-one-strategy
          in: header
          required: false
          schema:
            type: string
            enum:
              - replace
              - preserve
          description: >-
            Specifies how to update fields that have a single value. Use
            `replace` (default) to overwrite the existing value with the new
            value. Use `preserve` to leave the existing value unchanged if one
            is already present.
          explode: true
        - name: update-many-strategy
          in: header
          required: false
          schema:
            type: string
            enum:
              - replace
              - preserve
              - merge
          description: >-
            Specifies how to update fields that allow multiple values. Use
            `replace` (default) to overwrite all existing values with the new
            values. Use `preserve` to leave the existing values unchanged when
            already present. Use `merge` to merge the new values with existing
            values.
          explode: true
      requestBody:
        description: The `Item` object to be created or updated.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ItemUpsertParams'
            examples:
              Upsert item:
                summary: Upsert item
                value:
                  collection_id: 1CLJt2uco2zG6pdjxS37sg
                  identifiers:
                    domain:
                      - type: value/uri/domain
                        data: aperturescience.com
                  values:
                    name:
                      type: value/text/single_line
                      data: Aperture Science
                    domain:
                      - type: value/uri/domain
                        data: aperturescience.com
                    linked_in:
                      type: value/uri/social_linked_in
                      data:
                        url: https://linkedin.com/company/aperturescience
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Item'
              examples:
                Upsert item:
                  summary: Upsert item
                  value:
                    id: 1CLJt2v5aNd8G5SGzEaeVU
                    type: item
                    collection:
                      id: 1CLJt2uco2zG6pdjxS37sg
                      type: collection
                      ref: organizations
                    values:
                      name:
                        type: value/text/single_line
                        data: Aperture Science
                      domain:
                        - type: value/uri/domain
                          data: aperturescience.com
                      linked_in:
                        type: value/uri/social_linked_in
                        data:
                          username: company/aperturescience
                          url: https://linkedin.com/company/aperturescience
                      created_at:
                        type: value/datetime
                        data: '2025-02-17T16:00:00.000Z'
                      updated_at:
                        type: value/datetime
                        data: '2025-02-17T16:00:00.000Z'
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Item'
              examples:
                Upsert item:
                  summary: Upsert item
                  value:
                    id: 1CLJt2v6592N5WQzNpjpj2
                    type: item
                    collection:
                      id: 1CLJt2uco2zG6pdjxS37sg
                      type: collection
                      ref: organizations
                    values:
                      name:
                        type: value/text/single_line
                        data: Aperture Science
                      domain:
                        - type: value/uri/domain
                          data: aperturescience.com
                      linked_in:
                        type: value/uri/social_linked_in
                        data:
                          username: company/aperturescience
                          url: https://linkedin.com/company/aperturescience
                      created_at:
                        type: value/datetime
                        data: '2025-02-17T16:00:00.000Z'
                      updated_at:
                        type: value/datetime
                        data: '2025-02-17T16:00:00.000Z'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              examples:
                Default:
                  summary: Default
                  value:
                    type: errors
                    errors:
                      - type: error
                        status: '400'
                        title: Bad Request
                        detail: >-
                          The request could not be understood due to malformed
                          syntax or invalid parameters.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              examples:
                Default:
                  summary: Default
                  value:
                    type: errors
                    errors:
                      - type: error
                        status: '401'
                        title: Unauthorized
                        detail: >-
                          Invalid or missing API key or JWT. You should provide
                          your Moonbase API Key or JWT in the authorization
                          header, in the format: "Authorization: Bearer
                          MOONBASE_API_KEY"
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              examples:
                Default:
                  summary: Default
                  value:
                    type: errors
                    errors:
                      - type: error
                        status: '403'
                        title: Forbidden
        '409':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              examples:
                Multiple items match:
                  summary: Multiple items match
                  value:
                    type: errors
                    errors:
                      - type: error
                        status: '409'
                        title: Conflict
                        detail: Multiple items match the identifiers.
        '422':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              examples:
                Invalid phone number:
                  summary: Invalid phone number
                  value:
                    type: errors
                    errors:
                      - type: error
                        status: '422'
                        title: Unprocessable Entity
                        detail: Phone is not a valid E.164 formatted telephone number
                        source:
                          pointer: /values/phone
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              examples:
                Default:
                  summary: Default
                  value:
                    type: errors
                    errors:
                      - type: error
                        status: '429'
                        title: Too Many Requests
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              examples:
                Default:
                  summary: Default
                  value:
                    type: errors
                    errors:
                      - type: error
                        status: '500'
                        title: Internal Server Error
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors'
              examples:
                Default:
                  summary: Default
                  value:
                    type: errors
                    errors:
                      - type: error
                        status: '503'
                        title: Service Unavailable
                        detail: >-
                          The service is temporarily unavailable, please try
                          again later.
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Moonbase from '@moonbaseai/sdk';


            const client = new Moonbase({
              apiKey: process.env['MOONBASE_API_KEY'], // This is the default and can be omitted
            });


            const item = await client.collections.items.upsert('collection_id',
            {
              identifiers: { domain: [{ type: 'value/uri/domain', data: 'aperturescience.com' }] },
              values: {
                name: { type: 'value/text/single_line', data: 'Aperture Science' },
                domain: [{ type: 'value/uri/domain', data: 'aperturescience.com' }],
                linked_in: {
                  type: 'value/uri/social_linked_in',
                  data: { url: 'https://linkedin.com/company/aperturescience' },
                },
              },
            });


            console.log(item.id);
        - lang: Python
          source: |-
            import os
            from moonbase import Moonbase

            client = Moonbase(
                api_key=os.environ.get("MOONBASE_API_KEY"),  # This is the default and can be omitted
            )
            item = client.collections.items.upsert(
                collection_id="1CLJt2uco2zG6pdjxS37sg",
                identifiers={
                    "domain": [{
                        "type": "value/uri/domain",
                        "data": "aperturescience.com",
                    }]
                },
                values={
                    "name": {
                        "type": "value/text/single_line",
                        "data": "Aperture Science",
                    },
                    "domain": [{
                        "type": "value/uri/domain",
                        "data": "aperturescience.com",
                    }],
                    "linked_in": {
                        "type": "value/uri/social_linked_in",
                        "data": {
                            "url": "https://linkedin.com/company/aperturescience"
                        },
                    },
                },
            )
            print(item.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/moonbaseai/moonbase-sdk-go\"\n\t\"github.com/moonbaseai/moonbase-sdk-go/option\"\n)\n\nfunc main() {\n\tclient := moonbase.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\titem, err := client.Collections.Items.Upsert(\n\t\tcontext.TODO(),\n\t\t\"1CLJt2uco2zG6pdjxS37sg\",\n\t\tmoonbase.CollectionItemUpsertParams{\n\t\t\tIdentifiers: map[string]moonbase.FieldValueParamUnion{\n\t\t\t\t\"domain\": {\n\t\t\t\t\tOfArrayOfValues: []moonbase.ValueParamUnion{{\n\t\t\t\t\t\tOfValueUriDomain: &moonbase.DomainValueParam{\n\t\t\t\t\t\t\tData: \"aperturescience.com\",\n\t\t\t\t\t\t},\n\t\t\t\t\t}},\n\t\t\t\t},\n\t\t\t},\n\t\t\tValues: map[string]moonbase.FieldValueParamUnion{\n\t\t\t\t\"name\": {\n\t\t\t\t\tOfSingleLineText: &moonbase.SingleLineTextValueParam{\n\t\t\t\t\t\tData: \"Aperture Science\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t\"domain\": {\n\t\t\t\t\tOfArrayOfValues: []moonbase.ValueParamUnion{{\n\t\t\t\t\t\tOfValueUriDomain: &moonbase.DomainValueParam{\n\t\t\t\t\t\t\tData: \"aperturescience.com\",\n\t\t\t\t\t\t},\n\t\t\t\t\t}},\n\t\t\t\t},\n\t\t\t\t\"linked_in\": {\n\t\t\t\t\tOfLinkedIn: &moonbase.SocialLinkedInValueParam{\n\t\t\t\t\t\tData: moonbase.SocialProfileLinkedInParam{\n\t\t\t\t\t\t\tURL: moonbase.String(\"https://linkedin.com/company/aperturescience\"),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", item.ID)\n}\n"
        - lang: Ruby
          source: |-
            require "moonbase"

            moonbase = Moonbase::Client.new(api_key: "My API Key")

            item = moonbase.collections.items.upsert(
              "collection_id",
              identifiers: {domain: [{data: "aperturescience.com", type: :"value/uri/domain"}]},
              values: {
                name: {data: "Aperture Science", type: :"value/text/single_line"},
                domain: [{data: "aperturescience.com", type: :"value/uri/domain"}],
                linked_in: {data: {}, type: :"value/uri/social_linked_in"}
              }
            )

            puts(item)
components:
  schemas:
    ItemUpsertParams:
      title: ItemUpsertParams
      description: Parameters for creating or updating an `Item`.
      type: object
      properties:
        identifiers:
          description: >-
            A hash where keys are the `ref` of a `Field` and values are used to
            identify the item to update. When multiple identifiers are provided,
            the update will find items that match any of the identifiers.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/FieldValueParam'
        values:
          description: >-
            A hash where keys are the `ref` of a `Field` and values are the data
            to be set.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/FieldValueParam'
      required:
        - identifiers
        - values
    Item:
      title: Item
      description: >-
        An Item represents a single record or row within a Collection. It holds
        a set of `values` corresponding to the Collection's `fields`.
      type: object
      properties:
        type:
          description: >-
            String representing the object’s type. Always `item` for this
            object.
          type: string
          const: item
        id:
          description: Unique identifier for the object.
          type: string
        collection:
          $ref: '#/components/schemas/CollectionPointer'
        values:
          description: >-
            A hash where keys are the `ref` of a `Field` and values are the data
            stored for that field.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/FieldValue'
      required:
        - collection
        - type
        - id
        - values
    Errors:
      title: Errors
      description: >-
        The Errors object is a container that holds multiple Error objects when
        an API request encounters several validation or processing issues. This
        allows the API to return comprehensive feedback about all problems
        encountered in a single response.
      type: object
      properties:
        type:
          type: string
          const: errors
        errors:
          description: A list of `Error` objects.
          type: array
          items:
            $ref: '#/components/schemas/Error'
      required:
        - type
    FieldValueParam:
      description: A field can be null, a single value, or an array of values
      oneOf:
        - type: 'null'
          title: 'Null'
        - $ref: '#/components/schemas/ValueParam'
          title: Single value
        - type: array
          title: Array of Values
          items:
            $ref: '#/components/schemas/ValueParam'
    CollectionPointer:
      title: CollectionPointer
      description: >-
        A lightweight reference to a `Collection`, containing the minimal
        information needed to identify it.
      type: object
      properties:
        type:
          description: >-
            String representing the object’s type. Always `collection` for this
            object.
          type: string
          const: collection
        id:
          description: Unique identifier of the collection.
          type: string
        ref:
          description: The stable, machine-readable reference identifier of the collection.
          type: string
      required:
        - type
        - id
        - ref
    FieldValue:
      description: A field can be null, a single value, or an array of values
      oneOf:
        - $ref: '#/components/schemas/Value'
          title: Single value
        - type: array
          title: Array of Values
          items:
            $ref: '#/components/schemas/Value'
    Error:
      title: Error
      description: >-
        The Error object represents a single error that occurred during API
        request processing. It provides detailed information about what went
        wrong, including a unique identifier, status code, and human-readable
        descriptions to help developers understand and resolve the issue.
      type: object
      properties:
        type:
          type: string
          const: error
        id:
          description: A unique identifier for this specific error instance.
          type: string
        status:
          description: The HTTP status code for this problem, as a string.
          type: string
        code:
          description: An application-specific error code string.
          type: string
        title:
          description: A short, human-readable summary of the problem.
          type: string
        detail:
          description: A human-readable explanation of this specific error.
          type: string
        source:
          $ref: '#/components/schemas/ErrorSource'
          description: >-
            An object containing more specific information about the part of the
            request that caused the error.
        meta:
          type: object
          additionalProperties: true
      required:
        - type
    ValueParam:
      description: A typed value with discriminated union support
      discriminator:
        propertyName: type
        mapping:
          value/text/single_line:
            $ref: '#/components/schemas/SingleLineTextValue'
          value/text/multi_line:
            $ref: '#/components/schemas/MultiLineTextValue'
          value/identifier:
            $ref: '#/components/schemas/IdentifierValue'
          value/number/unitless_integer:
            $ref: '#/components/schemas/IntegerValue'
          value/number/unitless_float:
            $ref: '#/components/schemas/FloatValue'
          value/number/monetary:
            $ref: '#/components/schemas/MonetaryValue'
          value/number/percentage:
            $ref: '#/components/schemas/PercentageValue'
          value/boolean:
            $ref: '#/components/schemas/BooleanValue'
          value/email:
            $ref: '#/components/schemas/EmailValue'
          value/uri/url:
            $ref: '#/components/schemas/UrlValue'
          value/uri/domain:
            $ref: '#/components/schemas/DomainValue'
          value/uri/social_x:
            $ref: '#/components/schemas/SocialXValueParam'
          value/uri/social_linked_in:
            $ref: '#/components/schemas/SocialLinkedInValueParam'
          value/telephone_number:
            $ref: '#/components/schemas/TelephoneNumberValue'
          value/geo:
            $ref: '#/components/schemas/GeoValue'
          value/date:
            $ref: '#/components/schemas/DateValue'
          value/datetime:
            $ref: '#/components/schemas/DatetimeValue'
          value/choice:
            $ref: '#/components/schemas/ChoiceValueParam'
          value/funnel_step:
            $ref: '#/components/schemas/FunnelStepValueParam'
          value/relation:
            $ref: '#/components/schemas/RelationValueParam'
      oneOf:
        - $ref: '#/components/schemas/SingleLineTextValue'
        - $ref: '#/components/schemas/MultiLineTextValue'
        - $ref: '#/components/schemas/IdentifierValue'
        - $ref: '#/components/schemas/IntegerValue'
        - $ref: '#/components/schemas/FloatValue'
        - $ref: '#/components/schemas/MonetaryValue'
        - $ref: '#/components/schemas/PercentageValue'
        - $ref: '#/components/schemas/BooleanValue'
        - $ref: '#/components/schemas/EmailValue'
        - $ref: '#/components/schemas/UrlValue'
        - $ref: '#/components/schemas/DomainValue'
        - $ref: '#/components/schemas/SocialXValueParam'
        - $ref: '#/components/schemas/SocialLinkedInValueParam'
        - $ref: '#/components/schemas/TelephoneNumberValue'
        - $ref: '#/components/schemas/GeoValue'
        - $ref: '#/components/schemas/DateValue'
        - $ref: '#/components/schemas/DatetimeValue'
        - $ref: '#/components/schemas/ChoiceValueParam'
        - $ref: '#/components/schemas/FunnelStepValueParam'
        - $ref: '#/components/schemas/RelationValueParam'
    Value:
      description: A typed value with discriminated union support
      discriminator:
        propertyName: type
        mapping:
          value/text/single_line:
            $ref: '#/components/schemas/SingleLineTextValue'
          value/text/multi_line:
            $ref: '#/components/schemas/MultiLineTextValue'
          value/identifier:
            $ref: '#/components/schemas/IdentifierValue'
          value/number/unitless_integer:
            $ref: '#/components/schemas/IntegerValue'
          value/number/unitless_float:
            $ref: '#/components/schemas/FloatValue'
          value/number/monetary:
            $ref: '#/components/schemas/MonetaryValue'
          value/number/percentage:
            $ref: '#/components/schemas/PercentageValue'
          value/boolean:
            $ref: '#/components/schemas/BooleanValue'
          value/email:
            $ref: '#/components/schemas/EmailValue'
          value/uri/url:
            $ref: '#/components/schemas/UrlValue'
          value/uri/domain:
            $ref: '#/components/schemas/DomainValue'
          value/uri/social_x:
            $ref: '#/components/schemas/SocialXValue'
          value/uri/social_linked_in:
            $ref: '#/components/schemas/SocialLinkedInValue'
          value/telephone_number:
            $ref: '#/components/schemas/TelephoneNumberValue'
          value/geo:
            $ref: '#/components/schemas/GeoValue'
          value/date:
            $ref: '#/components/schemas/DateValue'
          value/datetime:
            $ref: '#/components/schemas/DatetimeValue'
          value/choice:
            $ref: '#/components/schemas/ChoiceValue'
          value/funnel_step:
            $ref: '#/components/schemas/FunnelStepValue'
          value/relation:
            $ref: '#/components/schemas/RelationValue'
      oneOf:
        - $ref: '#/components/schemas/SingleLineTextValue'
        - $ref: '#/components/schemas/MultiLineTextValue'
        - $ref: '#/components/schemas/IdentifierValue'
        - $ref: '#/components/schemas/IntegerValue'
        - $ref: '#/components/schemas/FloatValue'
        - $ref: '#/components/schemas/MonetaryValue'
        - $ref: '#/components/schemas/PercentageValue'
        - $ref: '#/components/schemas/BooleanValue'
        - $ref: '#/components/schemas/EmailValue'
        - $ref: '#/components/schemas/UrlValue'
        - $ref: '#/components/schemas/DomainValue'
        - $ref: '#/components/schemas/SocialXValue'
        - $ref: '#/components/schemas/SocialLinkedInValue'
        - $ref: '#/components/schemas/TelephoneNumberValue'
        - $ref: '#/components/schemas/GeoValue'
        - $ref: '#/components/schemas/DateValue'
        - $ref: '#/components/schemas/DatetimeValue'
        - $ref: '#/components/schemas/ChoiceValue'
        - $ref: '#/components/schemas/FunnelStepValue'
        - $ref: '#/components/schemas/RelationValue'
    ErrorSource:
      title: ErrorSource
      description: >-
        The ErrorSource object provides additional context about the specific
        part of an API request that caused an error. It can point to either a
        field in the request document or a query parameter that contains invalid
        data.
      type: object
      properties:
        pointer:
          description: >-
            A JSON Pointer [RFC6901] to the associated entity in the request
            document.
          type: string
        parameter:
          description: A string indicating which URI query parameter caused the error.
          type: string
      required: []
    SingleLineTextValue:
      title: Single Line Text
      description: A single line of text
      type: object
      properties:
        type:
          type: string
          const: value/text/single_line
        data:
          description: >-
            A single line of text, up to 1024 characters long. It should not
            contain line breaks.
          type: string
      required:
        - type
        - data
    MultiLineTextValue:
      title: Multi Line Text
      description: Multiple lines of text
      type: object
      properties:
        type:
          type: string
          const: value/text/multi_line
        data:
          description: >-
            Text which may contain line breaks, can be up to 65,536 characters
            long. Do not use markdown formatting, just plain text.
          type: string
      required:
        - type
        - data
    IdentifierValue:
      title: Identifier
      description: Identifier string
      type: object
      properties:
        type:
          type: string
          const: value/identifier
        data:
          description: An external identifier as text, uo to 255 characters in length.
          type: string
      required:
        - type
        - data
    IntegerValue:
      title: Integer
      description: Integer value without units
      type: object
      properties:
        type:
          type: string
          const: value/number/unitless_integer
        data:
          type: integer
      required:
        - type
        - data
    FloatValue:
      title: Float
      description: Floating point number
      type: object
      properties:
        type:
          type: string
          const: value/number/unitless_float
        data:
          type: number
      required:
        - type
        - data
    MonetaryValue:
      title: Monetary
      description: Monetary or currency value
      type: object
      properties:
        type:
          type: string
          const: value/number/monetary
        data:
          description: >-
            A monetary amount is composed of the amount in the smallest unit of
            a currency and an ISO currency code.
          type: object
          properties:
            in_minor_units:
              type: integer
              description: >-
                The amount in the minor units of the currency. For example, $10
                (10 USD) would be 1000. Minor units conversion depends on the
                currency.
            currency:
              type: string
              description: The 3-letter ISO 4217 currency code
          required:
            - in_minor_units
            - currency
      required:
        - type
        - data
    PercentageValue:
      title: Percentage
      description: Percentage numeric value
      type: object
      properties:
        type:
          type: string
          const: value/number/percentage
        data:
          description: >-
            A floating-point number representing a percentage value, for example
            50.21 for 50.21% or -1000 for -1000% etc.
          type: number
      required:
        - type
        - data
    BooleanValue:
      title: Boolean
      description: True or false value
      type: object
      properties:
        type:
          type: string
          const: value/boolean
        data:
          type: boolean
      required:
        - type
        - data
    EmailValue:
      title: Email
      description: Email address value
      type: object
      properties:
        type:
          type: string
          const: value/email
        data:
          description: A valid email address.
          type: string
          format: email
      required:
        - type
        - data
    UrlValue:
      title: URL
      description: URL or web address
      type: object
      properties:
        type:
          type: string
          const: value/uri/url
        data:
          description: >-
            A valid URL, conforming to RFC 3986, up to 8,192 characters long. It
            should include the protocol, for example 'https://' or
            'mailto:support@moonbase.ai' etc.
          type: string
          format: uri
      required:
        - type
        - data
    DomainValue:
      title: Domain
      description: Internet domain name
      type: object
      properties:
        type:
          type: string
          const: value/uri/domain
        data:
          description: >-
            A valid internet domain name, without protocol (e.g., 'https://') or
            path.
          type: string
          examples:
            - example.com
            - sub.example.com
      required:
        - type
        - data
    SocialXValueParam:
      title: X
      description: The social media profile for the X (formerly Twitter) platform
      type: object
      properties:
        type:
          type: string
          const: value/uri/social_x
        data:
          $ref: '#/components/schemas/SocialProfileXParam'
      required:
        - type
        - data
    SocialLinkedInValueParam:
      title: LinkedIn
      description: The social media profile for the LinkedIn platform
      type: object
      properties:
        type:
          type: string
          const: value/uri/social_linked_in
        data:
          $ref: '#/components/schemas/SocialProfileLinkedInParam'
          description: The social media profile for the LinkedIn platform
      required:
        - type
        - data
    TelephoneNumberValue:
      title: Telephone Number
      description: Telephone number value
      type: object
      properties:
        type:
          type: string
          const: value/telephone_number
        data:
          description: >-
            A telephone number in strictly formatted E.164 format. Do not
            include spaces, dashes, or parentheses etc.
          type: string
          examples:
            - '+15556504242'
            - '+442071838750'
      required:
        - type
        - data
    GeoValue:
      title: Geo
      description: Geographic coordinate value
      type: object
      properties:
        type:
          type: string
          const: value/geo
        data:
          description: >-
            A string that represents some geographic location. The exact format
            may vary based on context.
          type: string
          examples:
            - Los Angeles, CA
            - Germany
            - 555 Fifth Avenue, New York, NY
            - Eiffel Tower, Paris, France
            - 'Latitude: 34.0522, Longitude: -118.2437'
      required:
        - type
        - data
    DateValue:
      title: Date
      description: Date without time
      type: object
      properties:
        type:
          type: string
          const: value/date
        data:
          type: string
          format: date
          examples:
            - '2027-09-08'
      required:
        - type
        - data
    DatetimeValue:
      title: Date Time
      description: Date and time value
      type: object
      properties:
        type:
          type: string
          const: value/datetime
        data:
          type: string
          format: date-time
          examples:
            - '2025-09-08T15:30:00.000Z'
      required:
        - type
        - data
    ChoiceValueParam:
      title: Choice
      description: Selected choice option
      type: object
      properties:
        type:
          type: string
          const: value/choice
        data:
          $ref: '#/components/schemas/ChoiceFieldOptionPointer'
          description: >-
            An option that must match one of the predefined options for the
            field.
      required:
        - type
        - data
    FunnelStepValueParam:
      title: Funnel Step
      description: Funnel step value
      type: object
      properties:
        type:
          type: string
          const: value/funnel_step
        data:
          $ref: '#/components/schemas/FunnelStepPointer'
          description: A specific funnel step, as configured on the Funnel.
      required:
        - type
        - data
    RelationValueParam:
      title: Relation
      description: Related item reference
      type: object
      properties:
        type:
          type: string
          const: value/relation
        data:
          $ref: '#/components/schemas/ItemPointerParam'
          description: A reference to another Moonbase item.
      required:
        - type
        - data
    SocialXValue:
      title: X
      description: The social media profile for the X (formerly Twitter) platform
      type: object
      properties:
        type:
          type: string
          const: value/uri/social_x
        data:
          $ref: '#/components/schemas/SocialProfileX'
      required:
        - type
        - data
    SocialLinkedInValue:
      title: LinkedIn
      description: The social media profile for the LinkedIn platform
      type: object
      properties:
        type:
          type: string
          const: value/uri/social_linked_in
        data:
          $ref: '#/components/schemas/SocialProfileLinkedIn'
          description: The social media profile for the LinkedIn platform
      required:
        - type
        - data
    ChoiceValue:
      title: Choice
      description: Selected choice option
      type: object
      properties:
        type:
          type: string
          const: value/choice
        data:
          $ref: '#/components/schemas/ChoiceFieldOption'
          description: >-
            An option that must match one of the predefined options for the
            field.
      required:
        - type
        - data
    FunnelStepValue:
      title: Funnel Step
      description: Funnel step value
      type: object
      properties:
        type:
          type: string
          const: value/funnel_step
        data:
          $ref: '#/components/schemas/FunnelStep'
          description: A specific funnel step, as configured on the Funnel.
      required:
        - type
        - data
    RelationValue:
      title: Relation
      description: Related item reference
      type: object
      properties:
        type:
          type: string
          const: value/relation
        data:
          $ref: '#/components/schemas/ItemPointer'
          description: A reference to another Moonbase item.
      required:
        - type
        - data
    SocialProfileXParam:
      title: SocialProfileXParam
      description: >-
        Social media profile information including both the full URL and
        extracted username.
      type: object
      properties:
        username:
          description: >-
            The X username, up to 15 characters long, containing only lowercase
            letters (a-z), uppercase letters (A-Z), numbers (0-9), and
            underscores (_). Does not include the '@' symbol prefix.
          type: string
          examples:
            - MoonbaseAI
            - calebelston
        url:
          description: The full URL to the X profile, starting with 'https://x.com/'
          type: string
          format: uri
          examples:
            - https://x.com/MoonbaseAI
            - https://x.com/calebelston
      required: []
    SocialProfileLinkedInParam:
      title: SocialProfileLinkedInParam
      description: >-
        Social media profile information including both the full URL and
        extracted username.
      type: object
      properties:
        username:
          description: >-
            The LinkedIn username, including the prefix 'company/' for company
            pages or 'in/' for personal profiles.
          type: string
          examples:
            - company/moonbaseai
            - in/calebelston
        url:
          description: The full URL to the LinkedIn profile.
          type: string
          format: uri
          examples:
            - https://linkedin.com/company/moonbaseai
            - https://linkedin.com/in/calebelston
      required: []
    ChoiceFieldOptionPointer:
      title: ChoiceFieldOptionPointer
      type: object
      properties:
        type:
          type: string
          const: choice_field_option
        id:
          type: string
      required:
        - type
        - id
    FunnelStepPointer:
      title: FunnelStepPointer
      type: object
      properties:
        type:
          type: string
          const: funnel_step
        id:
          type: string
      required:
        - type
        - id
    ItemPointerParam:
      title: ItemPointerParam
      description: A lightweight reference to an `Item` used in request bodies.
      type: object
      properties:
        type:
          description: >-
            String representing the object’s type. Always `item` for this
            object.
          type: string
          const: item
        id:
          description: Unique identifier of the item.
          type: string
      required:
        - type
        - id
    SocialProfileX:
      title: SocialProfileX
      description: >-
        Social media profile information including both the full URL and
        extracted username.
      type: object
      properties:
        username:
          description: >-
            The X username, up to 15 characters long, containing only lowercase
            letters (a-z), uppercase letters (A-Z), numbers (0-9), and
            underscores (_). Does not include the '@' symbol prefix.
          type: string
          examples:
            - MoonbaseAI
            - calebelston
        url:
          description: The full URL to the X profile, starting with 'https://x.com/'
          type: string
          format: uri
          examples:
            - https://x.com/MoonbaseAI
            - https://x.com/calebelston
      required:
        - username
        - url
    SocialProfileLinkedIn:
      title: SocialProfileLinkedIn
      description: >-
        Social media profile information including both the full URL and
        extracted username.
      type: object
      properties:
        username:
          description: >-
            The LinkedIn username, including the prefix 'company/' for company
            pages or 'in/' for personal profiles.
          type: string
          examples:
            - company/moonbaseai
            - in/calebelston
        url:
          description: The full URL to the LinkedIn profile.
          type: string
          format: uri
          examples:
            - https://linkedin.com/company/moonbaseai
            - https://linkedin.com/in/calebelston
      required:
        - username
        - url
    ChoiceFieldOption:
      title: Field Option
      description: Represents a single selectable option within a choice field.
      type: object
      properties:
        type:
          description: >-
            String representing the object’s type. Always `choice_field_option`
            for this object.
          type: string
          const: choice_field_option
        id:
          description: Unique identifier for the option.
          type: string
        name:
          description: The human-readable text displayed for this option.
          type: string
        color:
          $ref: '#/components/schemas/NamedColor'
          description: The color of the option.
      required:
        - type
        - id
        - name
        - color
    FunnelStep:
      title: FunnelStep
      description: Represents a single step within a `Funnel`.
      type: object
      properties:
        type:
          description: >-
            String representing the object’s type. Always `funnel_step` for this
            object.
          type: string
          const: funnel_step
        id:
          description: Unique identifier for the object.
          type: string
        step_type:
          description: |
            The status of the step in the funnel flow.
            - `active`: represents an in progress state within the funnel
            - `success`: completed successfully and exited the funnel
            - `failure`: exited the funnel without conversion
          type: string
          enum:
            - active
            - success
            - failure
        name:
          description: The name of the step.
          type: string
        color:
          $ref: '#/components/schemas/NamedColor'
          description: The display color of the step.
      required:
        - name
        - type
        - id
        - step_type
        - color
    ItemPointer:
      title: ItemPointer
      description: >-
        A reference to an `Item` within a specific `Collection`, providing the
        context needed to locate the item.
      type: object
      properties:
        type:
          description: >-
            String representing the object’s type. Always `item` for this
            object.
          type: string
          const: item
        id:
          description: Unique identifier of the item.
          type: string
        collection:
          $ref: '#/components/schemas/CollectionPointer'
          description: A reference to the `Collection` containing this item.
      required:
        - collection
        - type
        - id
    NamedColor:
      type: string
      enum:
        - amber
        - blue
        - cyan
        - emerald
        - fuchsia
        - green
        - indigo
        - lime
        - lunar
        - orange
        - pink
        - purple
        - red
        - rose
        - sky
        - teal
        - violet
        - yellow
      description: >-
        One of Moonbase's standard color names. Moonbase renders these
        consistently across light and dark modes.
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: Your Moonbase API key.

````