diff --git a/capifcore/internal/publishservice/publishservice.go b/capifcore/internal/publishservice/publishservice.go
index 2314039..a4b84f1 100644
--- a/capifcore/internal/publishservice/publishservice.go
+++ b/capifcore/internal/publishservice/publishservice.go
@@ -272,7 +272,59 @@
 
 // Update a published service API.
 func (ps *PublishService) PutApfIdServiceApisServiceApiId(ctx echo.Context, apfId string, serviceApiId string) error {
-	return ctx.NoContent(http.StatusNotImplemented)
+	ps.lock.Lock()
+	defer ps.lock.Unlock()
+
+	pos, publishedService, shouldReturn, returnValue := ps.checkIfServiceIsPublished(apfId, serviceApiId, ctx)
+	if shouldReturn {
+		return returnValue
+	}
+
+	updatedServiceDescription, shouldReturn, returnValue := getServiceFromRequest(ctx)
+	if shouldReturn {
+		return returnValue
+	}
+
+	if updatedServiceDescription.Description != nil {
+		publishedService.Description = updatedServiceDescription.Description
+		ps.publishedServices[apfId][pos] = publishedService
+	}
+
+	err := ctx.JSON(http.StatusOK, ps.publishedServices[apfId][pos])
+	if err != nil {
+		// Something really bad happened, tell Echo that our handler failed
+		return err
+	}
+
+	return nil
+}
+
+func (ps *PublishService) checkIfServiceIsPublished(apfId string, serviceApiId string, ctx echo.Context) (int, publishapi.ServiceAPIDescription, bool, error) {
+
+	publishedServices, ok := ps.publishedServices[apfId]
+	if !ok {
+		return 0, publishapi.ServiceAPIDescription{}, true, sendCoreError(ctx, http.StatusBadRequest, "Service must be published before updating it")
+	} else {
+		for pos, description := range publishedServices {
+			if *description.ApiId == serviceApiId {
+				return pos, description, false, nil
+
+			}
+
+		}
+
+	}
+	return 0, publishapi.ServiceAPIDescription{}, true, sendCoreError(ctx, http.StatusBadRequest, "Service must be published before updating it")
+
+}
+
+func getServiceFromRequest(ctx echo.Context) (publishapi.ServiceAPIDescription, bool, error) {
+	var updatedServiceDescription publishapi.ServiceAPIDescription
+	err := ctx.Bind(&updatedServiceDescription)
+	if err != nil {
+		return publishapi.ServiceAPIDescription{}, true, sendCoreError(ctx, http.StatusBadRequest, "Invalid format for service")
+	}
+	return updatedServiceDescription, false, nil
 }
 
 // This function wraps sending of an error in the Error format, and
diff --git a/capifcore/internal/publishservice/publishservice_test.go b/capifcore/internal/publishservice/publishservice_test.go
index ab92363..7bb0152 100644
--- a/capifcore/internal/publishservice/publishservice_test.go
+++ b/capifcore/internal/publishservice/publishservice_test.go
@@ -179,6 +179,37 @@
 	assert.Len(t, result, 2)
 }
 
+func TestUpdateDescription(t *testing.T) {
+	apfId := "apfId"
+	serviceApiId := "serviceApiId"
+	aefId := "aefId"
+	apiName := "apiName"
+	description := "description"
+	serviceRegisterMock := serviceMocks.ServiceRegister{}
+	serviceRegisterMock.On("GetAefsForPublisher", apfId).Return([]string{aefId, "otherAefId"})
+	helmManagerMock := helmMocks.HelmManager{}
+	helmManagerMock.On("InstallHelmChart", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil)
+	serviceUnderTest, requestHandler := getEcho(&serviceRegisterMock, &helmManagerMock)
+
+	serviceDescription := getServiceAPIDescription(aefId, apiName, description)
+	serviceDescription.ApiId = &serviceApiId
+	serviceUnderTest.publishedServices[apfId] = []publishapi.ServiceAPIDescription{serviceDescription}
+
+	//Modify the service
+	updatedServiceDescription := getServiceAPIDescription(aefId, apiName, description)
+	updatedServiceDescription.ApiId = &description
+	newDescription := "new description"
+	updatedServiceDescription.Description = &newDescription
+	result := testutil.NewRequest().Put("/"+apfId+"/service-apis/"+serviceApiId).WithJsonBody(updatedServiceDescription).Go(t, requestHandler)
+
+	var resultService publishapi.ServiceAPIDescription
+	assert.Equal(t, http.StatusOK, result.Code())
+	err := result.UnmarshalBodyToObject(&resultService)
+	assert.NoError(t, err, "error unmarshaling response")
+	assert.Equal(t, resultService.Description, &newDescription)
+
+}
+
 func getEcho(serviceRegister providermanagement.ServiceRegister, helmManager helmmanagement.HelmManager) (*PublishService, *echo.Echo) {
 	swagger, err := publishapi.GetSwagger()
 	if err != nil {
