Create a Role
Creates a Role
POST
/
api
/
v2
/
platform
/
roles
Create a Role
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('http://{defaultHost}/api/v2/platform/roles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url http://{defaultHost}/api/v2/platform/roles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'{
"data": {
"id": "5",
"type": "role",
"attributes": {
"name": "Role 5",
"created_at": "2022-11-08T19:35:07.110Z",
"updated_at": "2022-11-08T19:35:07.110Z"
}
}
}{
"error": "Name can't be blank",
"errors": {
"name": [
"can't be blank"
]
}
}Was this page helpful?
⌘I
Create a Role
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('http://{defaultHost}/api/v2/platform/roles', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url http://{defaultHost}/api/v2/platform/roles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'{
"data": {
"id": "5",
"type": "role",
"attributes": {
"name": "Role 5",
"created_at": "2022-11-08T19:35:07.110Z",
"updated_at": "2022-11-08T19:35:07.110Z"
}
}
}{
"error": "Name can't be blank",
"errors": {
"name": [
"can't be blank"
]
}
}
