# Get the current user with GET /rest/api/3/myself in Jira

URL: https://goingstellar.ro/reference/atlassian-rest-api/myself-current-user/

GET /rest/api/3/myself is the cheapest check that a credential works and the way to learn the accountId of the caller. It answers with the full user record. Without credentials it answers 401 with a plain-text message and a Www-Authenticate header, not a JSON error object.

## Endpoints

| Method | Path | What it does |
|---|---|---|
| GET | `/rest/api/3/myself` | Returns the user the request is authenticated as. |

## Examples

### GET /rest/api/3/myself

Reads the caller. groups and applicationRoles are present but collapsed.

```bash
curl \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  'https://your-domain.atlassian.net/rest/api/3/myself'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/rest/api/3/myself',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
)
print(r.status_code, r.text)
```

Response: HTTP 200

```
{
 "accountType": "atlassian",
 "displayName": "<display name>",
 "active": true,
 "timeZone": "Europe/Bucharest",
 "locale": "en_US",
 "groups": {
  "size": 6,
  "items": []
 },
 "applicationRoles": {
  "size": 1,
  "items": []
 },
 "expand": "groups,applicationRoles"
}
```

Response headers:

```
X-Ratelimit-Limit: 350
```

Sent to Atlassian Cloud on 29 Nov 2026.

### GET /rest/api/2/myself

The same call on v2. The record has the same fields.

```bash
curl \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  'https://your-domain.atlassian.net/rest/api/2/myself'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://your-domain.atlassian.net/rest/api/2/myself',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
)
print(r.status_code, r.text)
```

Response: HTTP 200

```
{
 "accountType": "atlassian",
 "displayName": "<display name>",
 "active": true,
 "timeZone": "Europe/Bucharest",
 "locale": "en_US"
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

### GET /rest/api/3/myself

No credentials. The body is a sentence, not JSON.

```bash
curl \
  -H 'Accept: application/json' \
  'https://your-domain.atlassian.net/rest/api/3/myself'
```

```python
import requests

r = requests.get(
    'https://your-domain.atlassian.net/rest/api/3/myself',
    headers={'Accept': 'application/json'},
)
print(r.status_code, r.text)
```

Response: HTTP 401

```
Client must be authenticated to access this resource.
```

Response headers:

```
Www-Authenticate: OAuth realm="https%3A%2F%2Fyour-domain.atlassian.net"
```

Sent to Atlassian Cloud on 29 Nov 2026.

### GET https://api.atlassian.com/ex/jira/{cloudId}/rest/api/3/myself

The call through the api.atlassian.com gateway with the cloud id in the path instead of the site host.

```bash
curl \
  -u "you@example.com:$ATLASSIAN_API_TOKEN" \
  -H 'Accept: application/json' \
  'https://api.atlassian.com/ex/jira/{cloudId}/rest/api/3/myself'
```

```python
import os
import requests

EMAIL = "you@example.com"
r = requests.get(
    'https://api.atlassian.com/ex/jira/{cloudId}/rest/api/3/myself',
    auth=(EMAIL, os.environ["ATLASSIAN_API_TOKEN"]),
    headers={'Accept': 'application/json'},
)
print(r.status_code, r.text)
```

Response: HTTP 200

```
{
 "accountType": "atlassian",
 "displayName": "<display name>",
 "active": true,
 "timeZone": "Europe/Bucharest"
}
```

Sent to Atlassian Cloud on 29 Nov 2026.

## How it behaves

- The record includes accountId, accountType (atlassian), emailAddress, avatarUrls, displayName, active, timeZone and locale.
- groups and applicationRoles were returned as {"size": n, "items": []}: the counts are there and the items are empty. The expand field names what can be added.
- Without credentials the status was 401 and the body the text "Client must be authenticated to access this resource." with a Www-Authenticate header naming an OAuth realm.
- The gateway URL on api.atlassian.com answered 200 with the same kind of user object as the site URL.

## Pitfalls

- Do not parse the 401 body as JSON. It is plain text, so a client that always calls .json() raises its own error.
- emailAddress can be empty or absent for other accounts because of profile privacy settings, even when the caller's own record shows it.
- Store accountId, not the email address. Every user parameter in the current API takes accountId.

## Questions and answers

### What is the quickest way to test a Jira API token?

Call GET /rest/api/3/myself. A 200 with your accountId means the credentials work; a 401 means they do not.

## Related

- [Basic auth with an API token](https://goingstellar.ro/reference/atlassian-rest-api/authentication-api-tokens/)
- [The api.atlassian.com gateway and the cloud id](https://goingstellar.ro/reference/atlassian-rest-api/api-gateway-cloud-id/)
- [Find users](https://goingstellar.ro/reference/atlassian-rest-api/user-search/)
- [Users, bulk lookup and groups](https://goingstellar.ro/reference/atlassian-rest-api/user-groups/)
- [Requests without authentication](https://goingstellar.ro/reference/atlassian-rest-api/anonymous-requests/)

## Sources

- [The Jira Cloud platform REST API v3 (Atlassian Developer)](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/)
- [Get current user (Jira REST API v3)](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-myself/#api-rest-api-3-myself-get)

