Create a role assignment
Create a role assignment for the given organization
Body
Required
-
Twilio Role Sid representing assigned role
Format should match the following pattern:
IX[0-9a-f]{32}
. -
Twilio Sid representing scope of this assignment
Format should match the following pattern:
^[A-Z]{2}[0-9a-fA-F]{32}$
. -
Twilio Sid representing identity of this assignment
Format should match the following pattern:
^[A-Z]{2}[0-9a-fA-F]{32}$
.
POST
/Organizations/{OrganizationSid}/RoleAssignments
curl \
--request POST 'https://preview-iam.twilio.com/Organizations/ORa36de9717566c7eb6363671f54b87ba9/RoleAssignments' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"role_sid":"IXc4ddb9d0befdb122b0eff334e3084544","scope":"ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","identity":"USc4ddb9d0befdb122b0eff334e3084544"}'
Request examples
{
"role_sid": "IXc4ddb9d0befdb122b0eff334e3084544",
"scope": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"identity": "USc4ddb9d0befdb122b0eff334e3084544"
}
Response examples (201)
# Headers
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: X-Custom-Header1, X-Custom-Header2
# Payload
{
"sid": "IYc4ddb9d0befdb122b0eff334e3084544",
"role_sid": "IXc4ddb9d0befdb122b0eff334e3084544",
"scope": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"identity": "USc4ddb9d0befdb122b0eff334e3084544"
}
Response examples (400)
# Headers
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: X-Custom-Header1, X-Custom-Header2
# Payload
{
"code": 42,
"message": "string",
"moreInfo": "string",
"status": 42
}
Response examples (403)
# Headers
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: POST, OPTIONS
Access-Control-Allow-Headers: Content-Type, Authorization
Access-Control-Allow-Credentials: true
Access-Control-Expose-Headers: X-Custom-Header1, X-Custom-Header2
# Payload
{
"code": 42,
"message": "string",
"moreInfo": "string",
"status": 42
}