Legacy Dev Forum Posts

 View Only

Sign Up

400 Bad Request on successful user creation

  • 1.  400 Bad Request on successful user creation

    Posted 06-05-2025 18:10

    anon84847021 | 2016-09-02 11:50:31 UTC | #1

    Hi,

    When creating a user using POST https://api.mypurecloud.ie/api/v2/users, I get 400 bad request even if the user is created.

    Here is an example request:

    POST /api/v2/users HTTP/1.1
    Host: api.mypurecloud.ie
    Authorization: bearer XXXXXX
    Content-Type: application/json
    
    {
       "name": "Ned Flanders",
       "department": "The Leftorium",
       "email": "mickael.perrot.mail+flanders@gmail.com",
       "password": "azer1234!"
    }

    Thanks.


    tim.smith | 2016-09-02 16:04:52 UTC | #2

    That's certainly not good. I was able to reproduce and have filed CORE-5673 for this.

    Until this is fixed, try executing a search for the email address after you get a 400 back to confirm that the user was created successfully.


    tim.smith | 2016-09-02 16:21:51 UTC | #3

    FYI, this is most likely caused by the user's password not meeting the password requirements. The fix for this will be to both not create the user as well as return something useful to indicate why the request failed.


    anon84847021 | 2016-09-12 07:50:27 UTC | #4

    We are experiencing the same issue upon role assignment.

    Here is an example request of role assignment:

    PUT /api/v2/users/9ce81f70-35b9-4b24-be99-5b8c64d2b18e/roles HTTP/1.1 Host: api.mypurecloud.ie Authorization: bearer XXXX Content-Type: application/json

    [ "903c40ad-8996-4714-b515-102639615df3" ]

    I get the following:

    400 Bad Request { "status": 400, "code": "bad.request", "message": "The requested operation failed with status 400", "contextId": "a118a246-3d17-4cd0-b05c-a191b6de39bd", "details": [], "errors": [] }

    But the role is correctly assigned to the user.

    @tim.smith do we need to open an EPIC?

    Thanks.


    tim.smith | 2016-09-12 14:23:59 UTC | #5

    I can't tell why that would cause an issue. Your best bet will be to open a support ticket for this.


    system | 2017-08-28 19:26:59 UTC | #6


    This post was migrated from the old Developer Forum.

    ref: 362