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

# Search Pep

> Search for Politically Exposed Persons (PEP) matches by name.



## OpenAPI

````yaml /api-reference/openapi.json post /pep/searches
openapi: 3.1.0
info:
  title: baselayer-api-service
  version: 0.1.0
servers:
  - url: https://api.baselayer.com/
security: []
paths:
  /pep/searches:
    post:
      tags:
        - PEP
      summary: Search Pep
      description: Search for Politically Exposed Persons (PEP) matches by name.
      operationId: search_pep_pep_searches_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1.PEPSearchRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1.PEPSearchResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    v1.PEPSearchRequest:
      properties:
        name:
          type: string
          title: Name
          description: The name to search for in the PEP database
        similarity_threshold:
          type: number
          maximum: 1
          minimum: 0
          title: Similarity Threshold
          description: Similarity threshold for the search (0.0 to 1.0). Defaults to 0.9.
          default: 0.9
        limit:
          type: integer
          maximum: 50
          minimum: 1
          title: Limit
          description: The number of results to return. Max 50. Defaults to 1.
          default: 1
      additionalProperties: false
      type: object
      required:
        - name
      title: PEPSearchRequest (v1)
      description: |-
        Request model for PEP search operations.

        This model defines the structure for PEP search API requests.
    v1.PEPSearchResponse:
      properties:
        matches:
          items:
            $ref: '#/components/schemas/v1.PEPMatch'
          type: array
          title: Matches
          description: The list of PEP matches.
          default: []
        total_matches:
          type: integer
          title: Total Matches
          description: The total number of PEP matches.
          examples:
            - 1
            - 2
            - 3
      type: object
      required:
        - total_matches
      title: PEPSearchResponse (v1)
      description: |-
        Response model for PEP search operations.

        This model defines the structure for PEP search API responses.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    v1.PEPMatch:
      properties:
        name:
          type: string
          title: Name
          description: The primary name of the PEP entity.
          examples:
            - John Doe
            - Acme Corporation
        alternative_names:
          items:
            type: string
          type: array
          title: Alternative Names
          description: Alternative names associated with the PEP entity.
          default: []
          examples:
            - - Johnny D.
              - Acme Inc.
        addresses:
          items:
            type: string
          type: array
          title: Addresses
          description: Addresses associated with the PEP entity.
          default: []
          examples:
            - - 123 Main St, Anytown
              - 456 Business Ave, Metropolis
        similarity_score:
          type: number
          maximum: 1
          minimum: 0
          title: Similarity Score
          description: >-
            The similarity score between the search term and the matched entity
            name/aliases.
          examples:
            - 0.9
            - 0.95
            - 1
        record_type:
          anyOf:
            - $ref: '#/components/schemas/PEPRecordType'
            - type: 'null'
          description: Type of the record (e.g., PERSON, ORGANIZATION).
          examples:
            - PERSON
            - ORGANIZATION
        gender:
          anyOf:
            - $ref: '#/components/schemas/Gender'
            - type: 'null'
          description: Gender of the person.
          examples:
            - M
            - F
        date_of_birth:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Date Of Birth
          description: Date of birth for individuals.
          examples:
            - '1980-01-15'
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
          description: First name of the person, when broken out by the source.
          examples:
            - John
        middle_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Middle Name
          description: Middle name of the person, when broken out by the source.
          examples:
            - Fitzgerald
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
          description: Last name of the person, when broken out by the source.
          examples:
            - Doe
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
          description: Honorific title of the person.
          examples:
            - Dr.
        classification:
          anyOf:
            - type: string
            - type: 'null'
          title: Classification
          description: PEP tier classification from the source dataset.
          examples:
            - National government (current)
        political_party:
          anyOf:
            - type: string
            - type: 'null'
          title: Political Party
          description: Political party affiliation.
          examples:
            - Independent
        birth_place:
          anyOf:
            - type: string
            - type: 'null'
          title: Birth Place
          description: Place (or country) of birth.
          examples:
            - Springfield, Illinois
        death_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Death Date
          description: Date of death, if the person is deceased.
          examples:
            - '2021-06-04'
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
          description: Free-text notes or biography from the source dataset.
        wikidata_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Wikidata Id
          description: Public Wikidata QID of the person, useful for disambiguation.
          examples:
            - Q7747
        positions:
          items:
            $ref: '#/components/schemas/PEPPosition'
          type: array
          title: Positions
          description: Positions (occupancies) held by the person.
        risks:
          items:
            $ref: '#/components/schemas/PEPRiskCategory'
          type: array
          title: Risks
          description: Associated risk categories.
          default: []
          examples:
            - - GOVERNMENT_EXECUTIVE
              - GOVERNMENT_FINANCIAL
        associated_countries:
          items:
            $ref: '#/components/schemas/ISO2CountryCode'
          type: array
          title: Associated Countries
          description: ISO2 country codes associated with the entity.
          default: []
          examples:
            - - US
              - GB
        emails:
          items:
            type: string
          type: array
          title: Emails
          description: Email addresses associated with the entity.
          default: []
          examples:
            - - john.doe@example.com
        phone_numbers:
          items:
            type: string
          type: array
          title: Phone Numbers
          description: Phone numbers associated with the entity.
          default: []
          examples:
            - - +1-215-555-1234
        websites:
          items:
            type: string
          type: array
          title: Websites
          description: Websites associated with the entity.
          default: []
          examples:
            - - https://www.acme.com
        source_links:
          items:
            type: string
          type: array
          title: Source Links
          description: Links to source information.
          default: []
          examples:
            - - https://news.example.com/article/123
      type: object
      required:
        - name
        - similarity_score
      title: PEPMatch (v1)
      description: |-
        Response model for a single PEP match.

        This model defines the structure for individual PEP match data.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    PEPRecordType:
      type: string
      enum:
        - PERSON
        - ORGANIZATION
      title: PEPRecordType
      description: >-
        Enumeration of record types associated with Politically Exposed Persons
        (PEPs).

        Derived from the types used in the PEP data source.
    Gender:
      enum:
        - M
        - F
      title: Gender
      type: string
    PEPPosition:
      properties:
        name:
          type: string
          title: Name
          description: The name of the position held.
          examples:
            - Member of the National Assembly
        country:
          anyOf:
            - $ref: '#/components/schemas/ISO2CountryCode'
            - type: 'null'
          description: ISO2 country code of the office held.
          examples:
            - FR
        subnational_area:
          anyOf:
            - type: string
            - type: 'null'
          title: Subnational Area
          description: State, province, or region of the office held.
          examples:
            - California
        categories:
          items:
            $ref: '#/components/schemas/PEPRiskCategory'
          type: array
          title: Categories
          description: Risk categories associated with the position.
          examples:
            - - GOVERNMENT_LEGISLATIVE
              - GOVERNMENT_NATIONAL
        start_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Start Date
          description: Date the person assumed the position.
          examples:
            - '2019-05-20'
        end_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: End Date
          description: Date the person left the position.
          examples:
            - '2023-01-31'
        status:
          anyOf:
            - $ref: '#/components/schemas/PEPPositionStatus'
            - type: 'null'
          description: Whether the position is currently held.
          examples:
            - CURRENT
      type: object
      required:
        - name
      title: PEPPosition
      description: |-
        A position (occupancy) held by a politically exposed person, from the
        OpenSanctions PEP dataset. Stored on ``PEPEntity.positions`` (JSONB) and
        surfaced verbatim in PEP search results.
    PEPRiskCategory:
      type: string
      enum:
        - GOVERNMENT_EXECUTIVE
        - GOVERNMENT_FINANCIAL
        - GOVERNMENT_HEAD
        - INTERGOVERNMENTAL_ORGANIZATION
        - GOVERNMENT_JUDICIAL
        - GOVERNMENT_LEGISLATIVE
        - GOVERNMENT_MUNICIPAL
        - GOVERNMENT_NATIONAL
        - GOVERNMENT_SECURITY
        - STATE_OWNED_ENTERPRISE
        - STATE_GOVERNMENT
        - MILITARY
        - PERSON_OF_INTEREST
        - POLITICAL_PARTY
        - DIPLOMAT
        - JUDGE
        - POLITICALLY_EXPOSED_PERSON
        - RELATIVES_OR_CLOSE_ASSOCIATES
        - WANTED
      title: PEPRiskCategory
      description: >-
        Enumeration of risk categories associated with Politically Exposed
        Persons (PEPs).

        Derived from the categories used in the PEP data source.
    ISO2CountryCode:
      description: |-
        Enumeration of ISO 3166-1 alpha-2 country codes.

        Attributes:
            (Various country codes like Andorra = "AD", etc.)
      enum:
        - AD
        - AE
        - AF
        - AG
        - AI
        - AL
        - AM
        - AO
        - AQ
        - AR
        - AS
        - AT
        - AU
        - AW
        - AX
        - AZ
        - BA
        - BB
        - BD
        - BE
        - BF
        - BG
        - BH
        - BI
        - BJ
        - BL
        - BM
        - BN
        - BO
        - BQ
        - BR
        - BS
        - BT
        - BV
        - BW
        - BY
        - BZ
        - CA
        - CC
        - CD
        - CF
        - CG
        - CH
        - CI
        - CK
        - CL
        - CM
        - CN
        - CO
        - CR
        - CU
        - CV
        - CW
        - CX
        - CY
        - CZ
        - DE
        - DJ
        - DK
        - DM
        - DO
        - DZ
        - EC
        - EE
        - EG
        - EH
        - ER
        - ES
        - ET
        - FI
        - FJ
        - FK
        - FM
        - FO
        - FR
        - GA
        - GB
        - GD
        - GE
        - GF
        - GG
        - GH
        - GI
        - GL
        - GM
        - GN
        - GP
        - GQ
        - GR
        - GS
        - GT
        - GU
        - GW
        - GY
        - HK
        - HM
        - HN
        - HR
        - HT
        - HU
        - ID
        - IE
        - IL
        - IM
        - IN
        - IO
        - IQ
        - IR
        - IS
        - IT
        - JE
        - JM
        - JO
        - JP
        - KE
        - KG
        - KH
        - KI
        - KM
        - KN
        - KP
        - KR
        - KW
        - KY
        - KZ
        - LA
        - LB
        - LC
        - LI
        - LK
        - LR
        - LS
        - LT
        - LU
        - LV
        - LY
        - MA
        - MC
        - MD
        - ME
        - MF
        - MG
        - MH
        - MK
        - ML
        - MM
        - MN
        - MO
        - MP
        - MQ
        - MR
        - MS
        - MT
        - MU
        - MV
        - MW
        - MX
        - MY
        - MZ
        - NA
        - NC
        - NE
        - NF
        - NG
        - NI
        - NL
        - 'NO'
        - NP
        - NR
        - NU
        - NZ
        - OM
        - PA
        - PE
        - PF
        - PG
        - PH
        - PK
        - PL
        - PM
        - PN
        - PR
        - PS
        - PT
        - PW
        - PY
        - QA
        - RE
        - RO
        - RS
        - RU
        - RW
        - SA
        - SB
        - SC
        - SD
        - SE
        - SG
        - SH
        - SI
        - SJ
        - SK
        - SL
        - SM
        - SN
        - SO
        - SR
        - SS
        - ST
        - SV
        - SX
        - SY
        - SZ
        - TC
        - TD
        - TF
        - TG
        - TH
        - TJ
        - TK
        - TL
        - TM
        - TN
        - TO
        - TR
        - TT
        - TV
        - TW
        - TZ
        - UA
        - UG
        - UM
        - US
        - UY
        - UZ
        - VA
        - VC
        - VE
        - VG
        - VI
        - VN
        - VU
        - WF
        - WS
        - XK
        - YE
        - YT
        - ZA
        - ZM
        - ZW
      title: ISO2CountryCode
      type: string
    PEPPositionStatus:
      type: string
      enum:
        - CURRENT
        - ENDED
        - UNKNOWN
      title: PEPPositionStatus
      description: |-
        Whether a PEP currently holds a position, per the OpenSanctions
        occupancy `status` values (current / ended / unknown).
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````