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

# Generate a session

## Request

Content-Type: `application/json`

| Parameter | Type | Description |
| - | - | - |
| `scenario_code` | `string` | **Required**. Scenario to be used for this session |
| `language` | `string` | **Required**. Language to be used for this session, must be enabled in the scenario |
| `external_id` | `string` | **Optional**. Your customer reference, if not defined an orphan session will be created |
| `input_data` | `object` | **Optional**. Customer data to be used for this session, see 'input\_data' reference |

> [accordion] input\_data
>
> | Parameter | Type | Description |
> | - | - | - |
> | `firstname` | `string` | **Optional**. Customer firstname |
> | `lastname` | `string` | **Optional**. Customer lastname |
> | `phone` | `string` | **Optional**. Customer phone number |
> | `birthdate` | `string` | **Optional**. Customer birthdate in YYYY-MM-DD format |
> | `address` | `string` | **Optional**. Customer address |
> | `zip` | `string` | **Optional**. Customer zip code |
> | `country` | `string` | **Optional**. Customer country |
> | `city` | `string` | **Optional**. Customer city |

## Response

Content-Type: `application/json`

| Parameter | Type | Description |
| - | - | - |
| `session_id` | `string` | Session ID |
| `customer_reference` | `string` | Customer reference |
| `start_date` | `int` | Session start date in unix timestamp format |

```json Request Example theme={null}
{
    "scenario_code": "default"
    "language": "fr-FR"
    "external_id": 123, // i.e your customer_ref
    "input_data": {
        "firstname": "Customer firstname",
        "lastname": "Customer lastname",
        "phone": "+352521000000",
        "birthdate": "YYYY-MM-DD",
        "address": "TestAddress",
        "zip": "TestZip",
        "country": "TestCountry",
        "city": "TestCity"
    }
}
```

```json Response Example theme={null}
{
  "session_id": "d897374f-6458-4781-b4ec-cfb192297d6a",
  "customer_reference": "123",
  "start_date": 1516975975
}
```



This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.