---
ai:
  exclude: true
search:
  tags:
    - session
    - POST
seo:
  description: >-
    Creates a new session for a user in Jira. Once a session… Reference for the
    POST /auth/1/session endpoint in the Jira Software Data Center REST API
    Reference.
sidebar:
  label: Create new user session
  badge: POST
title: Create new user session
type: openapi-operation
---
Creates a new session for a user in Jira. Once a session has been successfully created it can be used to access any of Jira's remote APIs and also the web UI by passing the appropriate HTTP Cookie header. Note that it is generally preferrable to use HTTP BASIC authentication with the REST API. However, this resource may be used to mimic the behaviour of Jira's log-in page (e.g. to display log-in errors to a user).

`POST /auth/1/session`

**Request body** (`application/json`, required)

the username and password to authenticate

- `password` (string)
- `username` (string)

Request body example:

```json
{
  "password": "string",
  "username": "string"
}
```

**Responses**

- `200` — Returned if the caller is authenticated. Contains information about the caller's session.
- `401` — Returned if the login fails due to invalid credentials.
- `403` — Returned if the login is denied due to a CAPTCHA requirement, throtting, or any other reason. In case of a 403 status code it is possible that the supplied credentials are valid but the user is not allowed to log in at this point in time.

Response example, 200:

```json
{
  "loginInfo": {
    "failedLoginCount": 10,
    "lastFailedLoginTime": "2019-08-24T14:15:22Z",
    "loginCount": 127,
    "previousLoginTime": "2019-08-24T14:15:22Z"
  },
  "session": {
    "name": "JSESSIONID",
    "value": "12345678901234567890"
  }
}
```
