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

# Update an interaction

> Updates the properties of the specified interaction. Only the provided properties will be updated. Any properties not provided will be left unchanged.

<RequestExample>
  ```ts TypeScript/JavaScript SDK theme={null}
  import { ProficientClient } from "@proficient/client";

  const proficient = new ProficientClient({
    apiKey: process.env.PROFICIENT_AI_PUBLISHABLE_KEY,
    userExternalId: "...", // The user's unique ID in your system
  });

  const interactionId = "int_53mfKtX0Da6zaJCp5bNnzxDaEg1xptWvQDr2";

  const interaction = await proficient.interactions.update(interactionId, {
    // ... fields to update
  });
  ```
</RequestExample>


## OpenAPI

````yaml client-openapi POST /interactions/{interaction_id}
openapi: 3.0.1
info:
  title: api
  version: 0.0.1
servers:
  - url: https://api.proficientai.com
    description: Production (The production environment)
  - url: https://main-64bxvpctea-uc.a.run.app
    description: Staging (The staging environment)
  - url: http://localhost:8080
    description: Development (The local environment)
security: []
paths:
  /interactions/{interaction_id}:
    post:
      tags:
        - Interactions
      summary: Update an interaction
      description: >-
        Updates the properties of the specified interaction. Only the provided
        properties will be updated. Any properties not provided will be left
        unchanged.
      operationId: interactions_update
      parameters:
        - name: interaction_id
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/InteractionId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InteractionUpdateParams'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Interaction'
        '403':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    InteractionId:
      title: InteractionId
      type: string
      description: The unique identifier of the interaction
    InteractionUpdateParams:
      title: InteractionUpdateParams
      type: object
      description: The data with which an interaction is updated.
      properties:
        name:
          $ref: '#/components/schemas/InteractionName'
          nullable: true
    Interaction:
      title: Interaction
      type: object
      description: >-
        <p>Users communicate with agents via <i>interactions</i>. You can think
        of each interaction as a conversation between an agent and user.</p>
      properties:
        id:
          $ref: '#/components/schemas/InteractionId'
        object:
          $ref: '#/components/schemas/InteractionObjectType'
        agent_id:
          $ref: '#/components/schemas/AgentId'
        archived:
          $ref: '#/components/schemas/InteractionArchived'
        created_at:
          $ref: '#/components/schemas/CreatedAt'
        initial_turn:
          $ref: '#/components/schemas/InitialTurn'
        name:
          $ref: '#/components/schemas/InteractionName'
        total_message_count:
          $ref: '#/components/schemas/InteractionTotalMessageCount'
        updated_at:
          $ref: '#/components/schemas/UpdatedAt'
        user_id:
          $ref: '#/components/schemas/UserId'
      required:
        - id
        - object
        - agent_id
        - archived
        - created_at
        - initial_turn
        - name
        - total_message_count
        - updated_at
        - user_id
    ApiError:
      title: ApiError
      type: object
      description: >-
        Represents the general interface of an API error. The body of every
        error returned by the API contains `code` and `message` fields.
      properties:
        error:
          $ref: '#/components/schemas/ApiErrorBody'
      required:
        - error
    InteractionName:
      title: InteractionName
      type: string
      description: The name of the interaction
    InteractionObjectType:
      title: InteractionObjectType
      type: string
      enum:
        - interaction
      description: The type of the `Interaction` object
    AgentId:
      title: AgentId
      type: string
      description: The unique identifier of the agent
    InteractionArchived:
      title: InteractionArchived
      type: boolean
      description: Whether the interaction has been archived by the user
    CreatedAt:
      title: CreatedAt
      type: integer
      description: >-
        The time at which the object was created, measured in milliseconds since
        the Unix epoch
    InitialTurn:
      $ref: '#/components/schemas/InteractionParticipant'
      title: InitialTurn
      description: >-
        Indicates who sends the first message in each interaction. Defaults to
        `"user"`.
    InteractionTotalMessageCount:
      title: InteractionTotalMessageCount
      type: integer
      description: The total number of messages in the interaction
    UpdatedAt:
      title: UpdatedAt
      type: integer
      description: >-
        The time at which the object was last updated, measured in milliseconds
        since the Unix epoch
    UserId:
      title: UserId
      type: string
      description: The unique identifier of the user
    ApiErrorBody:
      title: ApiErrorBody
      type: object
      properties:
        code:
          $ref: '#/components/schemas/ApiErrorCode'
        message:
          type: string
      required:
        - code
        - message
    InteractionParticipant:
      title: InteractionParticipant
      type: string
      enum:
        - user
        - agent
      description: >-
        Represents the type of the participant in a given interaction. As an
        example, message are created by interaction participants so the
        `sent_by` property of a `Message` object must be an
        `InteractionParticipant`.
    ApiErrorCode:
      title: ApiErrorCode
      type: string
      enum:
        - invalid_request
        - invalid_credentials
        - forbidden
        - resource_not_found
        - conflict
        - unavailable
        - unknown

````