diff --git a/a1-go/pkg/restful/restful.go b/a1-go/pkg/restful/restful.go
index 17d1fad..b0663dd 100644
--- a/a1-go/pkg/restful/restful.go
+++ b/a1-go/pkg/restful/restful.go
@@ -133,6 +133,19 @@
 		return a1_mediator.NewA1ControllerGetPolicyInstanceStatusServiceUnavailable()
 	})
 
+	api.A1MediatorA1ControllerDeletePolicyInstanceHandler = a1_mediator.A1ControllerDeletePolicyInstanceHandlerFunc(func(params a1_mediator.A1ControllerDeletePolicyInstanceParams) middleware.Responder {
+		a1.Logger.Debug("handler for delete policy instance")
+		if err := r.rh.DeletePolicyInstance(models.PolicyTypeID(params.PolicyTypeID), models.PolicyInstanceID(params.PolicyInstanceID)); err != nil {
+			if r.rh.CanPolicyInstanceBeDeleted(err) {
+				return a1_mediator.NewA1ControllerDeletePolicyInstanceNotFound()
+			}
+			return a1_mediator.NewA1ControllerDeletePolicyInstanceServiceUnavailable()
+		}
+
+		return a1_mediator.NewA1ControllerDeletePolicyInstanceAccepted()
+
+	})
+	
 	return api
 
 }
diff --git a/a1-go/pkg/resthooks/resthooks.go b/a1-go/pkg/resthooks/resthooks.go
index 0c870f6..e0060f1 100644
--- a/a1-go/pkg/resthooks/resthooks.go
+++ b/a1-go/pkg/resthooks/resthooks.go
@@ -51,6 +51,11 @@
 var policyInstanceNotFoundError = errors.New("Policy Instance Not Found")
 var policyTypeNotFoundError = errors.New("Policy Type Not Found")
 var policyTypeCanNotBeDeletedError = errors.New("tried to delete a type that isn't empty")
+var policyInstanceCanNotBeDeletedError = errors.New("tried to delete a Instance that isn't empty")
+
+func (rh *Resthook) CanPolicyInstanceBeDeleted(err error) bool {
+	return err == policyInstanceCanNotBeDeletedError
+}
 
 func (rh *Resthook) CanPolicyTypeBeDeleted(err error) bool {
 	return err == policyTypeCanNotBeDeletedError
@@ -372,7 +377,7 @@
 		}
 
 		message := rmr.Message{}
-		rmrMessage, err := message.PolicyMessage(strconv.FormatInt((int64(policyTypeId)), 10), string(policyInstanceID), httpBodyString, operation)
+		rmrMessage, err = message.PolicyMessage(strconv.FormatInt((int64(policyTypeId)), 10), string(policyInstanceID), httpBodyString, operation)
 		if err != nil {
 			a1.Logger.Error("error : %v", err)
 			return err
@@ -575,3 +580,104 @@
 	}
 	return &policyInstanceStatus, nil
 }
