# Add whitelist entries

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /whitelist/:
    post:
      summary: Add whitelist entries
      deprecated: false
      description: >-

        Adds one or more users to the onboarding whitelist.


        Each user must be identified by exactly one of:

        - **national_id**: Saudi national ID (10 digits)

        - **external_reference**: Your own reference for the user


        Send an optional `idempotency-key` header to make the request safely

        retryable — repeating the same key returns the original result.


        **How to read the response:**


        - **200 OK**: your request was processed. Check `summary.success` and
          `summary.fail`, and review `failed_records` for any entries that could
          not be added (e.g. invalid identifier, already whitelisted). A 200 does
          **not** mean every entry was added — always inspect the summary.
        - **4xx / 5xx**: your request could not be processed at all. Common
        reasons
          are an invalid request body, missing permissions, or a temporary service
          outage. The body contains `error_code`, `error_message`, and `details`.
          You can safely retry 5xx responses.
                    
      operationId: addWhitelistEntries
      tags:
        - Vrtx APIs/Whitelist
        - Whitelist
      parameters:
        - name: idempotency-key
          in: header
          description: A unique key to ensure idempotent requests.
          required: false
          example: ''
          schema:
            type: string
            minLength: 1
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                users:
                  type: array
                  items:
                    type: object
                    properties:
                      national_id:
                        type: string
                        description: National ID of the user
                        examples:
                          - '1234567890'
                      external_reference:
                        type: string
                        description: External reference of the user
                        examples:
                          - ext-ref-001
                    x-apidog-orders:
                      - national_id
                      - external_reference
                  minItems: 1
                  description: List of users to add to the whitelist
              required:
                - users
              x-apidog-orders:
                - users
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  report_status:
                    type: string
                    description: Overall status of the operation
                    examples:
                      - PARTIAL_SUCCESS
                  message:
                    type: string
                    description: Human-readable message
                    examples:
                      - 2 of 3 entries added successfully
                  summary:
                    type: object
                    properties:
                      total:
                        type: number
                        description: Total entries processed
                      success:
                        type: number
                        description: Successfully added entries
                      fail:
                        type: number
                        description: Failed entries
                    required:
                      - total
                      - success
                      - fail
                    x-apidog-orders:
                      - total
                      - success
                      - fail
                  failed_records:
                    type: array
                    items:
                      type: object
                      properties:
                        national_id:
                          type: string
                          description: National ID of the failed entry
                        external_reference:
                          type: string
                          description: External reference of the failed entry
                        error:
                          type: string
                          description: Error message for the failed entry
                      required:
                        - error
                      x-apidog-orders:
                        - national_id
                        - external_reference
                        - error
                    description: List of entries that failed to be added
                required:
                  - report_status
                  - message
                  - summary
                  - failed_records
                x-apidog-orders:
                  - report_status
                  - message
                  - summary
                  - failed_records
          headers: {}
          x-apidog-name: ''
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - INVALID_INPUT
                      - WHITELIST_OPERATION_FAILED
                  error_message:
                    type: string
                    description: Human-readable error message explaining what went wrong
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        field_name:
                          type: string
                          description: Name of the field that caused the error
                        description:
                          type: string
                          description: Detailed description of the field error
                        code:
                          type: string
                          description: Optional error code specific to this field
                      required:
                        - field_name
                        - description
                      x-apidog-orders:
                        - field_name
                        - description
                        - code
                    description: >-
                      Additional error details and field-specific validation
                      errors
                  status_code:
                    type: number
                    description: HTTP status code corresponding to this error
                required:
                  - error_code
                  - error_message
                  - details
                  - status_code
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
          headers: {}
          x-apidog-name: ''
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - UNAUTHORIZED
                  error_message:
                    type: string
                    description: Human-readable error message explaining what went wrong
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        field_name:
                          type: string
                          description: Name of the field that caused the error
                        description:
                          type: string
                          description: Detailed description of the field error
                        code:
                          type: string
                          description: Optional error code specific to this field
                      required:
                        - field_name
                        - description
                      x-apidog-orders:
                        - field_name
                        - description
                        - code
                    description: >-
                      Additional error details and field-specific validation
                      errors
                  status_code:
                    type: number
                    description: HTTP status code corresponding to this error
                required:
                  - error_code
                  - error_message
                  - details
                  - status_code
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: UNAUTHORIZED
                error_message: Unauthorized access
                details: []
                status_code: 401
          headers: {}
          x-apidog-name: ''
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - FORBIDDEN
                  error_message:
                    type: string
                    description: Human-readable error message explaining what went wrong
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        field_name:
                          type: string
                          description: Name of the field that caused the error
                        description:
                          type: string
                          description: Detailed description of the field error
                        code:
                          type: string
                          description: Optional error code specific to this field
                      required:
                        - field_name
                        - description
                      x-apidog-orders:
                        - field_name
                        - description
                        - code
                    description: >-
                      Additional error details and field-specific validation
                      errors
                  status_code:
                    type: number
                    description: HTTP status code corresponding to this error
                required:
                  - error_code
                  - error_message
                  - details
                  - status_code
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: FORBIDDEN
                error_message: Access forbidden
                details: []
                status_code: 403
          headers: {}
          x-apidog-name: ''
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - NOT_FOUND
                  error_message:
                    type: string
                    description: Human-readable error message explaining what went wrong
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        field_name:
                          type: string
                          description: Name of the field that caused the error
                        description:
                          type: string
                          description: Detailed description of the field error
                        code:
                          type: string
                          description: Optional error code specific to this field
                      required:
                        - field_name
                        - description
                      x-apidog-orders:
                        - field_name
                        - description
                        - code
                    description: >-
                      Additional error details and field-specific validation
                      errors
                  status_code:
                    type: number
                    description: HTTP status code corresponding to this error
                required:
                  - error_code
                  - error_message
                  - details
                  - status_code
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: NOT_FOUND
                error_message: Resource not found
                details: []
                status_code: 404
          headers: {}
          x-apidog-name: ''
        '405':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - INVALID_INPUT
                  error_message:
                    type: string
                    description: Human-readable error message explaining what went wrong
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        field_name:
                          type: string
                          description: Name of the field that caused the error
                        description:
                          type: string
                          description: Detailed description of the field error
                        code:
                          type: string
                          description: Optional error code specific to this field
                      required:
                        - field_name
                        - description
                      x-apidog-orders:
                        - field_name
                        - description
                        - code
                    description: >-
                      Additional error details and field-specific validation
                      errors
                  status_code:
                    type: number
                    description: HTTP status code corresponding to this error
                required:
                  - error_code
                  - error_message
                  - details
                  - status_code
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: INVALID_INPUT
                error_message: Input validation failed
                details: []
                status_code: 405
          headers: {}
          x-apidog-name: ''
        '409':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - CONFLICT
                      - WHITELIST_ENTRY_ALREADY_EXISTS
                  error_message:
                    type: string
                    description: Human-readable error message explaining what went wrong
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        field_name:
                          type: string
                          description: Name of the field that caused the error
                        description:
                          type: string
                          description: Detailed description of the field error
                        code:
                          type: string
                          description: Optional error code specific to this field
                      required:
                        - field_name
                        - description
                      x-apidog-orders:
                        - field_name
                        - description
                        - code
                    description: >-
                      Additional error details and field-specific validation
                      errors
                  status_code:
                    type: number
                    description: HTTP status code corresponding to this error
                required:
                  - error_code
                  - error_message
                  - details
                  - status_code
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: CONFLICT
                error_message: Resource conflict
                details: []
                status_code: 409
          headers: {}
          x-apidog-name: ''
        '410':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - NOT_FOUND
                  error_message:
                    type: string
                    description: Human-readable error message explaining what went wrong
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        field_name:
                          type: string
                          description: Name of the field that caused the error
                        description:
                          type: string
                          description: Detailed description of the field error
                        code:
                          type: string
                          description: Optional error code specific to this field
                      required:
                        - field_name
                        - description
                      x-apidog-orders:
                        - field_name
                        - description
                        - code
                    description: >-
                      Additional error details and field-specific validation
                      errors
                  status_code:
                    type: number
                    description: HTTP status code corresponding to this error
                required:
                  - error_code
                  - error_message
                  - details
                  - status_code
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: NOT_FOUND
                error_message: Resource not found
                details: []
                status_code: 410
          headers: {}
          x-apidog-name: ''
        '422':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - INVALID_INPUT
                  error_message:
                    type: string
                    description: Human-readable error message explaining what went wrong
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        field_name:
                          type: string
                          description: Name of the field that caused the error
                        description:
                          type: string
                          description: Detailed description of the field error
                        code:
                          type: string
                          description: Optional error code specific to this field
                      required:
                        - field_name
                        - description
                      x-apidog-orders:
                        - field_name
                        - description
                        - code
                    description: >-
                      Additional error details and field-specific validation
                      errors
                  status_code:
                    type: number
                    description: HTTP status code corresponding to this error
                required:
                  - error_code
                  - error_message
                  - details
                  - status_code
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: INVALID_INPUT
                error_message: Input validation failed
                details:
                  - field_name: amount
                    description: Amount must be greater than zero
                    code: VALIDATION_ERROR
                status_code: 422
          headers: {}
          x-apidog-name: ''
        '429':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - RATE_LIMITED
                  error_message:
                    type: string
                    description: Human-readable error message explaining what went wrong
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        field_name:
                          type: string
                          description: Name of the field that caused the error
                        description:
                          type: string
                          description: Detailed description of the field error
                        code:
                          type: string
                          description: Optional error code specific to this field
                      required:
                        - field_name
                        - description
                      x-apidog-orders:
                        - field_name
                        - description
                        - code
                    description: >-
                      Additional error details and field-specific validation
                      errors
                  status_code:
                    type: number
                    description: HTTP status code corresponding to this error
                required:
                  - error_code
                  - error_message
                  - details
                  - status_code
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: RATE_LIMITED
                error_message: Too many requests
                details: []
                status_code: 429
          headers: {}
          x-apidog-name: ''
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - INTERNAL_ERROR
                      - EXTERNAL_SERVICE_ERROR
                  error_message:
                    type: string
                    description: Human-readable error message explaining what went wrong
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        field_name:
                          type: string
                          description: Name of the field that caused the error
                        description:
                          type: string
                          description: Detailed description of the field error
                        code:
                          type: string
                          description: Optional error code specific to this field
                      required:
                        - field_name
                        - description
                      x-apidog-orders:
                        - field_name
                        - description
                        - code
                    description: >-
                      Additional error details and field-specific validation
                      errors
                  status_code:
                    type: number
                    description: HTTP status code corresponding to this error
                required:
                  - error_code
                  - error_message
                  - details
                  - status_code
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              examples:
                example1:
                  summary: example1
                  value:
                    error_code: INTERNAL_ERROR
                    error_message: An internal server error occurred
                    details: []
                    status_code: 500
                example2:
                  summary: example2
                  value:
                    error_code: EXTERNAL_SERVICE_ERROR
                    error_message: An external service error occurred
                    details: []
                    status_code: 500
          headers: {}
          x-apidog-name: ''
        '501':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - INTERNAL_ERROR
                  error_message:
                    type: string
                    description: Human-readable error message explaining what went wrong
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        field_name:
                          type: string
                          description: Name of the field that caused the error
                        description:
                          type: string
                          description: Detailed description of the field error
                        code:
                          type: string
                          description: Optional error code specific to this field
                      required:
                        - field_name
                        - description
                      x-apidog-orders:
                        - field_name
                        - description
                        - code
                    description: >-
                      Additional error details and field-specific validation
                      errors
                  status_code:
                    type: number
                    description: HTTP status code corresponding to this error
                required:
                  - error_code
                  - error_message
                  - details
                  - status_code
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: INTERNAL_ERROR
                error_message: An internal server error occurred
                details: []
                status_code: 501
          headers: {}
          x-apidog-name: ''
        '503':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - SERVICE_UNAVAILABLE
                      - EXTERNAL_SERVICE_ERROR
                  error_message:
                    type: string
                    description: Human-readable error message explaining what went wrong
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        field_name:
                          type: string
                          description: Name of the field that caused the error
                        description:
                          type: string
                          description: Detailed description of the field error
                        code:
                          type: string
                          description: Optional error code specific to this field
                      required:
                        - field_name
                        - description
                      x-apidog-orders:
                        - field_name
                        - description
                        - code
                    description: >-
                      Additional error details and field-specific validation
                      errors
                  status_code:
                    type: number
                    description: HTTP status code corresponding to this error
                required:
                  - error_code
                  - error_message
                  - details
                  - status_code
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: EXTERNAL_SERVICE_ERROR
                error_message: An external service error occurred
                details: []
                status_code: 503
          headers: {}
          x-apidog-name: ''
        '504':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - EXTERNAL_SERVICE_ERROR
                  error_message:
                    type: string
                    description: Human-readable error message explaining what went wrong
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        field_name:
                          type: string
                          description: Name of the field that caused the error
                        description:
                          type: string
                          description: Detailed description of the field error
                        code:
                          type: string
                          description: Optional error code specific to this field
                      required:
                        - field_name
                        - description
                      x-apidog-orders:
                        - field_name
                        - description
                        - code
                    description: >-
                      Additional error details and field-specific validation
                      errors
                  status_code:
                    type: number
                    description: HTTP status code corresponding to this error
                required:
                  - error_code
                  - error_message
                  - details
                  - status_code
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: EXTERNAL_SERVICE_ERROR
                error_message: An external service error occurred
                details: []
                status_code: 504
          headers: {}
          x-apidog-name: ''
        '505':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error_code:
                    type: string
                    enum:
                      - UNSUPPORTED_VERSION
                  error_message:
                    type: string
                    description: Human-readable error message explaining what went wrong
                  details:
                    type: array
                    items:
                      type: object
                      properties:
                        field_name:
                          type: string
                          description: Name of the field that caused the error
                        description:
                          type: string
                          description: Detailed description of the field error
                        code:
                          type: string
                          description: Optional error code specific to this field
                      required:
                        - field_name
                        - description
                      x-apidog-orders:
                        - field_name
                        - description
                        - code
                    description: >-
                      Additional error details and field-specific validation
                      errors
                  status_code:
                    type: number
                    description: HTTP status code corresponding to this error
                required:
                  - error_code
                  - error_message
                  - details
                  - status_code
                x-apidog-orders:
                  - error_code
                  - error_message
                  - details
                  - status_code
              example:
                error_code: UNSUPPORTED_VERSION
                error_message: An internal server error occurred
                details: []
                status_code: 500
          headers: {}
          x-apidog-name: ''
      security:
        - bearerAuth: []
          x-apidog:
            schemeGroups:
              - id: l7c8MqsqskcOLNFFvC5v4
                schemeIds:
                  - bearerAuth
            required: true
            use:
              id: l7c8MqsqskcOLNFFvC5v4
            scopes:
              l7c8MqsqskcOLNFFvC5v4:
                bearerAuth: []
      x-apidog-folder: Vrtx APIs/Whitelist
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/1053095/apis/api-32621331-run
components:
  schemas: {}
  securitySchemes:
    bearerAuth:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: Enter your JWT access token for authentication
    bearerAuth1:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
    bearerAuth2:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: Enter your JWT access token for authentication
    bearerAuth3:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT issued by Keycloak. The client_id/azp in the token must map to a
        configured tenant (public, fai, neomrs; e.g., fai-sandbox -> fai) or
        requests will return 403.
    bearerAuth4:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: Enter your JWT access token for authentication
    bearer:
      type: http
      scheme: bearer
servers:
  - url: https://api.sandbox.vrtx.sa
    description: Sandbox
security:
  - bearer: []

```
