---
title: "Create a Session"
method: POST
path: "/v1/session"
tags: ["Sessions"]
---

# Create a Session

`POST /v1/session`

## Request

- Base URL: `https://api.edgegap.com`
- URL: `https://api.edgegap.com/v1/session`
- Auth: API key in header `authorization`

Create a session with users. Sessions are linked to a deployment.

## Request body

- SessionModel
  - `app_name` string, required: The Name of the App you want to deploy, example: supermario
  - `version_name` string: The Name of the App Version you want to deploy, example: v1.0
  - `ip_list` string[]: The List of IP of your user, Array of String, example: ["162.254.103.13","198.12.116.39", "162.254.135.39", "162.254.129.34"]
  - `geo_ip_list` GeoIpListModel[]: The list of IP of your user with their location (latitude, longitude)
    - `ip` string, required: IP address
    - `latitude` number, required: Latitude of the IP/User
    - `longitude` number, required: Longitude of the IP/User
  - `deployment_request_id` string: The request id of your deployment. If specified, the session will link to the deployment
  - `location` LocationModel
    - `latitude` number, required: Desired Latitude
    - `longitude` number, required: Desired Longitude
  - `city` string: If you want your session in a specific city
  - `country` string: If you want your session in a specific country
  - `continent` string: If you want your session in a specific continent
  - `administrative_division` string: If you want your session in a specific administrative division
  - `region` string: If you want your session in a specific region
  - `selectors` SelectorModel[]: List of Selectors to filter potential Deployment to link and tag the Session
    - `tag` string, required: The Tag to filter potential Deployment with this Selector
    - `tag_only` boolean: If True, will not try to filter Deployment and only tag the Session
    - `env` SelectorEnvModel
      - `key` string, required: The Key to inject in the Deployment Environment Variable for this Selector
      - `value` string, required: The Value to inject in the Deployment Environment Variable for this Selector
  - `webhook_url` string: When your Session is Linked, Unprocessable or in Error, we will POST the session's details on the webhook_url
  - `filters` SessionFilterModel[]: List of location filters to apply to the session
    - `field` string, required: The field to filter
    - `values` string[], required: The values to filter
    - `filter_type` 'any' | 'all' | 'not', required: The type of filter
  - `skip_telemetry` boolean: If system should skip the telemetry and use GeoBase decision only

## Response `200`

Success

- SessionRequest
  - `session_id` string, required: The Unique Identifier of the Session
  - `custom_id` string: Custom ID if Available
  - `app` string, required: The Name of the App you requested
  - `version` string, required: The name of the App Version you requested
  - `deployment_request_id` string: Unique UUID
  - `selectors` SelectorModel[]: List of Selectors to filter potential Deployment to link and tag the Session
    - `tag` string, required: The Tag to filter potential Deployment with this Selector
    - `tag_only` boolean: If True, will not try to filter Deployment and only tag the Session
    - `env` SelectorEnvModel
      - `key` string, required: The Key to inject in the Deployment Environment Variable for this Selector
      - `value` string, required: The Value to inject in the Deployment Environment Variable for this Selector
  - `webhook_url` string: When your Session is Linked, Unprocessable or in Error, we will POST the session's details on the webhook_url

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `404`: Not Found
- `409`: Conflict
- `422`: Unprocessable
- `500`: Internal Server Error

---

[API](https://skmtc.dev/edgegap/apis/edgegap-v1.md) · [All operations](https://skmtc.dev/edgegap/apis/edgegap-v1/llms.txt) · [OpenAPI document](https://skmtc.dev/edgegap/apis/edgegap-v1/revisions/9fa2b393a6be?raw)
