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

# Update a Specific Action by ID

> Update a Specific Action by ID



## OpenAPI

````yaml openapi.json put /v1/actions/{action_id}
openapi: 3.1.0
info:
  title: Trata AI API
  description: >-
    Human like conversation to answer calls, drive engagement, automate
    follow-ups & schedule bookings 24/7  with end to end integrations ensuring
    you never miss a sales enquiry.
  version: 1.0.0
servers:
  - url: https://api.trata.ai
    description: Production
  - url: http://localhost:8000
    description: Development
security: []
paths:
  /v1/actions/{action_id}:
    put:
      tags:
        - Actions
      summary: Update a Specific Action by ID
      description: Update a Specific Action by ID
      operationId: updateActionV1
      parameters:
        - name: action_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the action
            title: Action Id
          description: ID of the action
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Action-Input'
      responses:
        '200':
          description: Action updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/backend__db__models__Action'
              example:
                id: act.1234567890
                orgId: org.1234567890
                name: Webhook on call completion.
                description: >-
                  This action will be invoked when a call is completed. It will
                  send a webhook to the specified url.
                parameters: {}
                endpoint:
                  url: https://webhook-endpoint.com
                  method: POST
                invocationTrigger: webhook.conversation_en
                userWaitingText: Please wait...
                userSuccessText: Action completed successfully
                userErrorText: An error occurred
                createdBy: usr.1234567890
                createdAt: '2024-12-06T19:23:38.616711'
                updatedBy: usr.1234567890
                updatedAt: '2024-12-06T19:23:38.616714'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    Action-Input:
      properties:
        name:
          type: string
          maxLength: 512
          minLength: 1
          title: Name
          description: Name of the action
          example: get_delivery_date
        description:
          anyOf:
            - type: string
              maxLength: 512
              minLength: 1
            - type: 'null'
          title: Description
          description: >-
            Description about the action and it should also contain when the
            action should be triggered
          example: >-
            Get the delivery date for a customer's order. Call this whenever you
            need to know the delivery date, for example when a customer asks
            'Where is my package'
        parameters:
          type: object
          title: Parameters
          description: Parameters for the action. It should be a JSON schema object
          example: false
        endpoint:
          anyOf:
            - $ref: '#/components/schemas/HttpActionEndpoint'
            - $ref: '#/components/schemas/InternalActionEndpoint'
          title: Endpoint
          description: Endpoint for the action
        userWaitingText:
          anyOf:
            - type: string
              maxLength: 2048
              minLength: 0
            - type: 'null'
          title: Userwaitingtext
          description: Text to be rendered to user when action is invoked
          example: Please wait while we get the delivery date for your order
        userSuccessText:
          anyOf:
            - type: string
              maxLength: 2048
              minLength: 0
            - type: 'null'
          title: Usersuccesstext
          description: Text to be rendered to user when action is successful
          example: We have sent you an email with the delivery date
        userErrorText:
          anyOf:
            - type: string
              maxLength: 2048
              minLength: 0
            - type: 'null'
          title: Usererrortext
          description: Text to be rendered to user when action is not successful
          example: We are unable to get the delivery date for your order
        invocationTrigger:
          allOf:
            - $ref: '#/components/schemas/ActionInvocationTrigger'
          description: Trigger who invokes the action
      type: object
      required:
        - name
        - parameters
        - endpoint
        - invocationTrigger
      title: Action
    backend__db__models__Action:
      properties:
        id:
          type: string
          title: Id
        orgId:
          type: string
          title: Orgid
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        parameters:
          anyOf:
            - type: object
            - type: 'null'
          title: Parameters
        endpoint:
          anyOf:
            - type: object
            - type: 'null'
          title: Endpoint
        invocationTrigger:
          anyOf:
            - type: string
            - type: 'null'
          title: Invocationtrigger
        userWaitingText:
          anyOf:
            - type: string
            - type: 'null'
          title: Userwaitingtext
        userSuccessText:
          anyOf:
            - type: string
            - type: 'null'
          title: Usersuccesstext
        userErrorText:
          anyOf:
            - type: string
            - type: 'null'
          title: Usererrortext
        createdBy:
          type: string
          title: Createdby
        createdAt:
          type: string
          format: date-time
          title: Createdat
        updatedBy:
          type: string
          title: Updatedby
        updatedAt:
          type: string
          format: date-time
          title: Updatedat
      type: object
      title: Action
      description: Action entity to store the actions which can be performed by ai agents
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    HttpActionEndpoint:
      properties:
        url:
          type: string
          maxLength: 512
          minLength: 1
          title: Url
          description: Action endpoint URL
          example: http://example.com/api/action
        method:
          type: string
          enum:
            - GET
            - POST
          maxLength: 512
          minLength: 1
          title: Method
          description: Method to be used for invoking the endpoint
          default: POST
          example: POST
        headers:
          anyOf:
            - type: object
              maxProperties: 512
              minProperties: 0
            - type: 'null'
          title: Headers
          description: Headers for the endpoint
          example: application/json
        payload:
          anyOf:
            - type: object
              maxProperties: 512
              minProperties: 0
            - type: 'null'
          title: Payload
          description: Payload for the endpoint
          example: '123456'
      type: object
      required:
        - url
      title: HttpActionEndpoint
    InternalActionEndpoint:
      properties:
        module:
          type: string
          maxLength: 512
          minLength: 1
          title: Module
          description: Module where the action is defined
          example: trata.actions.get_delivery_date
        function:
          type: string
          maxLength: 512
          minLength: 1
          title: Function
          description: Function to be called inside the module
          example: get_delivery_date
      type: object
      required:
        - module
        - function
      title: InternalActionEndpoint
      description: >-
        Internal action endpoint to be used for calling the action inside the
        module. Not used by external users
    ActionInvocationTrigger:
      type: string
      enum:
        - user_query
        - webhook.conversation_start
        - webhook.conversation_end
      title: ActionInvocationTrigger
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````