Update a role
1 min
PUT
https://api.upstartcommerce.com/profile-permissions/roles/{roleId}
Path Parameters
- roleIdstringrequiredDescription
Body Parameters
- bodyUpdateRoleRequestrequiredDescription
- namestringDescriptionMin Length1Max Length100
- roleDescriptionstringDescriptionMax Length500
Responses
200
- RoleDescription
- idstringrequiredDescription
- namestringrequiredExampleDescription
- scopestring<GLOBAL | TENANT | SITE>requiredDescriptionAllowedGLOBALTENANTSITE
- tenantIdstringDescription
- siteIdstringDescription
- roleDescriptionstringDescription
- roleTypestring<Management | Consumer>requiredDescriptionAllowedManagementConsumer
- createdAtstring<date-time>requiredFormatdate-time
- updatedAtstring<date-time>requiredFormatdate-time
400
- ErrorResponseDescription
- errorstring<bad_request | unauthorized | forbidden | not_found | conflict | internal_error>requiredExampleDescriptionAllowedbad_requestunauthorizedforbiddennot_foundconflictinternal_error
- messagestringrequiredExampleDescription
- detailsmap<string, string>Description
401
- ErrorResponseDescription
- errorstring<bad_request | unauthorized | forbidden | not_found | conflict | internal_error>requiredExampleDescriptionAllowedbad_requestunauthorizedforbiddennot_foundconflictinternal_error
- messagestringrequiredExampleDescription
- detailsmap<string, string>Description
404
- ErrorResponseDescription
- errorstring<bad_request | unauthorized | forbidden | not_found | conflict | internal_error>requiredExampleDescriptionAllowedbad_requestunauthorizedforbiddennot_foundconflictinternal_error
- messagestringrequiredExampleDescription
- detailsmap<string, string>Description
409
- ErrorResponseDescription
- errorstring<bad_request | unauthorized | forbidden | not_found | conflict | internal_error>requiredExampleDescriptionAllowedbad_requestunauthorizedforbiddennot_foundconflictinternal_error
- messagestringrequiredExampleDescription
- detailsmap<string, string>Description
500
- ErrorResponseDescription
- errorstring<bad_request | unauthorized | forbidden | not_found | conflict | internal_error>requiredExampleDescriptionAllowedbad_requestunauthorizedforbiddennot_foundconflictinternal_error
- messagestringrequiredExampleDescription
- detailsmap<string, string>Description
curl
curl --request PUT \
--url https://api.upstartcommerce.com/profile-permissions/roles/{roleId} \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'PUT',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.upstartcommerce.com/profile-permissions/roles/{roleId}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.upstartcommerce.com/profile-permissions/roles/{roleId}")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Put.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.upstartcommerce.com/profile-permissions/roles/{roleId}"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("PUT", url, headers=headers, data=payload)
print(response.text)
200
// Role updated successfully
{
"id": "",
"name": "operator",
"scope": "",
"tenantId": "",
"siteId": "",
"roleDescription": "",
"roleType": "",
"createdAt": "",
"updatedAt": ""
}400
// Invalid request parameters
{
"error": "not_found",
"message": "Role not found",
"details": ""
}401
// Missing or invalid authentication token
{
"error": "not_found",
"message": "Role not found",
"details": ""
}404
// Role not found
{
"error": "not_found",
"message": "Role not found",
"details": ""
}409
// Role name conflict
{
"error": "not_found",
"message": "Role not found",
"details": ""
}500
// Internal server error
{
"error": "not_found",
"message": "Role not found",
"details": ""
}