> ## 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.

# إنشاء قالب تقرير API

> أنشئ قالب رأس تقرير goAML قابلاً لإعادة الاستخدام لكل ولاية قضائية، ويُتحقق من صحته مقابل الحقول الإلزامية قبل استخدامه في Didit.



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



      
      

\<pre>

\`Create a FIU report template through the Management API.

Endpoint:
POST https://verification.didit.me/v3/organization/{organization_id}/application/{application_id}/report-templates/

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

Request body:
\{
"name": "US SAR default",         // required
"jurisdiction": "US",               // required, ISO 3166-1 alpha-2, upper-cased on save
"report_type": "SAR",               // required: SAR|STR|CTR|TTR|UTR|IFT|CBR|TFR
"field_config": {
"rentity_id": "FIU-US-00123",     // obligatory - reporting entity ID from your FIU
"submission_code": "E",           // obligatory - E (electronic) or M (manual)
"currency_code_local": "USD",     // obligatory
"enabled_fields": ["reporting_person", "location"]  // optional blocks to include by default
}
}

Validation:
\- jurisdiction must be a recognized ISO2 code.
\- field_config is checked against the template-level obligatory goAML fields - exactly rentity_id, submission_code, and currency_code_local (3-letter). Missing fields return a 400 listing exactly which ones, and the template cannot be saved until they are filled in.
\- The remaining report header fields (action, submission_date, at least one transaction, jurisdiction) are per-filing values, enforced later when the REPORT is validated/finalized - not on the template.

Example call:
curl -X POST "https://verification.didit.me/v3/organization/{organization_id}/application/{application_id}/report-templates/" \
-H "x-api-key: YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"name": "US SAR default", "jurisdiction": "US", "report_type": "SAR", "field_config": {"rentity_id": "FIU-US-00123", "submission_code": "E", "currency_code_local": "USD"}}'

Response 201: ReportTemplateDetail.

Failure modes:
\- 400 - unrecognized jurisdiction, or field_config missing obligatory fields ({"errors": ["rentity_id", ...]}).
\- 401/403 - auth/permission errors (requires write:cases).

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

\</pre>



      
      

الصق في

أنشئ قالب رأس goAML قابلًا لإعادة الاستخدام. يجب أن يجتاز القالب التحقق من الحقول الإلزامية (`rentity_id` و`submission_code` و`currency_code_local`) ليُحفظ، سواء عند الإنشاء أو عند كل تعديل لاحق. أما حقول الرأس الخاصة بكل تقرير، مثل `action` و`submission_date`، فتُطبَّق عند التحقق من التقرير نفسه أو إنهائه، ولا تُطبَّق على القالب.## ذات صلة- [عرض قوالب التقارير](https://docs.didit.me/ar/management-api/report-templates/list.md)
- [إنشاء تقرير من الحالة](https://docs.didit.me/ar/management-api/regulatory-reports/create-for-case.md)


## OpenAPI

````yaml ar/openapi-25.json POST /v3/organization/{organization_id}/application/{application_id}/report-templates/
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/organization/{organization_id}/application/{application_id}/report-templates/:
    post:
      tags:
        - Report Templates
      summary: إنشاء قالب تقرير
      description: >-
        أنشئ قالب ترويسة goAML قابلاً لإعادة الاستخدام لكل اختصاص قضائي ولكل نوع
        تقرير. يتم الرفض برمز 400 إذا كان أي من الحقول الإلزامية على مستوى
        القالب (rentity_id وsubmission_code وcurrency_code_local) مفقوداً من
        field_config؛ ولا يمكن حفظ قالب غير صالح أو استخدامه لإنشاء تقرير. أما
        حقول الترويسة الخاصة بكل إيداع (action وsubmission_date وtransactions)
        فيتم فرضها عند التحقق من صحة التقرير أو اعتماده نهائياً بدلاً من ذلك.
      operationId: create_report_template
      parameters:
        - name: organization_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: UUID الخاص بالمؤسسة.
        - name: application_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: معرّف UUID للتطبيق.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - jurisdiction
                - report_type
              properties:
                name:
                  type: string
                jurisdiction:
                  type: string
                  minLength: 2
                  maxLength: 2
                  description: >-
                    رمز الدولة وفقاً لـ ISO 3166-1 alpha-2، يتم تحويله إلى أحرف
                    كبيرة عند الحفظ.
                report_type:
                  type: string
                  enum:
                    - SAR
                    - STR
                    - CTR
                    - TTR
                    - UTR
                    - IFT
                    - CBR
                    - TFR
                field_config:
                  type: object
                  description: >-
                    القيم الافتراضية القابلة لإعادة الاستخدام لرأس goAML. الحقول
                    الإلزامية على مستوى القالب: rentity_id، وsubmission_code،
                    وcurrency_code_local (من 3 أحرف). الحقول الاختيارية:
                    enabled_fields (أقسام التقرير الاختيارية المطلوب تضمينها)
                    بالإضافة إلى القيم الافتراضية لكل من reporting_person،
                    وlocation، وreason، وaction. يتم فرض حقول الرأس الخاصة بكل
                    ملف تقديم (action، وsubmission_date، وtransactions،
                    وjurisdiction) عند التحقق من صحة التقرير أو إتمامه نهائياً،
                    وليس على مستوى القالب.
            example:
              name: US SAR default
              jurisdiction: US
              report_type: SAR
              field_config:
                rentity_id: FIU-US-00123
                submission_code: E
                currency_code_local: USD
      responses:
        '201':
          description: تم إنشاء القالب.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportTemplateDetail'
        '400':
          description: >-
            اختصاص قضائي غير معروف، أو فشل field_config في التحقق من الحقول
            الإلزامية.
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: string
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: curl
          label: curl
          source: >-
            curl -X POST
            'https://verification.didit.me/v3/organization/11111111-2222-3333-4444-555555555555/application/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/report-templates/'
            \
              -H 'x-api-key: YOUR_API_KEY' \
              -H 'Content-Type: application/json' \
              -d '{"name": "US SAR default", "jurisdiction": "US", "report_type": "SAR", "field_config": {"rentity_id": "FIU-US-00123", "submission_code": "E", "currency_code_local": "USD"}}'
        - lang: python
          label: Python
          source: |-
            from didit import Didit

            # Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID
            # and DIDIT_APPLICATION_ID.
            client = Didit()

            result = client.report_templates.create(
                name="US SAR default",
                jurisdiction="US",
                report_type="SAR",
                field_config={"rentity_id": "FIU-US-00123", "submission_code": "E", "currency_code_local": "USD"},
            )
            print(result)
        - lang: javascript
          label: Node.js
          source: |-
            import Didit from "@didit-protocol/sdk-node";

            // Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID
            // and DIDIT_APPLICATION_ID.
            const didit = new Didit();

            const result = await didit.reportTemplates.create({
              name: "US SAR default",
              jurisdiction: "US",
              report_type: "SAR",
              field_config: { rentity_id: "FIU-US-00123", submission_code: "E", currency_code_local: "USD" },
            });
            console.log(result);
        - lang: go
          label: Go
          source: "ctx := context.Background()\n// Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID\n// and DIDIT_APPLICATION_ID.\nclient := didit.NewClient()\n\nresult, err := client.ReportTemplates.Create(ctx, didit.ReportTemplatesCreateParams{\n\tName:         \"US SAR default\",\n\tJurisdiction: \"US\",\n\tReportType:   \"SAR\",\n\tFieldConfig:  didit.Some(map[string]any{\"rentity_id\": \"FIU-US-00123\", \"submission_code\": \"E\", \"currency_code_local\": \"USD\"}),\n})\nif err != nil {\n\tlog.Fatal(err)\n}\nfmt.Printf(\"%+v\\n\", result)"
        - lang: java
          label: Java
          source: >-
            import java.util.Map;

            import me.didit.Didit;

            import me.didit.types.ReportTemplatesCreateParams;


            // Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID

            // and DIDIT_APPLICATION_ID.

            Didit client = new Didit();


            var result =
            client.reportTemplates().create(ReportTemplatesCreateParams.builder()
                    .name("US SAR default")
                    .jurisdiction("US")
                    .reportType(ReportTemplatesCreateParams.ReportType.of("SAR"))
                    .fieldConfig(Map.of("rentity_id", "FIU-US-00123", "submission_code", "E", "currency_code_local", "USD"))
                    .build());
            System.out.println(result);
        - lang: php
          label: PHP
          source: |-
            <?php

            require 'vendor/autoload.php';

            use Didit\DiditClient;

            // Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID
            // and DIDIT_APPLICATION_ID.
            $didit = new DiditClient();

            $result = $didit->reportTemplates->create([
                'name' => 'US SAR default',
                'jurisdiction' => 'US',
                'report_type' => 'SAR',
                'field_config' => ['rentity_id' => 'FIU-US-00123', 'submission_code' => 'E', 'currency_code_local' => 'USD'],
            ]);
            print_r($result->toArray());
        - lang: ruby
          label: Ruby
          source: |-
            require "didit"

            # Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID
            # and DIDIT_APPLICATION_ID.
            didit = Didit::Client.new

            result = didit.report_templates.create(
              name: "US SAR default",
              jurisdiction: "US",
              report_type: "SAR",
              field_config: { rentity_id: "FIU-US-00123", submission_code: "E", currency_code_local: "USD" }
            )
            puts result.to_h
        - lang: csharp
          label: .NET
          source: >-
            using System;

            using System.Collections.Generic;

            using System.Text.Json;

            using Didit;


            // Reads DIDIT_API_KEY, DIDIT_ORGANIZATION_ID

            // and DIDIT_APPLICATION_ID.

            using var client = new DiditClient();


            var result = await client.ReportTemplates.CreateAsync(new
            ReportTemplatesCreateParams

            {
                Name = "US SAR default",
                Jurisdiction = "US",
                ReportType = "SAR",
                FieldConfig = new Dictionary<string, object> { ["rentity_id"] = "FIU-US-00123", ["submission_code"] = "E", ["currency_code_local"] = "USD" },
            });

            Console.WriteLine(JsonSerializer.Serialize(result));
components:
  schemas:
    ReportTemplateDetail:
      type: object
      properties:
        uuid:
          type: string
          format: uuid
        name:
          type: string
        jurisdiction:
          type: string
          minLength: 2
          maxLength: 2
          description: رمز الدولة وفقاً لـ ISO 3166-1 alpha-2.
        report_type:
          type: string
          enum:
            - SAR
            - STR
            - CTR
            - TTR
            - UTR
            - IFT
            - CBR
            - TFR
        report_type_display:
          type: string
        field_config:
          type: object
          description: >-
            القيم الافتراضية القابلة لإعادة الاستخدام لرأس goAML. الحقول
            الإلزامية على مستوى القالب: rentity_id، وsubmission_code،
            وcurrency_code_local (من 3 أحرف). الحقول الاختيارية: enabled_fields
            (أقسام التقرير الاختيارية المطلوب تضمينها) بالإضافة إلى القيم
            الافتراضية لكل من reporting_person، وlocation، وreason، وaction. يتم
            فرض حقول الرأس الخاصة بكل ملف تقديم (action، وsubmission_date،
            وtransactions، وjurisdiction) عند التحقق من صحة التقرير أو إتمامه
            نهائياً، وليس على مستوى القالب.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  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.