Updates a Role
JavaScript
const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: JSON.stringify({role: {name: 'vendor'}}) }; fetch('http://{defaultHost}/api/v2/platform/roles/{id}', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));
{ "data": { "id": "8", "type": "role", "attributes": { "name": "administrator", "created_at": "2022-11-08T19:35:07.901Z", "updated_at": "2022-11-08T19:35:08.133Z" } } }
Documentation IndexFetch the complete documentation index at: https://spreecommerce.org/docs/llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: https://spreecommerce.org/docs/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
Show child attributes
Record updated
Was this page helpful?
Contact support