+
+func (rh *Resthook) storeDeletedPolicyInstanceMetadata(policyTypeId models.PolicyTypeID, policyInstanceID models.PolicyInstanceID, creation_timestamp string) error {
+	deleted_timestamp := time.Now()
+
+	instanceMetadataKey := a1InstanceMetadataPrefix + strconv.FormatInt((int64(policyTypeId)), 10) + "." + string(policyInstanceID)
+
+	a1.Logger.Debug("instanceMetadata Key : %+v", instanceMetadataKey)
+
+	var metadatajson interface{}
+	metadatajson = map[string]string{"created_at": creation_timestamp, "has_been_deleted": "True", "deleted_at": deleted_timestamp.Format("2006-01-02 15:04:05")}
+	a1.Logger.Debug("metadatajson to create : %+v", metadatajson)
+	deletedmetadata, err := json.Marshal(metadatajson)
+
+	a1.Logger.Debug("policyinstanceMetaData to create : %+v", string(deletedmetadata))
+
+	err = rh.db.Set(a1MediatorNs, instanceMetadataKey, string(deletedmetadata))
+	a1.Logger.Debug("deletemetadatacreated")
+	if err != nil {
+		a1.Logger.Error("error :%+v", err)
+		return err
+	}
+
+	a1.Logger.Error("Policy Instance Meta Data deleted at :%+v", creation_timestamp)
+
+	return nil
+}
+
+func (rh *Resthook) deleteInstancedata(policyTypeId models.PolicyTypeID, policyInstanceID models.PolicyInstanceID) error {
+	var keys [1]string
+	instancekey := a1InstancePrefix + strconv.FormatInt((int64(policyTypeId)), 10) + "." + string(policyInstanceID)
+	keys[0] = instancekey
+	err := rh.db.Remove(a1MediatorNs, keys[:])
+	if err != nil {
+		a1.Logger.Error("error in deleting policy type err: %v", err)
+		return err
+	}
+	return nil
+}
+
+func (rh *Resthook) deleteMetadata(policyTypeId models.PolicyTypeID, policyInstanceID models.PolicyInstanceID) error {
+	var keys [1]string
+	instanceMetadataKey := a1InstanceMetadataPrefix + strconv.FormatInt((int64(policyTypeId)), 10) + "." + string(policyInstanceID)
+
+	a1.Logger.Debug("instanceMetadata Key : %+v", instanceMetadataKey)
+	keys[0] = instanceMetadataKey
+	err := rh.db.Remove(a1MediatorNs, keys[:])
+	if err != nil {
+		a1.Logger.Error("error in deleting policy metadata err: %v", err)
+		return err
+	}
+	return nil
+}
+
+func (rh *Resthook) DeletePolicyInstance(policyTypeId models.PolicyTypeID, policyInstanceID models.PolicyInstanceID) error {
+	err := rh.instanceValidity(policyTypeId, policyInstanceID)
+	if err != nil {
+		a1.Logger.Error("policy instance error : %v", err)
+		if err == policyInstanceNotFoundError || err == policyTypeNotFoundError {
+			return err
+		}
+	}
+
+	createdmetadata, err := rh.getMetaData(policyTypeId, policyInstanceID)
+	if err != nil {
+		a1.Logger.Error("error : %v", err)
+		return err
+	}
+	a1.Logger.Debug(" created metadata %v", createdmetadata)
+	instanceMetadataKey := a1InstanceMetadataPrefix + strconv.FormatInt((int64(policyTypeId)), 10) + "." + string(policyInstanceID)
+	creation_metadata := createdmetadata[instanceMetadataKey]
+	var metadata map[string]interface{}
+	if err = json.Unmarshal([]byte(creation_metadata.(string)), &metadata); err != nil {
+		a1.Logger.Error("unmarshal error : %v", err)
+		return err
+	}
+
+	a1.Logger.Debug(" created metadata created_at %v", metadata["created_at"])
+	creation_timestamp := metadata["created_at"]
+
+	rh.deleteMetadata(policyTypeId, policyInstanceID)
+
+	rh.deleteInstancedata(policyTypeId, policyInstanceID)
+
+	rh.storeDeletedPolicyInstanceMetadata(policyTypeId, policyInstanceID, creation_timestamp.(string))
+
+	message := rmr.Message{}
+	rmrMessage, err = message.PolicyMessage(strconv.FormatInt((int64(policyTypeId)), 10), string(policyInstanceID), "", "DELETE")
+	if err != nil {
+		a1.Logger.Error("error : %v", err)
+		return err
+	}
+	isSent := rh.iRmrSenderInst.RmrSendToXapp(rmrMessage)
+	if isSent {
+		a1.Logger.Debug("rmrSendToXapp : message sent")
+	} else {
+		//TODO:if message not sent need to return error or just log it or retry sending
+		a1.Logger.Error("rmrSendToXapp : message not sent")
+	}
+
+	return nil
+}
diff --git a/a1-go/pkg/resthooks/resthooks_test.go b/a1-go/pkg/resthooks/resthooks_test.go
index 34bf97a..deffc4b 100644
--- a/a1-go/pkg/resthooks/resthooks_test.go
+++ b/a1-go/pkg/resthooks/resthooks_test.go
@@ -225,6 +225,76 @@
 	sdlInst.AssertExpectations(t)
 }
 
