---
title: Authentication
slug: api/authentication
icon: 🔐
createdAt: 2024-02-24T13:18:24.595Z
---

# Generating a Session Token

Access to the KYC Data API will be granted when user credentials are issued.

The credentials are required in order to obtain a **session token**.  A session token is valid for 8 hours, and a user can have multiple active session tokens.

When you subscribe to the Data Zoo KYC Data API you'll receive a username and password for every child account required; often this may be only one set of credentials however depending on the number of configuration profiles, reseller accounts etc then multiple credentials may be issued.

:::ApiMethodV2
```json
{
  "name": " Authentication Sandbox",
  "method": "POST",
  "url": "https://idu-test.datazoo.com/api/v2/auth/sign_in",
  "description": "",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "G2qNcShAL0cGdvMErxy96",
        "language": "curl",
        "code": "curl --location 'https://idu-test.datazoo.com/api/v2/auth/sign_in' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '{\n  \"username\": \"\",\n  \"password\": \"\"\n}'",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "G2qNcShAL0cGdvMErxy96"
  },
  "results": {
    "languages": [
      {
        "id": "cgwiic4I8AQBeOL4McHQX",
        "language": "200",
        "customLabel": "",
        "code": "{\n    \"message\": \"Logged in!\",\n    \"sessionToken\": \"Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ0ZXN0IiwiaWF0IjoxNzA4NzgyMDcyLCJpcGEiOiIzNC4xNTEuMTE3LjI0OSIsInVpZCI6MTUsIm9pZCI6MSwibGlkIjozMTY5ODc5LCJleHAiOjE3MDg4MTA4NzIsImF1ZCI6Imh0dHBzOi8vaWR1LmRhdGF6b28uY29tIiwiZHNwIjpbIioiXX0.h1H0DYCaxPTrxcVt_mcIPP4yA8MFMAC67GDirlPriDJkFSRcQtoCDbTKjEMDgVhtg2hw__vMETh9pGrqc-2HJQ\"\n}"
      },
      {
        "id": "mudDfcgYusPQD0tZ8t7fg",
        "language": "401",
        "customLabel": "",
        "code": "{\n    \"error\": \"Incorrect password detected\"\n}\nor\n{\n    \"error\": \"Incorrect log in credentials detected\"\n}"
      }
    ],
    "selectedLanguageId": "cgwiic4I8AQBeOL4McHQX"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "name": "data",
        "kind": "required",
        "type": "object",
        "description": "",
        "value": "Rumana_Khandoker_Test",
        "": "",
        "children": [
          {
            "name": "username",
            "kind": "required",
            "type": "string",
            "description": "supplied username"
          },
          {
            "name": "password",
            "kind": "required",
            "type": "string",
            "description": "supplied password"
          }
        ],
        "schema": [
          {
            "name": "username",
            "kind": "required",
            "type": "string",
            "description": "supplied username"
          },
          {
            "name": "password",
            "kind": "required",
            "type": "string",
            "description": "supplied password"
          }
        ]
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "hasTryItOut": false,
  "response": [
    {
      "name": "message",
      "kind": "optional",
      "type": "string",
      "description": ""
    },
    {
      "name": "sessionToken",
      "kind": "optional",
      "type": "string",
      "description": "",
      "children": []
    }
  ],
  "autoGeneratedAnchorSlug": "authentication-sandbox",
  "legacyHash": "J_S09pECSAcsW7OOKxkWO"
}
```
:::

***

:::ApiMethodV2
```json
{
  "name": " Authentication Production",
  "method": "POST",
  "url": "https://idu.datazoo.com/api/v2/auth/sign_in",
  "description": "",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "G2qNcShAL0cGdvMErxy96",
        "language": "curl",
        "code": "curl --location 'https://idu.datazoo.com/api/v2/auth/sign_in' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '{\"data\":{\"username\":\"String\",\"password\":\"String\"}}'",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "G2qNcShAL0cGdvMErxy96"
  },
  "results": {
    "languages": [
      {
        "id": "cgwiic4I8AQBeOL4McHQX",
        "language": "200",
        "customLabel": "",
        "code": "{\n    \"message\": \"Logged in!\",\n    \"sessionToken\": \"Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ0ZXN0IiwiaWF0IjoxNzA4NzgyMDcyLCJpcGEiOiIzNC4xNTEuMTE3LjI0OSIsInVpZCI6MTUsIm9pZCI6MSwibGlkIjozMTY5ODc5LCJleHAiOjE3MDg4MTA4NzIsImF1ZCI6Imh0dHBzOi8vaWR1LmRhdGF6b28uY29tIiwiZHNwIjpbIioiXX0.h1H0DYCaxPTrxcVt_mcIPP4yA8MFMAC67GDirlPriDJkFSRcQtoCDbTKjEMDgVhtg2hw__vMETh9pGrqc-2HJQ\"\n}"
      },
      {
        "id": "mudDfcgYusPQD0tZ8t7fg",
        "language": "401",
        "customLabel": "",
        "code": "{\n    \"error\": \"Incorrect password detected\"\n}\nor\n{\n    \"error\": \"Incorrect log in credentials detected\"\n}"
      }
    ],
    "selectedLanguageId": "cgwiic4I8AQBeOL4McHQX"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "name": "data",
        "kind": "required",
        "type": "object",
        "description": "",
        "value": "Rumana_Khandoker_Test",
        "": "",
        "children": [
          {
            "name": "username",
            "kind": "required",
            "type": "string",
            "description": "supplied username"
          },
          {
            "name": "password",
            "kind": "required",
            "type": "string",
            "description": "supplied password"
          }
        ],
        "schema": [
          {
            "name": "username",
            "kind": "required",
            "type": "string",
            "description": "supplied username"
          },
          {
            "name": "password",
            "kind": "required",
            "type": "string",
            "description": "supplied password"
          }
        ]
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "hasTryItOut": false,
  "response": [
    {
      "name": "message",
      "kind": "optional",
      "type": "string",
      "description": ""
    },
    {
      "name": "sessionToken",
      "kind": "optional",
      "type": "string",
      "description": "",
      "children": []
    }
  ],
  "autoGeneratedAnchorSlug": "authentication-production",
  "legacyHash": "1WxOQmmFHwNGXOvWM2_3D"
}
```
:::

###

###



