LendKey leads API

The leads API from LendKey — 1 operation(s) for leads.

OpenAPI Specification

lendkey-leads-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: LendKey E-Sign API (via Kong Gateway) Application Contracts leads API
  version: 0.1
  description: "# LendKey E-Sign API - Kong Gateway Documentation\n\n## Overview\n\nThe LendKey E-Sign API provides endpoints for creating and managing electronic signature contracts using DocuSign.\nThis API is accessed through Kong Gateway, which handles authentication via OAuth2.\n\n## Authentication\n\nAll requests to this API require OAuth2 authentication through Kong Gateway.\n\n### Step 1: Get OAuth2 Token\n\nBefore calling any endpoint, you must obtain an access token:\n\n**Production Environment:**\n```bash\ncurl -X POST https://api.lendkey.com/esign/oauth2/token \\\n  -d \"grant_type=client_credentials\" \\\n  -d \"client_id=YOUR_CLIENT_ID\" \\\n  -d \"client_secret=YOUR_CLIENT_SECRET\"\n```\n\n**Response:**\n```json\n{\n  \"access_token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...\",\n  \"token_type\": \"bearer\",\n  \"expires_in\": 7200\n}\n```\n\n### Step 2: Use Token in API Calls\n\nInclude the access token in the `Authorization` header:\n```\nAuthorization: Bearer YOUR_ACCESS_TOKEN\n```\n\n**Token Lifetime:** 2 hours (7200 seconds)\n\n## Base URLs (Kong Gateway)\n\n| Environment | Kong Base URL | Backend Kubernetes Service |\n|------------|---------------|---------------------------|\n| **Production** | `https://api.lendkey.com/esign` | `main-esign-kotlin.ci.lkeyprod.com` |\n\n## How Kong Routes Requests\n\nWhen you call Kong:\n```\nhttps://api.lendkey.com/esign/applications\n```\n\nKong:\n1. Validates your OAuth2 token\n2. Strips the `/esign` prefix\n3. Forwards to: `http://main-esign-kotlin.ci.lkeyprod.com/applications`\n\nYou don't need to manage any backend authentication - Kong handles everything!\n\n## Getting Started\n\n1. **Get Credentials:** Contact your Kong admin or use the Kong Developer Portal\n2. **Get Token:** Use the OAuth2 token endpoint for your environment\n3. **Call API:** Use the token in the Authorization header\n4. **Refresh:** Get a new token every 2 hours\n"
  contact:
    name: LendKey Platform Team
    url: https://lendkey.com
servers:
- url: https://api.lendkey.com/esign
  description: Production Environment
security:
- oauth2: []
tags:
- name: leads
paths:
  /v1/leads/create:
    post:
      tags:
      - leads
      summary: Creates a new lead to represent a potential customer
      description: Creates a lead record in the Greenhouse LOS to capture information about potential customers and where their traffic was driven in from.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createLeadRequest'
      responses:
        200:
          description: OK
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/leadResponse'
        400:
          $ref: '#/components/responses/BadRequest'
        500:
          $ref: '#/components/responses/UnexpectedError'
components:
  schemas:
    leadResponse:
      type: object
      properties:
        id:
          type: integer
        uuid:
          type: string
          format: uuid
        email:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        createdAt:
          type: string
          format: date
        updatedAt:
          type: string
          format: date
        source:
          type: string
        sourceKey:
          type: string
        sourceApplicationId:
          type: string
        creditRiskModel:
          type: string
      example:
        id: 1
        uuid: 3441eb74-e5e6-483a-bb53-4201edf7210e
        email: no-reply@lendkey.com
        firstName: John
        lastName: Doe
        createdAt: '2021-09-21T19:21:53.726626200Z'
        updatedAt: '2021-09-21T19:21:53.726626200Z'
        source: unqork
        sourceKey: 8f8898ae-dda1-4bde-a627-44d6fb5977dd
        sourceApplicationId: 'null'
        creditRiskModel: 0f2f1ce6-7bed-4df4-8b04-aff593dd4d23
    error:
      type: object
      properties:
        id:
          type: string
          format: uuid
        status:
          type: string
        timestamp:
          type: string
        message:
          type: string
        debugMessage:
          type: string
        subErrors:
          type: array
          items:
            $ref: '#/components/schemas/suberror'
      example:
        id: null
        status: BAD_REQUEST
        timestamp: '2019-10-21 14:07:59'
        message: Validation error
        debugMessage: null
        subErrors:
        - object: Resource
          field: name
          rejectedValue: null
          message: must not be null
    createLeadRequest:
      type: object
      properties:
        email:
          type: string
        firstName:
          type: string
        lastName:
          type: string
        source:
          type: string
        sourceKey:
          type: string
        sourceApplicationId:
          type: string
        creditRiskModel:
          type: string
      example:
        email: no-reply@lendkey.com
        firstName: John
        lastName: Doe
        source: unqork
        sourceKey: 8f8898ae-dda1-4bde-a627-44d6fb5977dd
        sourceApplicationId: 'null'
        creditRiskModel: 0f2f1ce6-7bed-4df4-8b04-aff593dd4d23
    suberror:
      type: object
      properties:
        object:
          type: string
        field:
          type: string
        rejectedValue:
          type: string
        message:
          type: string
      example:
        object: Resource
        field: name
        rejectedValue: null
        message: must not be null
  responses:
    UnexpectedError:
      description: An unexpected server error occurred.
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            id: b6c52a48-551a-42ef-b361-f642d25cfeb7
            status: INTERNAL_SERVER_ERROR
            timestamp: '2019-10-21 14:07:59'
            message: An internal issue occurred.  Please try again shortly.  If the issue persists, contact us with all of the data in this error message.
            debugMessage: null
    BadRequest:
      description: Invalid request, unable to process the request with the information provided.
      content:
        application/hal+json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            id: b6c52a48-551a-42ef-b361-f642d25cfeb7
            status: BAD_REQUEST
            timestamp: '2019-10-21 14:07:59'
            message: Describes what was invalid about the request, if possible.
            debugMessage: null
  securitySchemes:
    oauth2:
      type: oauth2
      description: OAuth2 client credentials flow via Kong Gateway
      flows:
        clientCredentials:
          tokenUrl: /oauth2/token
          scopes: {}