Assign Role
Roles are a set of permissions that can be assigned to Accounts and API-Keys. If you don't have a role yet, you can learn how to create one here.
Assigning a Role to an API-Key
CURL
Endpoint:/v1/{target}/roles-api/roles/apikey/assign
Example Request
curl -X 'POST' \
'https://{orgID}.enterprise-sandbox.waltid.dev/v1/{target}/roles-api/roles/apikey/assign' \
-H 'accept: */*' \
-H 'Authorization: Bearer {yourToken}' \
-H 'Content-Type: application/json' \
-d '
{
"apikey": "waltid.myTestAPIKey"
}'
Body
{
"apikey": "waltid.myTestAPIKey"
}
Path Parameters
orgID
: - When performing operations within an organization, it is essential to use the organization's Base URL or another valid host alias. For example, if your organization is namedtest
, your default Base URL will betest.enterprise-sandbox.walt.dev
when using the sandbox environment.target
: resourceIdentifier - The target indicates the ID of the role to assign to an API-Key. e.g.waltid.admin
Body Parameters
apikey
: resourceIdentifier - Specifies the ID of the API-Key to assign the role to.
Response Codes
200
- Role assigned successfully.