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

# Create a Lead

> Create a Lead




## OpenAPI

````yaml open-finance-api/yaml/uae-product-openapi.yaml post /leads
openapi: 3.0.0
info:
  title: UAE Product API
  description: UAE Open Finance Product API Specification
  version: v1.2
  contact:
    email: openfinance@cbuae.gov.ae
servers:
  - url: /open-finance/product/v1.2
security: []
tags:
  - name: Products
    description: Product resource
  - name: Leads
    description: Lead resource
paths:
  /leads:
    post:
      tags:
        - Leads
      summary: Create a Lead
      description: |
        Create a Lead
      operationId: CreateLead
      parameters:
        - $ref: '#/components/parameters/Authorization'
      requestBody:
        description: |
          Request Body
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LeadRequest'
      responses:
        '201':
          $ref: '#/components/responses/201LeadResponse'
        '400':
          $ref: '#/components/responses/400Error'
        '401':
          $ref: '#/components/responses/401Error'
        '403':
          $ref: '#/components/responses/403Error'
        '405':
          $ref: '#/components/responses/405Error'
        '406':
          $ref: '#/components/responses/406Error'
        '415':
          $ref: '#/components/responses/415Error'
        '429':
          $ref: '#/components/responses/429Error'
        '500':
          $ref: '#/components/responses/500Error'
      security:
        - TPPOAuth2Security:
            - products
