DEV Community

GreggHume
GreggHume

Posted on

1

Strapi: Update user via api

To update a user via the api you can do the following:

// route as PUT
localhost:1337/api/users/1

// body
{
  "firstname": "Mat",
  "lastname": "OD"
}

// response
{
  "id": 1,
  "username": "matod",
  "email": "test@test.com",
  "provider": "local",
  "confirmed": true,
  "blocked": false,
  "createdAt": "2023-09-18T13:25:52.248Z",
  "updatedAt": "2023-09-19T18:07:03.885Z",
  "firstname": "Mat",
  "lastname": "OD",
  "role": {
    "id": 4,
    "name": "Organiser",
    "description": "Organisers permissions",
    "type": "organiser",
    "createdAt": "2023-09-19T17:12:57.632Z",
    "updatedAt": "2023-09-19T17:12:57.632Z"
  }
}
Enter fullscreen mode Exit fullscreen mode

A note, as of writing this "populate: *" param does not work if you want to get back component or related data.

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more