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

# Generate Token for Linked Account

This API generates a session token to authenticate a linked account.

## Request description

#### Body Parameters

<ParamField body="linked_account_id" type="string" required>
  Unique customer identification id. For Eg: [markwood@some\_email.com](mailto:markwood@some_email.com)
</ParamField>

## Response description

<Tabs>
  <Tab title="200">
    <ResponseField name="token" type="string">
      Session Token. Expires in 24 hrs.
    </ResponseField>
  </Tab>

  <Tab title="Error">
    <ResponseField name="status_code" type="integer">
      System generated status Code
    </ResponseField>

    <ResponseField name="http_error_type" type="string">
      System generated error type
    </ResponseField>

    <ResponseField name="error_code" type="string">
      Specific error code to identify the error
    </ResponseField>

    <ResponseField name="message" type="string">
      Error message
    </ResponseField>

    <ResponseField name="request_id" type="string">
      System generated request id
    </ResponseField>
  </Tab>
</Tabs>

<ResponseExample>
  ```JSON 200 theme={null}
  {
      "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJvcmdfaWQiOiI2M2M5M2RhMGI0NmI3MjQzNzg1YTFlMTciLCJsaW5rZWRfYWNjb3VudF9pZCI6IjEyMzQ1Njc4IiwiZW52aXJvbm1lbnQiOiJ0ZXN0IiwiaWF0IjoxNjg2NjQzMDg5LCJleHAiOjE2ODY5MDIyODl9.CepcAGqYIpE0Dhen_Sxgsl5cPHP8Agm_zcwa4y0QFDM"
  }
  ```

  ```JSON 400 theme={null}
  {
      "status_code": 400,
      "http_error_type": "BAD_REQUEST",
      "error_code": "SERVER_ERROR",
      "message": "Linked account Id and Template Id both are required",
      "request_id": "0d6eab55-4b60-4eae-a6ca-58d7b6fda80d"
  }
  ```

  ```JSON 401 theme={null}
  {
      "status_code": 401,
      "http_error_type": "UNAUTHORIZED",
      "error_code": "SERVER_ERROR",
      "message": "Invalid Credentials"
      "request_id": "89bd1675-a826-46cb-9210-6cb2ae169f67"
  }
  ```

  ```JSON 500 theme={null}
  {
      "status_code": 500,
      "http_error_type": "INTERNAL_SERVER_ERROR",
      "error_code": "SERVER_ERROR",
      "message": "No linked account found for account id : T1234567 in environment test",
      "request_id": "0d6eab55-4b60-4eae-a6ca-58d7b6fda80d"
  }
  ```
</ResponseExample>
