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

# تحديث وجهة webhook عبر واجهة API

> عدّل وجهة webhook في Didit: التسمية، والرابط، وحالة التفعيل، والإصدار، والأحداث المشترَكة. عمليات برمجية تُدفع لكل استدعاء بلا عقود.



مطالبة واجهة برمجة تطبيقات تحديث وجهة webhook
        نسخ الموجّه إلى الحافظة



      
      

\<pre>

\`Update a Didit webhook destination through the Management API.

Endpoint:
PATCH https://verification.didit.me/v3/webhook/destinations/{destination_uuid}/

Authentication:
Use the x-api-key header with my Didit API key.

Goal:
\- Change a destination's label, url, enabled state, webhook_version, or subscribed_events. Send only the fields you want to change.

Path parameter:
\- destination_uuid — the destination UUID from GET /v3/webhook/destinations/.

Request body (application/json) — all fields optional:
\{
"label": "Updated label",
"url": "https://yourapp.com/webhooks/v2",
"enabled": false,
"webhook_version": "v3",
"subscribed_events": ["status.updated", "data.updated", "transaction.created"]
}

Critical semantics:
\- subscribed_events is replaced wholesale, NOT merged. To add an event, GET the current destination, append to the list, and send the full array back. Sending [] returns 400.
\- url must remain unique among the application's destinations.
\- A uuid in the body is ignored: the path names the destination.
\- webhook_version applies to future deliveries only. Already-queued deliveries use the version that was active when they were enqueued.
\- The signing secret (secret_shared_key) is NOT rotated by PATCH. Console offers a manual rotation flow. For 24 hours after a rotation, every delivery also carries X-Signature-Previous, X-Signature-V2-Previous and X-Signature-Simple-Previous, made with the replaced secret, and previous_secret_expires_at says when that ends.
\- Changing url does not move automatic retries of deliveries already made: they go to the URL the first attempt used. A manual resend goes to the destination's current URL.

Example call (replace subscription list):
curl -X PATCH "https://verification.didit.me/v3/webhook/destinations/{destination_uuid}/" \
-H "x-api-key: YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"subscribed_events": ["status.updated", "data.updated", "transaction.created"]}'

\# Pause a destination without losing config:
curl -X PATCH "https://verification.didit.me/v3/webhook/destinations/{destination_uuid}/" \
-H "x-api-key: YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"enabled": false}'

Failure modes:
\- 400 — empty subscribed_events, unknown event name, duplicate url among destinations, or invalid webhook_version.
\- 401 — missing or malformed x-api-key.
\- 403 — canonical { "detail": "You do not have permission to perform this action." } envelope.
\- 404 — destination not found in this application.

Side effects:
\- Subsequent webhook deliveries respect the new url, enabled flag, and subscribed_events list.

For the full integration shape, see /integration/integration-prompt.`

\</pre>



      
      

الصق في

