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

# Upsert a list member

> Add record to a list or update its list-specific attributes if it already exists



## OpenAPI

````yaml /api-reference/openapi.json put /v1/lists/{id}
openapi: 3.0.0
info:
  description: >-
    REST API for accessing and managing your Nex data. Generate API keys from
    the Nex web UI and use them to authenticate requests.
  title: Nex Developer API
  contact: {}
  version: '1.0'
servers:
  - url: https://app.nex.ai/api/developers
security: []
paths:
  /v1/lists/{id}:
    put:
      tags:
        - Lists
      summary: Upsert a list member
      description: >-
        Add record to a list or update its list-specific attributes if it
        already exists
      operationId: upsertListMember
      parameters:
        - description: List ID
          name: id
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/developer.CreateListMemberRequest'
        description: List member upsert request
        required: true
      responses:
        '200':
          description: Created or updated list member
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/developer.CreateListMemberResponse'
        '400':
          description: Bad request - Invalid data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/httpx.APIError'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/httpx.APIError'
        '404':
          description: List not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/httpx.APIError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/httpx.APIError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    developer.CreateListMemberRequest:
      type: object
      properties:
        attributes:
          description: Optional list-specific attributes
          type: object
          additionalProperties: {}
        parent_id:
          description: ID of the existing record to add to the list
          type: string
      example:
        parent_id: '32417546405832961'
        attributes:
          source: website
          status: new
          score: 85
          notes: Qualified lead from demo request
    developer.CreateListMemberResponse:
      type: object
      properties:
        attributes:
          type: object
          additionalProperties: {}
        created_at:
          type: string
        id:
          type: string
        object_id:
          type: string
        type:
          type: string
        updated_at:
          type: string
        workspace_id:
          type: string
      example:
        id: '32417546405832962'
        object_id: '32417546405832950'
        type: person
        workspace_id: '32417546405832945'
        created_at: '2024-01-20T16:45:00Z'
        updated_at: '2024-01-20T16:45:00Z'
        attributes:
          name:
            first_name: Sarah
            last_name: Chen
          email_addresses:
            - sarah@newstartup.com
          job_title: VP Engineering
          source: website
          status: new
          score: 85
          notes: Qualified lead from demo request
    httpx.APIError:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
  securitySchemes:
    ApiKeyAuth:
      description: 'API key for authentication (format: "Bearer YOUR_API_KEY")'
      type: apiKey
      name: Authorization
      in: header

````