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

# Get Search

> Retrieve a name screening search with hits and remediation data



## OpenAPI

````yaml GET /v1/name-screenings/searches/{id}
openapi: 3.0.1
info:
  version: 1.5.0
  title: Diligent
  description: >
    Download Postman collection
    [here](https://docs.godiligent.ai/files/postman_collection.json).
servers:
  - url: https://api.godiligent.ai
    description: Production
  - url: https://api.sandbox.godiligent.ai
    description: Sandbox
security:
  - xApiKey: []
tags:
  - name: CDD
    description: Customer Due Diligence
  - name: Company
    description: Company Information
  - name: Blocked Companies
    description: Manage blocked companies
  - name: Monitorings
    description: Website monitoring and alerts for changes and risks
  - name: Webhooks
    description: >

      ## How to Secure Webhook Deliveries

      To ensure that webhook payloads are securely transmitted and verified.
      This guide explains how to configure and validate

      webhook deliveries using a shared secret.


      ### How It Works


      When setting up a webhook, a secret is configured on both the sender (our
      system) and the receiver (your endpoint). Each

      webhook payload is signed using this secret, allowing the receiver to
      verify its authenticity.


      #### Step 1: Configuring Your Webhook Secret


      1. When creating a webhook in our system, specify a unique secret key.
      This secret should be a strong, randomly

      generated string.

      2. Store this secret securely on your server; it should never be exposed
      publicly.


      #### Step 2: Receiving Webhook Payloads


      When your server receives a webhook event, the request will include an
      `X-Signature` header containing a HMAC signature

      of the payload.


      Example header:


      ```

      X-Signature: sha256=abcdef1234567890...

      ```


      #### Step 3: Validating the Webhook Signature


      To verify the webhook payload:


      1. Retrieve the `X-Signature` value from the request headers.

      2. Compute the HMAC SHA-256 signature of the request payload using your
      webhook secret.

      3. Compare the computed signature with the one in the `X-Signature`
      header.

      4. If they match, the webhook is valid.


      #### (Python)


      ```python

      import hashlib

      import hmac

      import json


      def verify_webhook_signature(secret, payload, signature):
        computed_signature = hmac.new(secret.encode(), payload.encode(), hashlib.sha256).hexdigest()
        expected_signature = f"sha256={computed_signature}"
        return hmac.compare_digest(expected_signature, signature)

      # Example usage:

      secret = "your_webhook_secret"

      payload = json.dumps({"event": "example"})

      received_signature = "sha256=abcdef1234567890..."


      if verify_webhook_signature(secret, payload, received_signature):
        print("Valid webhook received!")
      else:
        print("Invalid webhook signature!")
      ```


      #### (JavaScript)


      ```javascript

      const crypto = require('crypto');


      function verifyWebhookSignature (secret, payload, signature) {

      const computedSignature = `sha256=${crypto.createHmac('sha256', secret)

      .update(payload)

      .digest('hex')}`;

      return crypto.timingSafeEqual(Buffer.from(computedSignature),
      Buffer.from(signature));

      }


      // Example usage:

      const secret = "your_webhook_secret";

      const payload = JSON.stringify({ event: "example" });

      const receivedSignature = "sha256=abcdef1234567890...";


      if (verifyWebhookSignature(secret, payload, receivedSignature)) {

      console.log("Valid webhook received!");

      } else {

      console.log("Invalid webhook signature!");

      }

      ```


      #### Security Considerations


      - Always use HTTPS to prevent interception of webhook payloads.

      - Reject webhook requests that fail signature validation.

      - Rotate secrets periodically to enhance security.


      By following this guide, you ensure that webhook deliveries are secure and
      trusted.
  - name: Instant Screening (experimental)
    description: Instant Website Screening API
  - name: Name Screening
    description: Name screening search, alert management and remediation
paths:
  /v1/name-screenings/searches/{id}:
    get:
      tags:
        - Name Screening
      summary: Get search by ID
      description: Retrieve a name screening search and its associated alerts
      parameters:
        - name: id
          in: path
          required: true
          description: Search ID (UUID)
          schema:
            type: string
            format: uuid
            example: d6e3b214-30b1-4401-a1b8-a1bd3c6a84e4
      responses:
        '200':
          description: Search retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Search'
        '401':
          description: Unauthorized - Invalid or missing API key
        '404':
          description: Search not found
        '500':
          description: Internal Server Error
      security:
        - xApiKey: []
components:
  schemas:
    Search:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Search ID
          example: d6e3b214-30b1-4401-a1b8-a1bd3c6a84e4
        reference:
          type: string
          description: Search reference identifier
          example: CUST-2024-001
        status:
          type: string
          enum:
            - PENDING
            - COMPLETED
            - FAILED
          description: Search status
          example: COMPLETED
        input:
          type: array
          description: Profile fields for the entity being screened
          items:
            $ref: '#/components/schemas/LabelField'
        hit_counts:
          type: object
          description: Count of hits by status
          properties:
            FALSE_POSITIVE:
              type: integer
              description: Number of false positive hits
              example: 2
            TRUE_POSITIVE:
              type: integer
              description: Number of true positive hits
              example: 1
            UNRESOLVED:
              type: integer
              description: Number of unresolved hits
              example: 3
          required:
            - FALSE_POSITIVE
            - TRUE_POSITIVE
            - UNRESOLVED
        hits:
          type: array
          description: Alerts created from this search
          items:
            $ref: '#/components/schemas/Hit'
        created_at:
          type: string
          format: date-time
          description: Search creation timestamp
          example: '2024-10-02T12:00:00Z'
        updated_at:
          type: string
          format: date-time
          description: Search last updated timestamp
          example: '2024-10-02T14:30:00Z'
    LabelField:
      oneOf:
        - $ref: '#/components/schemas/IndividualLabelField'
        - $ref: '#/components/schemas/BusinessLabelField'
    Hit:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Hit ID
          example: d6e3b214-30b1-4401-a1b8-a1bd3c6a84e4
        provider_reference:
          type: string
          description: Hit reference identifier
          example: HIT-001
        provider_url:
          type: string
          description: Hit provider URL
          example: https://example.com/hit-001
        status:
          type: string
          enum:
            - FALSE_POSITIVE
            - TRUE_POSITIVE
            - UNRESOLVED
          description: Hit status
          example: UNRESOLVED
        fields:
          type: array
          description: Hit profile fields
          items:
            $ref: '#/components/schemas/LabelField'
        hit_categories:
          type: array
          description: Categories for this hit
          items:
            type: string
            enum:
              - SANCTION
              - PEP
              - MEDIA
          example:
            - SANCTION
        remediation:
          $ref: '#/components/schemas/HitRemediation'
    IndividualLabelField:
      type: object
      required:
        - label
        - value
      properties:
        label:
          type: string
          enum:
            - first_name
            - last_name
            - full_name
            - entity_type
            - date_of_birth
            - place_of_birth
            - country_code
          description: >-
            Field label for individual entity. Note: Labels are normalized to
            uppercase internally
          example: full_name
        value:
          type: string
          description: Field value. For date_of_birth, format must be YYYY-MM-DD
          example: John Doe
    BusinessLabelField:
      type: object
      required:
        - label
        - value
      properties:
        label:
          type: string
          enum:
            - name
            - entity_type
            - country_code
            - company_identifier
          description: >-
            Field label for business entity. Note: Labels are normalized to
            uppercase internally
          example: name
        value:
          type: string
          description: Field value
          example: Acme Corporation
    HitRemediation:
      type: object
      required:
        - sync_status
        - determination
        - action
        - status
        - action_taken
        - determined_at
        - author
        - summary
      properties:
        sync_status:
          type: string
          enum:
            - PENDING
            - SYNCED
            - NOTHING
          description: >-
            Workflow sync status - indicates if resolution has been synced with
            provider
          example: SYNCED
        determination:
          type: string
          enum:
            - FALSE_POSITIVE
            - TRUE_POSITIVE
            - UNRESOLVED
          description: >-
            Hit determination - whether this is a true match, false positive, or
            unresolved
          example: FALSE_POSITIVE
        action:
          type: string
          description: Internal action enum indicating the specific action taken
          example: SET_AS_FALSE_POSITIVE
        status:
          type: string
          enum:
            - FALSE_POSITIVE
            - TRUE_POSITIVE
            - UNRESOLVED
          description: 'DEPRECATED: Use ''determination'' instead'
          example: FALSE_POSITIVE
          deprecated: true
        action_taken:
          type: string
          enum:
            - NONE
            - COMMENTED
            - RESOLVED
          description: >-
            DEPRECATED: Use 'action' instead. Simplified action taken during
            resolution
          example: RESOLVED
          deprecated: true
        determined_at:
          type: string
          format: date-time
          description: When the resolution was determined
          example: '2024-01-15T10:30:00Z'
        author:
          type: string
          enum:
            - DILIGENT
            - CLIENT
            - PROVIDER
          description: Who or what determined the resolution
          example: DILIGENT
        summary:
          type: string
          description: Resolution summary
          example: No match - different person
  securitySchemes:
    xApiKey:
      type: apiKey
      name: X-API-KEY
      in: header

````