Before you start: an API token with rule change/apply rights, a target and template.
- Call POST
/grantswithIdempotency-Key:Or passbashcurl -X POST https://principal.example.com/api/v2/grants \ -H "Authorization: Bearer $PRINCIPAL_TOKEN" \ -H "Content-Type: application/json" -H "Idempotency-Key: $REQUEST_ID" \ -d '{"subject_id":"<id>","target_id":"<id>", "template_name":"warehouse-read-only","mode":"apply_async"}'connector_id,provider,external_id,subject_kind. Addttl(PT1H) for expiry. - Poll
job_id: GET/admin./jobs /{id} - Notify requester on success or forward failure.
plan_only plans only. apply_sync (201) and apply_async (202) return before apply runs.