+func TestDeletePolicyInstance(t *testing.T) {
+	var policyTypeId models.PolicyTypeID
+	policyTypeId = 20001
+	var policyInstanceID models.PolicyInstanceID
+	policyInstanceID = "123456"
+	var policyTypeSchema models.PolicyTypeSchema
+	name := "admission_control_policy_mine"
+	policyTypeSchema.Name = &name
+	policytypeid := int64(20001)
+	policyTypeSchema.PolicyTypeID = &policytypeid
+	description := "various parameters to control admission of dual connection"
+	policyTypeSchema.Description = &description
+	schema := `{"$schema": "http://json-schema.org/draft-07/schema#","type":"object","properties": {"enforce": {"type":"boolean","default":"true",},"window_length": {"type":        "integer","default":1,"minimum":1,"maximum":60,"description": "Sliding window length (in minutes)",},
+"blocking_rate": {"type":"number","default":10,"minimum":1,"maximum":100,"description": "% Connections to block",},"additionalProperties": false,},}`
+	policyTypeSchema.CreateSchema = schema
+
+	key := a1PolicyPrefix + strconv.FormatInt((int64(policyTypeId)), 10)
+	var policytypekeys [1]string
+	policytypekeys[0] = key
+
+	sdlInst.On("Get", a1MediatorNs, policytypekeys[:]).Return(map[string]interface{}{key: policyTypeSchema}, nil)
+
+	httpBody := `{
+		"enforce":true,
+		"window_length":20,
+	   "blocking_rate":20,
+		"trigger_threshold":10
+		}`
+	instancekey := a1InstancePrefix + strconv.FormatInt(20001, 10) + "." + string(policyInstanceID)
+	var instancekeys [1]string
+	instancekeys[0] = instancekey
+
+	sdlInst.On("Get", a1MediatorNs, instancekeys[:]).Return(httpBody, nil)
+
+	var instanceMetadataKeys [1]string
+	instanceMetadataKey := a1InstanceMetadataPrefix + strconv.FormatInt((int64(policyTypeId)), 10) + "." + string(policyInstanceID)
+	instanceMetadataKeys[0] = instanceMetadataKey
+	httpBody = `{
+		"created_at":"2022-11-02 10:30:20",
+			"instance_status":"NOT IN EFFECT"
+		}`
+
+	sdlInst.On("Get", a1MediatorNs, instanceMetadataKeys[:]).Return(httpBody, nil)
+
+	sdlInst.On("Remove", a1MediatorNs, instanceMetadataKeys[:]).Return(nil)
+
+	var metadatainstancekeys [1]string
+	metadatainstancekeys[0] = instancekey
+
+	sdlInst.On("Remove", a1MediatorNs, metadatainstancekeys[:]).Return(nil)
+
+	metadatainstancekey := a1InstanceMetadataPrefix + strconv.FormatInt(20001, 10) + "." + string(policyInstanceID)
+	deleted_timestamp := time.Now()
+	var metadatajson interface{}
+	metadatajson = map[string]string{"created_at": "2022-11-02 10:30:20", "deleted_at": deleted_timestamp.Format("2006-01-02 15:04:05"), "has_been_deleted": "True"}
+	metadata, _ := json.Marshal(metadatajson)
+	metadatainstancearr := []interface{}{metadatainstancekey, string(metadata)}
+
+	sdlInst.On("Set", "A1m_ns", metadatainstancearr).Return(nil)
+
+	httpBodyString := `{"operation":"DELETE","payload":"","policy_instance_id":"123456","policy_type_id":"20001"}`
+
+	rmrSenderInst.On("RmrSendToXapp", httpBodyString).Return(true)
+
+	errresp := rh.DeletePolicyInstance(policyTypeId, policyInstanceID)
+
+	assert.Nil(t, errresp)
+	sdlInst.AssertExpectations(t)
+}
+
 type SdlMock struct {
 	mock.Mock
 }
@@ -255,7 +325,7 @@
 		key = a1PolicyPrefix + strconv.FormatInt((policytypeid), 10)
 	} else if keys[0] == "a1.policy_inst_metadata.20001.123456" {
 		policySchemaString = `{
-			"created_at":"0001-01-01T00:00:00.000Z",
+			"created_at":"2022-11-02 10:30:20",
 			"instance_status":"NOT IN EFFECT"
 			}`
 		key = a1InstanceMetadataPrefix + strconv.FormatInt(policytypeid, 10) + "." + string(policyInstanceID)
diff --git a/a1-go/pkg/resthooks/types.go b/a1-go/pkg/resthooks/types.go
index 4765e29..2eb2f6d 100644
--- a/a1-go/pkg/resthooks/types.go
+++ b/a1-go/pkg/resthooks/types.go
@@ -22,6 +22,7 @@
 
 import (
 	"gerrit.o-ran-sc.org/r/ric-plt/a1/pkg/rmr"
+	"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
 )
 
 type Resthook struct {
