# REST API created user accounts not found a day after creation and successful usage

**URL:** <https://forums.rocket.chat/t/rest-api-created-user-accounts-not-found-a-day-after-creation-and-successful-usage/13136>\
**Category:** Development\
**Created:** [January 29, 2022, 2:27pm UTC](https://forums.rocket.chat/t/rest-api-created-user-accounts-not-found-a-day-after-creation-and-successful-usage/13136 "2022-01-29T14:27:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MindtoEye](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/mindtoeye/32/440_2.png) [@MindtoEye](https://forums.rocket.chat/u/MindtoEye)\
**Post date:** [January 29, 2022, 2:27pm UTC](https://forums.rocket.chat/t/rest-api-created-user-accounts-not-found-a-day-after-creation-and-successful-usage/13136/1 "2022-01-29T14:27:51Z")

</div>

Hi,

We built a system that inserts a Rocketchat chat window using an iframe. All of our code works, we have Java middle ware that creates accounts in Rocketchat and users are successfully joined to a channel and they can post and chat in the iframe.

However, very consistently a day after the user returns the account doesn’t work. I tried Postman to see if I can either login or retrieve data using the generated username/password and I get an ‘unauthorized’ response back.

When I look in the console of our Rocketchat Docker image (4.3.2) I see this:

```auto
{"level":50,"time":"2022-01-29T13:55:51.788Z","pid":9,"hostname":"731616dc3f8a","name":"System","msg":"Exception while invoking method login 'User not found [403]'"}

```

If I use Postman and admin credentials to get info on one of the created users I get for example:

```auto
{
    "user": {
        "_id": "kKMq6bBNK2u5iQkHH",
        "createdAt": "2022-01-28T16:17:59.638Z",
        "services": {},
        "username": " *******",
        "emails": [
            {
                "address": " ********",
                "verified": true
            }
        ],
        "type": "user",
        "status": "offline",
        "active": true,
        "roles": [
            "user"
        ],
        "name": " *********",
        "requirePasswordChange": false,
        "lastLogin": "2022-01-28T20:59:27.704Z",
        "canViewAllInfo": true
    },
    "success": true
}

```

When I use Postman to retrieve the status of that user I get:

```auto
{
    "_id": "kKMq6bBNK2u5iQkHH",
    "status": "offline",
    "success": true
}

```

Any idea what is going on here? I’m pretty much tapped out with respect to solution paths.

Cheers,

Martin

---

<div class="post-metadata">

**Author:** ![MindtoEye](https://sea1.discourse-cdn.com/flex021/user_avatar/forums.rocket.chat/mindtoeye/32/440_2.png) [@MindtoEye](https://forums.rocket.chat/u/MindtoEye)\
**Post date:** [January 29, 2022, 2:39pm UTC](https://forums.rocket.chat/t/rest-api-created-user-accounts-not-found-a-day-after-creation-and-successful-usage/13136/2 "2022-01-29T14:39:51Z")

</div>

Some additional information: when we use the endpoint ‘login’, using either Postman or the code we wrote, we get:

```auto
{
  "status":"error",
  "error":"Unauthorized",
  "message":"Unauthorized"
}

```