استخدم نقطة النهاية هذه لتغيير المكان الذي ترسل إليه الوجهة webhook والأحداث التي تستقبلها الوجهة.## تحديث `subscribed_events`عند إرسال `subscribed_events`، وفّر القائمة الكاملة للأحداث التي يجب أن يظل الاشتراك فيها قائماً بعد التحديث. تستبدل المصفوفة مجموعة الاشتراك السابقة.```json theme={null}
{
  "subscribed_events": [
    "status.updated",
    "data.updated",
    "transaction.created",
    "transaction.status.updated"
  ]
}
```القيم المدعومة هي:| الحدث | ما يمثله |
| - | - |
| `status.updated` | تغيّرت حالة جلسة التحقق من المستخدمين (KYC) أو التحقق من الشركات (KYB). |
| `data.updated` | تغيّرت بيانات التحقق للجلسة بعد إنشائها. |
| `user.status.updated` | تغيّرت حالة كيان المستخدم. |
| `user.data.updated` | تغيّرت بيانات كيان المستخدم. |
| `business.status.updated` | تغيّرت حالة كيان الشركة. |
| `business.data.updated` | تغيّرت بيانات كيان الشركة. |
| `activity.created` | مقبول، لكنه لا يُسلَّم إلى حركة المرور في بيئة الإنتاج اليوم. |
| `transaction.created` | أُنشئت المعاملة وقُيّمت مبدئياً. |
| `transaction.status.updated` | تغيّرت حالة المعاملة. |
| `travel_rule.status.updated` | تغيّرت حالة تبادل Travel Rule. |
| `workflow.compliance_changed` | تغيّرت حالة الامتثال لسير عمل منشور. |
| `transaction_rule_suggestions.created` | اقترحت عملية اقتراح القواعد تغييرات جديدة على القواعد. |عائلتا الأحداث `investigator.*` و`auth.*` مقبولتان أيضاً؛ راجع [Webhooks](https://docs.didit.me/ar/integration/webhooks.md#أنواع-الأحداث) للاطلاع على القائمة الكاملة.استخدم [دليل إنشاء وجهة webhook](https://docs.didit.me/ar/management-api/webhook/create-destination.md) للاطلاع على أوصاف الأحداث التفصيلية ومجموعات الاشتراك الشائعة.


## OpenAPI

````yaml ar/openapi-25.json PATCH /v3/webhook/destinations/{destination_uuid}/
openapi: 3.0.0
info:
  version: 3.0.0
  title: Didit Verification API
  description: API التحقق من الهوية. قم بالمصادقة باستخدام الرأس x-api-key.
servers:
  - url: https://verification.didit.me
security: []
tags: []
paths:
  /v3/webhook/destinations/{destination_uuid}/:
    patch:
      tags:
        - Webhook
      summary: تحديث وجهة webhook
      description: >-
        تحديث وجهة webhook. **يتم استبدال `subscribed_events` بالكامل، وليس
        دمجه**: استرد أولاً، ثم أضف، ثم أعد الإرسال. لا يتم تدوير السر. يتم
        تجاهل `uuid` في نص الطلب: يحدد المسار اسم الوجهة.
      operationId: update_webhook_destination
      parameters:
        - name: destination_uuid
          in: path
          required: true
          description: معرّف UUID للوجهة المراد تحديثها.
          schema:
            type: string
            format: uuid
          example: 11111111-2222-3333-4444-555555555555
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                label:
                  type: string
                  description: اسم جديد مقروء للمستخدمين.
                url:
                  type: string
                  format: uri
                  description: رابط URL المستهدف الجديد. يجب أن يكون فريداً داخل التطبيق.
                enabled:
                  type: boolean
                  description: >-
                    يُضبط على `false` لإيقاف عمليات التسليم مؤقتاً إلى هذه
                    الوجهة دون حذفها.
                webhook_version:
                  type: string
                  enum:
                    - v1
                    - v2
                    - v3
                  description: إصدار مخطط payload الجديد لعمليات التسليم المستقبلية.
                subscribed_events:
                  $ref: '#/components/schemas/WebhookSubscribedEvents'
            examples:
              Pause destination:
                value:
                  enabled: false
              Add transaction events:
                value:
                  subscribed_events:
                    - status.updated
                    - data.updated
                    - transaction.created
                    - transaction.status.updated
              Move target URL:
                value:
                  label: Production session webhooks v2
                  url: https://api.yourapp.com/webhooks/didit/v2
      responses:
        '200':
          description: >-
            وجهة webhook المحدّثة. المحتوى له نفس بنية `GET
            /v3/webhook/destinations/{destination_uuid}/`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  uuid:
                    type: string
                    format: uuid
                  label:
                    type: string
                  url:
                    type: string
                    format: uri
                  enabled:
                    type: boolean
                  webhook_version:
                    type: string
                    enum:
                      - v1
                      - v2
                      - v3
                  secret_shared_key:
                    type: string
                  secret_last4:
                    type: string
                    description: >-
                      آخر أربعة أحرف من سر التوقيع الحالي للوجهة، لتتمكن من
                      التمييز بين الأسرار. غير كافية للتحقق من التوقيع.
                  previous_secret_expires_at:
                    type: string
                    format: date-time
                    nullable: true
                    description: >-
                      يُعيَّن لمدة 24 ساعة بعد تدوير سر التوقيع للوجهة في
                      Business Console. حتى هذا الوقت، يحمل كل تسليم إلى الوجهة
                      أيضاً `X-Signature-Previous` و `X-Signature-V2-Previous` و
                      `X-Signature-Simple-Previous`، المنشأة باستخدام السر
                      المُستبدل (انظر [التحقق من
                      التوقيع](/ar/integration/webhooks#التحقق-من-التوقيع)).
                      تكون القيمة `null` في حال عدم حدوث أي تدوير خلال آخر 24
                      ساعة.
                  subscribed_events:
                    $ref: '#/components/schemas/WebhookSubscribedEvents'
                  created_by_email:
                    type: string
                    nullable: true
                    description: >-
                      البريد الإلكتروني لعضو Business Console الذي أنشأ الوجهة.
                      يكون `null` بالنسبة للوجهة التي تم إنشاؤها باستخدام مفتاح
                      API.
                  created_by_name:
                    type: string
                    nullable: true
                    description: >-
                      اسم عضو Business Console الذي أنشأ الوجهة. `null` لوجهة تم
                      إنشاؤها باستخدام مفتاح API.
                  created_at:
                    type: string
                    format: date-time
                  updated_at:
                    type: string
                    format: date-time
                  health_status:
                    type: string
                    enum:
                      - healthy
                      - degraded
                      - failing
                    description: >-
                      حالة التشغيل للتسليم. `failing`: فشل 3 أحداث متتالية أو
                      أكثر في أول محاولة تسليم لها منذ آخر استجابة ناجحة للوجهة
                      (راجع `failing_streak`). `degraded`: ليست في حالة failing،
                      ولكن فشلت محاولة تسليم خلال آخر 24 ساعة ولم تنجح أي محاولة
                      لاحقة في تسليم ذلك الحدث؛ وستؤدي إعادة المحاولة أو إعادة
                      الإرسال التي تنجح في تسليمه إلى محو هذه الحالة. `healthy`:
                      ليست في أي من الحالتين السابقتين. مستقلة عن `enabled`.
                      المحاولة الفاشلة هي المحاولة التي تمت الاستجابة لها برمز
                      HTTP 400 أو أعلى، أو لم تتم الاستجابة لها على الإطلاق.
                  failing_streak:
                    type: integer
                    description: >-
                      عدد الأحداث المتتالية التي فشلت محاولة تسليمها الأولى منذ
                      آخر استجابة ناجحة للوجهة، خلال آخر 30 يوماً. لا تُحتسب
                      عمليات إعادة المحاولة، وأي محاولة ناجحة، بما في ذلك إعادة
                      المحاولة أو إعادة الإرسال، تنهي سلسلة الفشل. تكون القيمة
                      `0` عندما لا يفشل أي حدث منذ آخر نجاح.
                  failing_since:
                    type: string
                    format: date-time
                    nullable: true
                    description: >-
                      وقت إجراء أول محاولة فاشلة في `failing_streak` الحالية.
                      تكون القيمة `null` عندما تكون `failing_streak` تساوي `0`.
                  last_success_at:
                    type: string
                    format: date-time
                    nullable: true
                    description: >-
                      وقت آخر استجابة من الوجهة لتسليم بحالة HTTP أقل من 400،
                      خلال آخر 30 يوماً. وتكون القيمة `null` إذا لم تُجب خلال
                      تلك الفترة بتسليم ذي حالة HTTP أقل من 400.
                  environment:
                    type: string
                    enum:
                      - live
                      - sandbox
                    description: بيئة التطبيق الذي يملك الوجهة.
                  summary:
                    type: object
                    description: >-
                      مقاييس التسليم لآخر `metrics_window_days` (30) يوماً.
                      `last_delivery_at` هي أحدث محاولة، بغض النظر عن وقت
                      إجرائها.
                    properties:
                      total_deliveries:
                        type: integer
                      failed_deliveries:
                        type: integer
                      error_rate_percentage:
                        type: integer
                      min_response_time_ms:
                        type: integer
                        nullable: true
                      avg_response_time_ms:
                        type: integer
                        nullable: true
                      max_response_time_ms:
                        type: integer
                        nullable: true
                      last_delivery_at:
                        type: string
                        format: date-time
                        nullable: true
                      metrics_window_days:
                        type: integer
                        description: >-
                          طول النافذة الزمنية بالأيام التي تغطيها مقاييس الملخص
                          الأخرى. القيمة دائماً `30`.
              examples:
                Paused:
                  value:
                    uuid: 11111111-2222-3333-4444-555555555555
                    label: Production session webhooks
                    url: https://yourapp.com/webhooks/didit
                    enabled: false
                    webhook_version: v3
                    secret_shared_key: tno2NTeRC1ZK3sBOYlBJDyEzBVENl3pQ1AcZyAW0xnQ
                    secret_last4: 0xnQ
                    previous_secret_expires_at: null
                    subscribed_events:
                      - status.updated
                      - data.updated
                    created_by_email: null
                    created_by_name: null
                    created_at: '2026-01-04T08:00:00Z'
                    updated_at: '2026-05-17T11:02:55Z'
                    health_status: healthy
                    failing_streak: 0
                    failing_since: null
                    last_success_at: '2026-05-17T09:21:18Z'
                    environment: live
                    summary:
                      total_deliveries: 12453
                      failed_deliveries: 14
                      error_rate_percentage: 0
                      min_response_time_ms: 41
                      avg_response_time_ms: 187
                      max_response_time_ms: 2103
                      last_delivery_at: '2026-05-17T09:21:18Z'
                      metrics_window_days: 30
        '400':
          description: >-
            فشل التحقق (عنوان URL مكرر، أو قائمة أحداث فارغة/تتضمن أحداثًا غير
            معروفة، أو نص طلب مشوه).
          content:
            application/json:
              examples:
                Duplicate URL:
                  value:
                    url:
                      - >-
                        This webhook destination already exists for the
                        application.
                Empty events:
                  value:
                    subscribed_events:
                      - At least one subscribed event is required.
        '403':
          description: >-
            مفتاح API مفقود أو غير صالح أو منتهي الصلاحية أو مخصص لتطبيق مختلف.
            يُرجع المفتاح المفقود رمز الحالة `403`؛ بينما يُرجع المفتاح الخاطئ
            أو الملغى أو منتهي الصلاحية رمز الحالة `401`.
          content:
            application/json:
              examples:
                Forbidden:
                  value:
                    detail: You do not have permission to perform this action.
        '404':
          description: >-
            الوجهة ذات معرّف UUID هذا غير موجودة (أو تم حذفها، أو تنتمي إلى
            تطبيق آخر).
          content:
            application/json:
              examples:
                Not found:
                  value:
                    detail: Webhook destination not found.
        '429':
          description: تم تجاوز حد المعدل؛ تراجع مؤقتاً وأعد المحاولة.
          content:
            application/json:
              examples:
                Throttled:
                  value:
                    detail: Request was throttled. Expected available in 30 seconds.
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X PATCH
            'https://verification.didit.me/v3/webhook/destinations/11111111-2222-3333-4444-555555555555/'
            \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{
                "subscribed_events": [
                  "status.updated",
                  "data.updated",
                  "transaction.created"
                ]
              }'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY.
            client = Didit()

            result = client.webhooks.destinations.update(
                "11111111-2222-3333-4444-555555555555",
                enabled=False,
            )
            print(result)
        - lang: javascript
          label: Node.js
          source: >-
            import Didit from "@didit-protocol/sdk-node";


            // Reads DIDIT_API_KEY.

            const didit = new Didit();


            const result = await
            didit.webhooks.destinations.update("11111111-2222-3333-4444-555555555555",
            {
              enabled: false,
            });

            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY.\nclient := didit.NewClient()\n\nresult, err := client.Webhooks.Destinations.Update(ctx, \"11111111-2222-3333-4444-555555555555\", didit.WebhooksDestinationsUpdateParams{\n\tEnabled: didit.Bool(false),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import me.didit.Didit;

            import me.didit.types.WebhooksDestinationsUpdateParams;


            // Reads DIDIT_API_KEY.

            Didit client = new Didit();


            var result =
            client.webhooks().destinations().update("11111111-2222-3333-4444-555555555555",
            WebhooksDestinationsUpdateParams.builder()
                    .enabled(false)
                    .build());
            System.out.println(result);
        - lang: php
          label: PHP
          source: >-
            <?php


            require 'vendor/autoload.php';


            use Didit\DiditClient;


            // Reads DIDIT_API_KEY.

            $didit = new DiditClient();


            $result =
            $didit->webhooks->destinations->update('11111111-2222-3333-4444-555555555555',
            [
                'enabled' => false,
            ]);

            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

            # Reads DIDIT_API_KEY.
            didit = Didit::Client.new

            result = didit.webhooks.destinations.update(
              "11111111-2222-3333-4444-555555555555",
              enabled: false
            )
            puts result.to_h
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Text.Json;

            using Didit;


            // Reads DIDIT_API_KEY.

            using var client = new DiditClient();


            var result = await
            client.Webhooks.Destinations.UpdateAsync("11111111-2222-3333-4444-555555555555",
            new WebhooksDestinationsUpdateParams

            {
                Enabled = false,
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    WebhookSubscribedEvents:
      type: array
      description: >-
        أداة تصفية الأحداث لوجهة webhook هذه. تسلّم Didit فقط إشعارات webhook
        التي يتطابق نوع الحدث الخاص بها تماماً مع إحدى هذه القيم — لا يوجد
        اشتراك باستخدام أحرف البدل. عند الإرسال، يجب أن تحتوي القائمة على حدث
        صالح واحد على الأقل (يتم رفض `[]` الصريحة بالرمز 400)؛ والوجهة التي تكون
        قائمتها فارغة (تم إغفال الحقل عند الإنشاء) لا تتلقى أي شيء. عند التحديث،
        يتم استبدال القائمة بالكامل ولا تُدمج أبداً.
      minItems: 1
      uniqueItems: true
      items:
        $ref: '#/components/schemas/WebhookEvent'
      example:
        - status.updated
        - data.updated
    WebhookEvent:
      type: string
      description: >-
        اسم حدث webhook المدعوم. استخدم هذه النصوص بدقة في `subscribed_events`؛
        حيث يتم رفض القيم غير المدعومة.
      enum:
        - status.updated
        - data.updated
        - user.status.updated
        - user.data.updated
        - business.status.updated
        - business.data.updated
        - activity.created
        - transaction.created
        - transaction.status.updated
        - travel_rule.status.updated
        - workflow.compliance_changed
        - transaction_rule_suggestions.created
        - auth.signup
        - auth.login
        - auth.login_failed
        - auth.password_reset_requested
        - auth.password_reset_completed
        - auth.mfa_changed
        - auth.new_device
        - auth.account_locked
        - investigator.report.ready
        - investigator.decision.automated
        - investigator.decision.overridden
        - investigator.decision.contested
        - investigator.question.raised
        - investigator.automation.paused
        - investigator.rfi.answered
        - investigator.rfi.overdue
        - investigator.drift.detected
        - investigator.sla.breached
        - investigator.qa.failed
        - investigator.external.report.ready
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        مفتاح API الخاص بتطبيقك، من Developers -> API keys في Business Console.
        يمتلك المفتاح الأساسي وصولاً كاملاً. يمكن تحديد نطاق المفتاح المسمى: لا
        شيء، أو قراءة، أو كتابة لكل مورد، ومحدوداً ببعض مسارات العمل أو بالجلسات
        المقبولة، وبقائمة من عناوين IP، وبتاريخ انتهاء الصلاحية. يشير 401 إلى أن
        المفتاح غير صحيح أو ملغى أو منتهي الصلاحية؛ ويشير 403 إلى أنه لم يتم
        إرسال أي مفتاح، أو أن المفتاح ليس لديه حق الوصول إلى هذا المورد أو
        الإجراء، أو أن الطلب جاء من عنوان خارج قائمة عناوين IP الخاصة به؛ ويشير
        404 في مسار جلسة إلى أن الجلسة خارج مسارات العمل أو الحالات الخاصة
        بالمفتاح. يتلقى المفتاح الذي لا يمتلك حق الوصول إلى الوسائط عناوين URL
        للصور ومقاطع الفيديو وملفات PDF كـ null، ويتلقى المفتاح الذي لا يمتلك
        إذن كتابة للجلسات روابط الجلسة وtoken كـ null. راجع
        https://docs.didit.me/console/api-keys.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.