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

# Initiate a KBA session

> Creates a new KBA (Knowledge-Based Authentication) session for a personal Verified Customer. Returns a KBA identifier that represents the session and is used to retrieve authentication questions for customer verification.



## OpenAPI

````yaml post /customers/{id}/kba
openapi: 3.1.0
info:
  title: Dwolla API
  description: Dwolla API Documentation
  contact:
    name: Dwolla Developer Relations Team
    url: https://developers.dwolla.com
    email: api@dwolla.com
  version: '2.0'
  termsOfService: https://www.dwolla.com/legal/tos/
  license:
    name: MIT
    url: https://github.com/Dwolla/dwolla-openapi/blob/master/LICENSE
servers:
  - url: https://api.dwolla.com
    description: Production server
  - url: https://api-sandbox.dwolla.com
    description: Sandbox server
security:
  - clientCredentials: []
tags:
  - name: tokens
    description: Operations related to Application Access Tokens
  - name: root
    description: Root API operations
  - name: accounts
    description: Operations related to Accounts
  - name: customers
    description: Operations related to Customers
  - name: kba
    description: Operations related to Knowledge-Based Authentication
  - name: beneficial owners
    description: Operations related to Beneficial Owners
  - name: documents
    description: Operations related to Documents
  - name: exchanges
    description: Operations related to Exchanges
  - name: exchange sessions
    description: Operations related to Exchange Sessions
  - name: funding sources
    description: Operations related to Funding Sources
  - name: transfers
    description: Operations related to Transfers
  - name: labels
    description: Operations related to Labels
  - name: mass payments
    description: Operations related to Mass Payments
  - name: events
    description: Operations related to Events
  - name: webhook subscriptions
    description: Operations related to Webhook Subscriptions
  - name: webhooks
    description: Operations related to Webhooks
  - name: client tokens
    description: Operations related to Client Tokens
  - name: sandbox simulations
    description: Sandbox-only operations for simulating processing of bank transfers
paths:
  /customers/{id}/kba:
    post:
      tags:
        - kba
      summary: Initiate a KBA session
      description: >-
        Creates a new KBA (Knowledge-Based Authentication) session for a
        personal Verified Customer. Returns a KBA identifier that represents the
        session and is used to retrieve authentication questions for customer
        verification.
      operationId: initiateKbaForCustomer
      parameters:
        - name: id
          in: path
          description: The ID of the Customer for initiating a KBA session
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/Accept'
      responses:
        '201':
          description: created
          headers:
            Location:
              $ref: '#/components/headers/Location'
        '403':
          description: 403 Error
          headers: {}
          content:
            application/vnd.dwolla.v1.hal+json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/InvalidResourceStateSchema'
                  - $ref: '#/components/schemas/ForbiddenError'
        '404':
          description: 404 Error
          headers: {}
          content:
            application/vnd.dwolla.v1.hal+json:
              schema:
                $ref: '#/components/schemas/NotFoundError'
      x-codeSamples:
        - lang: bash
          source: >
            POST
            https://api.dwolla.com/customers/33aa88b1-97df-424a-9043-d5f85809858b/kba

            Authorization: Bearer
            cRahPzURfaIrTKL18tmslWPqKdzkLeYJm0oB1hGJ1vMPArft1v

            Content-Type: application/json

            Accept: application/vnd.dwolla.v1.hal+json
        - lang: javascript
          source: >
            // Using dwolla-v2 - https://github.com/Dwolla/dwolla-v2-node

            var customerUrl =
              "https://api-sandbox.dwolla.com/customers/61a74e62-e27d-46f1-9fa6-a8e57226bb3e";

            dwolla.post(`${customerUrl}/kba`).then((res) =>
            res.headers.get("location")); // =>
            'https://api-sandbox.dwolla.com/kba/70b0e9cc-020d-4de2-9a82-a2281afa4c31'
        - lang: python
          source: >
            # Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python

            customer_url =
            'https://api-sandbox.dwolla.com/customers/61a74e62-e27d-46f1-9fa6-a8e57226bb3e'


            kba = app_token.post('%s/kba' % customer_url)

            kba.headers['location'] # =>
            "https://api-sandbox.dwolla.com/kba/70b0e9cc-020d-4de2-9a82-a2281afa4c31"
        - lang: php
          source: >
            <?php

            // Using dwollaswagger -
            https://github.com/Dwolla/dwolla-swagger-php

            $customersApi = new DwollaSwagger\CustomersApi($apiClient);


            $customerUrl =
            "https://api.dwolla.com/customers/ca22d192-48f1-4b72-b29d-681e9e20795d";


            $kba = $customersApi->initiateKba($customer_url);

            $kba; # =>
            "https://api-sandbox.dwolla.com/kba/70b0e9cc-020d-4de2-9a82-a2281afa4c31"

            ?>
        - lang: ruby
          source: >
            # Using dwolla_v2 - https://github.com/Dwolla/dwolla-v2-ruby

            customer_url =
            'https://api-sandbox.dwolla.com/customers/ca22d192-48f1-4b72-b29d-681e9e20795d'


            kba = app_token.post "#{customer_url}/kba"

            kba.response_headers[:location] # =>
            "https://api-sandbox.dwolla.com/kba/70b0e9cc-020d-4de2-9a82-a2281afa4c31"
components:
  parameters:
    Accept:
      name: Accept
      in: header
      required: true
      description: >-
        The media type of the response. Must be
        application/vnd.dwolla.v1.hal+json
      schema:
        type: string
        enum:
          - application/vnd.dwolla.v1.hal+json
        default: application/vnd.dwolla.v1.hal+json
  headers:
    Location:
      description: The location of the created resource
      schema:
        type: string
  schemas:
    InvalidResourceStateSchema:
      title: InvalidResourceStateSchema
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: invalidResourceState
        message:
          type: string
          example: >-
            Resource cannot be modified. Document creation not allowed for
            already verified Customers or non-verified Customer types.
    ForbiddenError:
      title: ForbiddenError
      description: Error response schema for 403 Forbidden
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: Forbidden
        message:
          type: string
          example: The supplied credentials are not authorized for this resource.
    NotFoundError:
      title: NotFoundError
      description: Error response schema for 404 NotFound
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: NotFound
        message:
          type: string
          example: The requested resource was not found.
  securitySchemes:
    clientCredentials:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /token
          x-speakeasy-token-endpoint-authentication: client_secret_basic
          scopes: {}

````