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

# Create Session

> This endpoint creates a new session

### Body

<ParamField body="id" type="string">
  This is the ID of the session to be created.
</ParamField>

### Response

<ResponseField name="success" type="number">
  Indicates whether the call was successful. 1 if successful, 0 if not.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request POST 'https://api.stateset.com/v1/session' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Token <token>' \
  --data-raw '{
      "id": ""
  }'
  ```

  ```graphQL GraphQL theme={null}

            mutation addSession(
              $session: session_insert_input!
            ) {
              insert_session(objects: [$session]) {
                returning {
                  id
                  name
                  uuid
                  user_id
                }
              }
            }
  ```

  ```javascript Node.js theme={null}

  const created = await stateset.session.create({
    id: "",
  });

  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
      "data": {
          "insert_session": {
          "returning": [
              {
              "id": "",
              "name": "",
              "uuid": "",
              "user_id": ""
              }
          ]
          }
      }

  }
  ```
</ResponseExample>
