files/en-us/web/webdriver/reference/classic/commands/newsession/index.md
The New Session command of the WebDriver API creates a new WebDriver session with the browser. The session identifier returned in the response is required for all subsequent commands.
| Method | URI template |
|---|---|
POST | /session |
capabilities
The response payload is a JSON object with:
sessionId
capabilities
With a WebDriver server running on localhost:4444, the following command starts a new WebDriver session requesting Firefox as the browser:
curl -i -H "Content-Type: application/json" -d '{"capabilities": {"alwaysMatch": {"browserName": "firefox"}}}' http://localhost:4444/session
The output will look similar to the following, where 27c8437e-5e42-43f9-a26f-2db0fd509ec1 is the unique identifier of this session:
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
{"value":{"sessionId":"27c8437e-5e42-43f9-a26f-2db0fd509ec1","capabilities":{"acceptInsecureCerts":false,"browserName":"firefox","browserVersion":"147.0.4","pageLoadStrategy":"normal","platformName":"mac","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000}}}}
{{Specifications}}
{{Compat}}