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

# Upsert object

> Create or update an object using a JSON data key. If `upsert_key` is omitted, the API tries `$.external_ids.rex.property_id` and then `$.id`.



## OpenAPI

````yaml /openapi.yaml post /api/v1/upsert-object
openapi: 3.1.0
info:
  title: Voxworks API
  version: 1.0.0
  description: >-
    Public REST API for creating contacts, scheduling calls, retrieving call
    results, managing lists and objects, and receiving automation webhooks.
servers:
  - url: https://api.voxworks.ai
    description: Production
security:
  - BearerAuth: []
tags:
  - name: Health
  - name: Contacts
  - name: Calls
  - name: Lists
  - name: Objects
  - name: Webhooks
paths:
  /api/v1/upsert-object:
    post:
      tags:
        - Objects
      summary: Upsert object
      description: >-
        Create or update an object using a JSON data key. If `upsert_key` is
        omitted, the API tries `$.external_ids.rex.property_id` and then `$.id`.
      operationId: upsertObject
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertObjectRequest'
      responses:
        '200':
          description: Object updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpsertObjectResponse'
        '201':
          description: Object created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpsertObjectResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    UpsertObjectRequest:
      allOf:
        - $ref: '#/components/schemas/CreateObjectRequest'
        - type: object
          properties:
            upsert_key:
              type: object
              properties:
                path:
                  type: string
                  example: $.external_ids.rex.property_id
                value:
                  type: string
            unique_key:
              type: object
              deprecated: true
              properties:
                path:
                  type: string
                value:
                  type: string
    UpsertObjectResponse:
      allOf:
        - $ref: '#/components/schemas/ObjectResponse'
        - type: object
          properties:
            action:
              type: string
              enum:
                - created
                - updated
            upsert_key:
              type: object
              properties:
                path:
                  type: string
                value:
                  type: string
    CreateObjectRequest:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          maxLength: 255
        data:
          type: object
          additionalProperties: true
        type_name:
          type: string
        type_id:
          type: string
        parent_id:
          type: string
    ObjectResponse:
      type: object
      properties:
        success:
          type: boolean
        object_id:
          type: string
        object:
          $ref: '#/components/schemas/ObjectRecord'
    ErrorResponse:
      type: object
      required:
        - success
        - message
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
    ObjectRecord:
      type: object
      additionalProperties: true
      properties:
        id:
          type: string
        name:
          type: string
        type_id:
          type:
            - string
            - 'null'
        parent_id:
          type:
            - string
            - 'null'
        data:
          type: object
          additionalProperties: true
  responses:
    BadRequest:
      description: Missing or invalid request data.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing, malformed, or invalid authorization.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            invalid:
              value:
                success: false
                message: Invalid API key
    NotFound:
      description: The requested resource was not found or does not belong to your team.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: Rate limit exceeded.
      headers:
        Retry-After:
          schema:
            type: string
        X-RateLimit-Limit:
          schema:
            type: string
        X-RateLimit-Remaining:
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            message: Rate limit exceeded
    InternalServerError:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            message: Internal server error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: 'API key from Voxworks, sent as `Authorization: Bearer YOUR_API_KEY`.'

````