components:
  parameters:
    Authorization:
      name: authorization
      in: header
      required: true
      description: An authorization Token as per https://tools.ietf.org/html/rfc6750
      schema:
        type: string
  schemas:
    LeadRequest:
      type: object
      additionalProperties: false
      description: |
        The request to create a lead.
      required:
        - Data
      properties:
        Data:
          type: object
          additionalProperties: false
          description: |
            The data for the lead request.
          required:
            - Name
            - Email
          properties:
            Email:
              type: string
              format: email
              description: Email address of the account holder
            PhoneNumber:
              type: string
              pattern: ^\+[1-9]\d{1,14}$
              description: Phone number in E.164 format
            Name:
              $ref: '#/components/schemas/AEUserName'
            EmiratesId:
              type: string
              description: Emirates ID number of the Party
            Nationality:
              type: string
              description: Nationality of the Party
            ResidentialAddress:
              $ref: '#/components/schemas/AEPartyIdentityAddressClaim'
            LeadInformation:
              type: string
            ProductCategories:
              type: array
              items:
                type: object
                properties:
                  Type:
                    type: string
                    enum:
                      - SavingsAccount
                      - CurrentAccount
                      - CreditCard
                      - Loan
                      - Mortgage
    AEUserName:
      oneOf:
        - $ref: '#/components/schemas/AEPersonalAccountName'
        - $ref: '#/components/schemas/AEPersonalAccountFullName'
        - $ref: '#/components/schemas/AEBusinessAccountName'
      description: |
        The name of the account holder.
    AEPartyIdentityAddressClaim:
      type: object
      properties:
        AddressLine:
          type: array
          items:
            description: >-
              Information that locates and identifies a specific address, as
              defined by postal services, presented in free format text. This
              may be duplicated in other fields in the address object.
            type: string
            minLength: 1
            maxLength: 70
          minItems: 0
          maxItems: 7
        Locality:
          type: string
          description: >
            The address locality (village, town, city etc) claim that has been
            verified.
        Region:
          type: string
          description: |
            The address region claim that has been verified.
        PostalCode:
          $ref: '#/components/schemas/PostalCode'
        Country:
          $ref: '#/components/schemas/CountryCode'
      description: >
        Address object as per OpenID Connect Core 1.0 Address Claim

        [https://openid.net/specs/openid-connect-core-1_0.html#AddressClaim](https://openid.net/specs/openid-connect-core-1_0.html#AddressClaim)
      additionalProperties: false
    LeadResponse:
      type: object
      additionalProperties: false
      required:
        - Data
      properties:
        Data:
          type: object
          description: |
            The data for the lead response.
          additionalProperties: false
          required:
            - LeadId
            - Name
            - Email
          properties:
            LeadId:
              type: string
              description: Unique identifier for the lead
            Email:
              type: string
              format: email
              description: Email address of the account holder
            PhoneNumber:
              type: string
              pattern: ^\+[1-9]\d{1,14}$
              description: Phone number in E.164 format
            Name:
              $ref: '#/components/schemas/AEUserName'
            EmiratesId:
              type: string
              description: Emirates ID number of the Party
            Nationality:
              type: string
            ResidentialAddress:
              $ref: '#/components/schemas/AEPartyIdentityAddressClaim'
            LeadInformation:
              type: string
            ProductCategories:
              type: array
              items:
                type: object
                properties:
                  Type:
                    type: string
                    enum:
                      - SavingsAccount
                      - CurrentAccount
                      - CreditCard
                      - Loan
                      - Mortgage
    AEErrorResponse:
      type: object
      required:
        - Errors
      properties:
        Errors:
          type: array
          items:
            $ref: '#/components/schemas/AEError'
          minItems: 1
      description: >-
        An array of detail error codes, and messages, and URLs to documentation
        to help remediation.
      additionalProperties: false
    AEPersonalAccountName:
      type: object
      required:
        - GivenName
        - LastName
      properties:
        GivenName:
          type: string
          minLength: 1
          maxLength: 70
          description: The given or first name of the lead
        LastName:
          type: string
          minLength: 1
          maxLength: 70
          description: The family or surname of the lead
      description: The name of a personal account
      additionalProperties: false
    AEPersonalAccountFullName:
      type: object
      required:
        - FullName
      properties:
        FullName:
          type: string
          minLength: 1
          maxLength: 140
          description: The full name of the lead
      description: The full name of a personal account
      additionalProperties: false
    AEBusinessAccountName:
      type: object
      required:
        - BusinessName
      properties:
        BusinessName:
          type: string
          minLength: 1
          maxLength: 140
          description: The business name of the lead
      description: The name of a business account
      additionalProperties: false
    PostalCode:
      type: object
      required:
        - PostalCode
      properties:
        PostalCode:
          type: string
          minLength: 5
          maxLength: 5
          description: >-
            Identifier consisting of a group of letters and/or numbers that is
            added to a postal address to assist the sorting of mail.
    CountryCode:
      type: object
      required:
        - CountryCode
      properties:
        CountryCode:
          type: string
          pattern: ^[A-Z]{2,2}$
          description: Nation with its own government, occupying a particular territory.
      additionalProperties: false
    AEError:
      type: object
      required:
        - Code
        - Message
      properties:
        Code:
          allOf:
            - $ref: '#/components/schemas/AEErrorCode'
          description: Low level textual error code, e.g., Field.Missing
        Message:
          type: string
          minLength: 1
          maxLength: 500
          description: >-
            A description of the error that occurred. e.g., 'A mandatory field
            isn't supplied' or 'RequestedExecutionDateTime must be in future'
            UAEOF doesn't standardise this field
        Path:
          type: string
          minLength: 1
          maxLength: 500
          description: >-
            Recommended but optional reference to the JSON Path of the field
            with error, e.g., Data.Initiation.InstructedAmount.Currency
        Url:
          type: string
          description: >-
            URL to help remediate the problem, or provide more information, or
            to API Reference, or help etc
      description: Error
      additionalProperties: false
    AEErrorCode:
      type: string
      enum:
        - GenericError
  responses:
    201LeadResponse:
      description: Lead Response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LeadResponse'
    400Error:
      description: Bad request
      headers:
        x-fapi-interaction-id:
          description: An RFC4122 UID used as a correlation id.
          required: true
          schema:
            type: string
      content:
        application/json; charset=utf-8:
          schema:
            $ref: '#/components/schemas/AEErrorResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/AEErrorResponse'
    401Error:
      description: Unauthorized
      headers:
        x-fapi-interaction-id:
          description: An RFC4122 UID used as a correlation id.
          required: true
          schema:
            type: string
    403Error:
      description: Forbidden
      headers:
        x-fapi-interaction-id:
          description: An RFC4122 UID used as a correlation id.
          required: true
          schema:
            type: string
      content:
        application/json; charset=utf-8:
          schema:
            $ref: '#/components/schemas/AEErrorResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/AEErrorResponse'
    405Error:
      description: Method Not Allowed
      headers:
        x-fapi-interaction-id:
          description: An RFC4122 UID used as a correlation id.
          required: true
          schema:
            type: string
    406Error:
      description: Not Acceptable
      headers:
        x-fapi-interaction-id:
          description: An RFC4122 UID used as a correlation id.
          required: true
          schema:
            type: string
    415Error:
      description: Unsupported Media Type
      headers:
        x-fapi-interaction-id:
          description: An RFC4122 UID used as a correlation id.
          required: true
          schema:
            type: string
    429Error:
      description: Too Many Requests
      headers:
        Retry-After:
          description: Number in seconds to wait
          schema:
            type: integer
        x-fapi-interaction-id:
          description: An RFC4122 UID used as a correlation id.
          schema:
            type: string
    500Error:
      description: Internal Server Error
      headers:
        x-fapi-interaction-id:
          description: An RFC4122 UID used as a correlation id.
          required: true
          schema:
            type: string
      content:
        application/json; charset=utf-8:
          schema:
            $ref: '#/components/schemas/AEErrorResponse'
        application/json:
          schema:
            $ref: '#/components/schemas/AEErrorResponse'
  securitySchemes:
    TPPOAuth2Security:
      type: oauth2
      description: >-
        TPP confidential client authorization with the LFI to stage a consent.
        **Please refer to [OpenID FAPI Security Profile 1.0 -Part 2
        Advanced](https://openid.net/specs/openid-financial-api-part-2-1_0.html#authorization-server)
        - 5.2.2 point 14 - shall authenticate the confidential client using one
        of the following methods private_key_jwt and [OpenID Connect Core
        1.0](https://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication)
        9. Client Authentication private_key_jwt**
      flows:
        clientCredentials:
          tokenUrl: https://authserver.example/token
          scopes:
            products: Right to access leads and products resources

````