POST
/
session
/
create
curl --request POST \
  --url https://development.knotapi.com/session/create \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '{
  "type": "card_switcher",
  "external_user_id": "123abc",
  "card_id": "81n9al10a0ayn13",
  "phone_number": "+11234567890",
  "email": "ada.lovelace@gmail.com",
  "card": {
    "blocked": false,
    "has_funds": true
  },
  "processor_token": "processor-production-0asd1-a92nc"
}'
{
  "session": "915efe72-5136-4652-z91q-d9d48003c102"
}

Sessions last 30 minutes. It is best practice to create a new session each time you initialize the SDK and not log the session in any internal or 3rd party tooling.

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json
The input parameters required for creating a session.
type
enum<string>
required

Product to associate the session with.

Available options:
card_switcher,
transaction_link
Example:

"card_switcher"

external_user_id
string
required

Your unique identifier for the user.

Example:

"123abc"

card_id
string

Your internal identifier for a specific card. Required if type = card_switcher.

Example:

"81n9al10a0ayn13"

phone_number
string

User's phone number in E.164 format.

Example:

"+11234567890"

email
string

User's email address.

Example:

"ada.lovelace@gmail.com"

card
object
processor_token
string

Plaid processor_token if using transaction data from Plaid to detect merchants.

Example:

"processor-production-0asd1-a92nc"

Response

200
application/json
Successful request.
session
string

A session.

Example:

"915efe72-5136-4652-z91q-d9d48003c102"