Upsert Access Control Rule
/access-control-rulesUpsert an access control rule.
Requires a signed user/session or the existing authenticated client flow. The anonymous DCR delegated device profile cannot invoke this operation.
Required scope
Any authenticated access token
Request body
Fields
- operation
stringRequired The operation to grant access to. This could be a read, write, delete, etc. Please see the access controls list specification for all operations and their descriptions.
- resource
stringRequired The resource to grant access to. This could be an endpoint, a flow, a secret, etc. You can define this as either a class of resources, or a specific resource. Examples: - port1/principals/alice/endpoints/thermostat-zero grants access to that thermostat - port1/principals/alice/flows/* grants access to all flows owned by alice
- identity
stringRequired The identity to grant access to. This could be a user, a role, a group, etc. You can define this as either a class of identities, or a specific identity. Examples: - port1/principals/bob grants access to bob - * just grants access to all identities
Errors
400Invalid request payload
Check the request fields and any validation details, then correct the payload.
412 PRECONDITION_FAILEDThe If-Match etag does not match the current access control rule; re-read the rule and retry
Inspect the returned code and family and follow the error handling guide.
500 INTERNALInternal server error
Retry with backoff only when the operation is safe to repeat. Include the error code when reporting persistent failures.