# Update notification PUT https://api-sandbox.payabli.com/api/Notification/{nId} Content-Type: application/json Update a notification or autogenerated report. Reference: https://docs.payabli.com/developers/api-reference/notification/update-notification ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Update notification version: endpoint_notification.UpdateNotification paths: /Notification/{nId}: put: operationId: update-notification summary: Update notification description: 'Update a notification or autogenerated report. ' tags: - - subpackage_notification parameters: - name: nId in: path description: 'Notification ID. ' required: true schema: type: string - name: requestToken in: header required: true schema: type: string responses: '200': description: Success content: application/json: schema: $ref: '#/components/schemas/type_:PayabliApiResponseNotifications' '400': description: Bad request/ invalid data content: {} '401': description: Unauthorized request. content: {} '500': description: Internal API Error content: {} '503': description: Database connection error content: {} requestBody: content: application/json: schema: $ref: '#/components/schemas/type_notification:UpdateNotificationRequest' components: schemas: type_:NotificationStandardRequestContentEventType: type: string enum: - value: payin_transaction_initiated - value: payin_transaction_authorized - value: payin_transaction_approvedcaptured - value: payin_transaction_declined - value: payin_transaction_technicaldecline - value: payin_transaction_failed - value: payin_transaction_error - value: payin_transaction_paid - value: payin_transaction_returned - value: payin_transaction_rejected - value: payin_transaction_voidedcancelled - value: payin_transaction_processing - value: payin_transaction_processed - value: payin_transaction_onhold - value: payin_transaction_released - value: payin_transaction_recovered - value: payout_transaction_initiated - value: payout_transaction_authorized - value: payout_transaction_approvedcaptured - value: payout_transaction_declined - value: payout_transaction_technicaldecline - value: payout_transaction_failed - value: payout_transaction_error - value: payout_transaction_paid - value: payout_transaction_returned - value: payout_transaction_rejected - value: payout_transaction_voidedcancelled - value: payout_transaction_processing - value: payout_transaction_processed - value: payout_transaction_onhold - value: payout_transaction_released - value: payout_transaction_recovered - value: payin_batch_open - value: payin_batch_onhold - value: payin_batch_released - value: payin_batch_processed - value: payin_batch_paid - value: payin_batch_funded - value: payin_batch_closed - value: payin_batch_notclosed - value: payin_batch_fundpending - value: payin_batch_cancelled - value: payin_batch_transferred - value: payin_batch_resolved - value: payout_batch_open - value: payout_batch_onhold - value: payout_batch_released - value: payout_batch_processed - value: payout_batch_paid - value: payout_batch_funded - value: payout_batch_closed - value: payout_batch_notclosed - value: payout_batch_fundpending - value: payout_batch_cancelled - value: payout_batch_transferred - value: payout_batch_resolved - value: payin_batch_settlement_pending - value: payin_batch_settlement_intransit - value: payin_batch_settlement_transferred - value: payin_batch_settlement_funded - value: payin_batch_settlement_resolved - value: payin_batch_settlement_exception - value: payin_batch_settlement_achreturn - value: payin_batch_settlement_held - value: payin_batch_settlement_released - value: payout_batch_settlement_pending - value: payout_batch_settlement_intransit - value: payout_batch_settlement_transferred - value: payout_batch_settlement_funded - value: payout_batch_settlement_resolved - value: payout_batch_settlement_exception - value: payout_batch_settlement_achreturn - value: payout_batch_settlement_held - value: payout_batch_settlement_released - value: ApprovedPayment - value: AuthorizedPayment - value: DeclinedPayment - value: OriginatedPayment - value: SettledPayment - value: SubscriptionCreated - value: SubscriptionUpdated - value: SubscriptionCanceled - value: SubscriptionCompleted - value: FundedPayment - value: VoidedPayment - value: RefundedPayment - value: HoldTransaction - value: ReleasedTransaction - value: HoldBatch - value: ReleasedBatch - value: TransferAdjusted - value: TransferDisabledCreditFund - value: TransferDisabledDebitFund - value: TransferNotAvailableBalance - value: TransferReadyforRetry - value: TransferResolved - value: TransferReturn - value: TransferSuccess - value: TransferSuspended - value: TransferError - value: SendReceipt - value: RecoveredTransaction - value: CreatedApplication - value: ApprovedApplication - value: FailedBoardingApplication - value: SubmittedApplication - value: UnderWritingApplication - value: ActivatedMerchant - value: ReceivedChargeBack - value: ChargebackUpdated - value: ReceivedRetrieval - value: RetrievalUpdated - value: ReceivedAchReturn - value: HoldingApplication - value: DeclinedApplication - value: BoardingApplication - value: PaypointMoved - value: FraudAlert - value: InvoiceSent - value: InvoicePaid - value: InvoiceCreated - value: BillPaid - value: BillApproved - value: BillDisApproved - value: BillCanceled - value: BillProcessing - value: CardCreated - value: CardActivated - value: CardDeactivated - value: CardExpired - value: CardExpiring - value: CardLimitUpdated - value: BatchClosed - value: BatchNotClosed - value: PayOutFunded - value: PayOutProcessed - value: PayOutCanceled - value: PayOutPaid - value: PayOutReturned - value: PayoutSubscriptionCreated - value: PayoutSubscriptionUpdated - value: PayoutSubscriptionCanceled - value: PayoutSubscriptionCompleted - value: PayoutSubscriptionReminder - value: importFileReceived - value: importFileProcessed - value: importFileError - value: exportFileSent - value: exportFileError - value: UpdatedMerchant - value: Report - value: FailedEmailNotification - value: FailedWebNotification - value: FailedSMSNotification - value: UserPasswordExpiring - value: UserPasswordExpired - value: TransactionNotFound - value: SystemAlert type_:KeyValueDuo: type: object properties: key: type: string description: Key name. value: type: string description: Key value. type_:NotificationStandardRequestContent: type: object properties: eventType: $ref: >- #/components/schemas/type_:NotificationStandardRequestContentEventType description: The notification's event name. internalData: type: array items: $ref: '#/components/schemas/type_:KeyValueDuo' description: >- Array of pairs key:value to insert in request body to target in **method** = *web*. transactionId: type: string default: '0' description: >- Used internally to reference the entity or object generating the event. webHeaderParameters: type: array items: $ref: '#/components/schemas/type_:KeyValueDuo' description: >- Array of pairs key:value to insert in header of request to target in **method** = *web*. type_:NotificationStandardRequestFrequency: type: string enum: - value: one-time - value: untilcancelled type_:NotificationStandardRequestMethod: type: string enum: - value: email - value: sms - value: web type_:Ownerid: type: string type_:Ownertype: type: integer type_:Statusnotification: type: integer type_:NotificationStandardRequest: type: object properties: content: $ref: '#/components/schemas/type_:NotificationStandardRequestContent' frequency: $ref: '#/components/schemas/type_:NotificationStandardRequestFrequency' method: $ref: '#/components/schemas/type_:NotificationStandardRequestMethod' description: >- Get near-instant notifications via email, SMS, or webhooks for important events like new payment disputes, merchant activations, fraud alerts, approved transactions, settlement history, vendor payouts, and more. Use webhooks with notifications to get real-time updates and automate operations based on key those key events. See [Notifications](/developers/developer-guides/notifications-and-webhooks-overview#notifications) for more. ownerId: $ref: '#/components/schemas/type_:Ownerid' ownerType: $ref: '#/components/schemas/type_:Ownertype' status: $ref: '#/components/schemas/type_:Statusnotification' target: type: string description: >- Specify the notification target. - For method=email the expected value is a list of email addresses separated by semicolon. - For method=sms the expected value is a list of phone numbers separated by semicolon. - For method=web the expected value is a valid and complete URL. Webhooks support only standard HTTP ports: 80, 443, 8080, or 4443. required: - frequency - method - ownerType - target type_:NotificationReportRequestContentFileFormat: type: string enum: - value: json - value: csv - value: xlsx type_:NotificationReportRequestContentReportName: type: string enum: - value: Transaction - value: Settlement - value: Boarding - value: Returned type_:Timezone: type: integer type_:NotificationReportRequestContent: type: object properties: eventType: type: string enum: - type: stringLiteral value: Report description: The notification's event name. fileFormat: $ref: >- #/components/schemas/type_:NotificationReportRequestContentFileFormat description: Indicate the format of report file to be generated by the engine. internalData: type: array items: $ref: '#/components/schemas/type_:KeyValueDuo' description: >- Array of pairs key:value to insert in request body to target in **method** = *report-web*. reportName: $ref: >- #/components/schemas/type_:NotificationReportRequestContentReportName description: The kind report to generate. timeZone: $ref: '#/components/schemas/type_:Timezone' transactionId: type: string default: '0' description: >- Used internally to reference the entity or object generating the event. webHeaderParameters: type: array items: $ref: '#/components/schemas/type_:KeyValueDuo' description: >- Array of pairs key:value to insert in header of request to target in **method** = *report-web*. type_:NotificationReportRequestFrequency: type: string enum: - value: one-time - value: daily - value: weekly - value: biweekly - value: monthly - value: quarterly - value: semiannually - value: annually type_:NotificationReportRequestMethod: type: string enum: - value: report-email - value: report-web type_:NotificationReportRequest: type: object properties: content: $ref: '#/components/schemas/type_:NotificationReportRequestContent' frequency: $ref: '#/components/schemas/type_:NotificationReportRequestFrequency' method: $ref: '#/components/schemas/type_:NotificationReportRequestMethod' description: >- Automated reporting lets you gather critical reports without manually filtering and exporting the data. Get automated daily, weekly, and monthly report for daily sales, ACH returns, settlements, and more. You can send these reports via email or via webhook. See [Automated Reports](/developers/developer-guides/notifications-and-webhooks-overview#automated-reports) for more. ownerId: $ref: '#/components/schemas/type_:Ownerid' ownerType: $ref: '#/components/schemas/type_:Ownertype' status: $ref: '#/components/schemas/type_:Statusnotification' target: type: string description: >- Specify the notification target. For method=report-email the expected value is a list of email addresses separated by semicolon. For method=report-web the expected value is a valid and complete URL. Webhooks support only standard HTTP ports: 80, 443, 8080, or 4443. required: - content - frequency - method - ownerType - target type_notification:UpdateNotificationRequest: oneOf: - $ref: '#/components/schemas/type_:NotificationStandardRequest' - $ref: '#/components/schemas/type_:NotificationReportRequest' type_:IsSuccess: type: boolean type_:PageIdentifier: type: string type_:Responsecode: type: integer type_:PayabliApiResponseNotificationsResponseData: oneOf: - type: integer - type: string type_:ResponseText: type: string type_:PayabliApiResponseNotifications: type: object properties: isSuccess: $ref: '#/components/schemas/type_:IsSuccess' description: >- If `isSuccess` = true, `responseData` contains the notification identifier. If `isSuccess` = false, `responseData` contains the reason for the error. pageIdentifier: $ref: '#/components/schemas/type_:PageIdentifier' responseCode: $ref: '#/components/schemas/type_:Responsecode' responseData: $ref: >- #/components/schemas/type_:PayabliApiResponseNotificationsResponseData description: >- When the request was successful, this contains the notification ID, or `nID` used to manage the notification. responseText: $ref: '#/components/schemas/type_:ResponseText' required: - responseText ``` ## SDK Code Examples ```python Update from payabli import ( NotificationStandardRequest, NotificationStandardRequestContent, payabli, ) client = payabli( api_key="YOUR_API_KEY", ) client.notification.update_notification( n_id="1717", request=NotificationStandardRequest( content=NotificationStandardRequestContent( event_type="ApprovedPayment", ), frequency="untilcancelled", method="email", owner_id="136", owner_type=0, status=1, target="newemail@email.com", ), ) ``` ```typescript Update import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); await client.notification.updateNotification("1717", { content: { eventType: "ApprovedPayment" }, frequency: "untilcancelled", method: "email", ownerId: "136", ownerType: 0, status: 1, target: "newemail@email.com" }); ``` ```go Update import ( context "context" option "github.com/payabli/sdk-go/option" sdkgo "github.com/payabli/sdk-go" sdkgoclient "github.com/payabli/sdk-go/client" ) client := sdkgoclient.NewClient( option.WithApiKey( "", ), ) response, err := client.Notification.UpdateNotification( context.TODO(), "1717", &sdkgo.UpdateNotificationRequest{ NotificationStandardRequest: &sdkgo.NotificationStandardRequest{ Content: &sdkgo.NotificationStandardRequestContent{ EventType: sdkgo.NotificationStandardRequestContentEventTypeApprovedPayment, }, Frequency: sdkgo.NotificationStandardRequestFrequencyUntilcancelled, Method: sdkgo.NotificationStandardRequestMethodEmail, OwnerId: sdkgo.String( "136", ), OwnerType: 0, Status: sdkgo.Int( 1, ), Target: "newemail@email.com", }, }, ) ``` ```csharp Update using PayabliApi; var client = new PayabliApiClient("API_KEY"); await client.Notification.UpdateNotificationAsync( "1717", new NotificationStandardRequest { Content = new NotificationStandardRequestContent { EventType = NotificationStandardRequestContentEventType.ApprovedPayment, }, Frequency = NotificationStandardRequestFrequency.Untilcancelled, Method = NotificationStandardRequestMethod.Email, OwnerId = "136", OwnerType = 0, Status = 1, Target = "newemail@email.com", } ); ``` ```ruby Update require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/Notification/1717") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Put.new(url) request["requestToken"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"content\": {\n \"eventType\": \"ApprovedPayment\"\n },\n \"frequency\": \"untilcancelled\",\n \"method\": \"email\",\n \"ownerId\": \"136\",\n \"ownerType\": 0,\n \"status\": 1,\n \"target\": \"newemail@email.com\"\n}" response = http.request(request) puts response.read_body ``` ```java Update HttpResponse response = Unirest.put("https://api-sandbox.payabli.com/api/Notification/1717") .header("requestToken", "") .header("Content-Type", "application/json") .body("{\n \"content\": {\n \"eventType\": \"ApprovedPayment\"\n },\n \"frequency\": \"untilcancelled\",\n \"method\": \"email\",\n \"ownerId\": \"136\",\n \"ownerType\": 0,\n \"status\": 1,\n \"target\": \"newemail@email.com\"\n}") .asString(); ``` ```php Update request('PUT', 'https://api-sandbox.payabli.com/api/Notification/1717', [ 'body' => '{ "content": { "eventType": "ApprovedPayment" }, "frequency": "untilcancelled", "method": "email", "ownerId": "136", "ownerType": 0, "status": 1, "target": "newemail@email.com" }', 'headers' => [ 'Content-Type' => 'application/json', 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift Update import Foundation let headers = [ "requestToken": "", "Content-Type": "application/json" ] let parameters = [ "content": ["eventType": "ApprovedPayment"], "frequency": "untilcancelled", "method": "email", "ownerId": "136", "ownerType": 0, "status": 1, "target": "newemail@email.com" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/Notification/1717")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PUT" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```