← Back to API Reference
/role_permissions
Tag: role_permissions
getThe permissions for a role
Parameters
| Name | In | Type | Format | Required | Description |
|---|---|---|---|---|---|
id | query | string | — | — | — |
role | query | string | — | — | The role the permission is for |
permission | query | string | — | — | The permission for the role |
select | query | string | — | — | Filtering Columns |
order | query | string | — | — | Ordering |
Range | header | string | — | — | Limiting and Pagination |
Range-Unit | header | string | — | — | Limiting and Pagination |
offset | query | string | — | — | Limiting and Pagination |
limit | query | string | — | — | Limiting and Pagination |
Prefer | header | string | — | — | Preference |
Example
bash
curl "https://szkofkgbqogzlbqtcrke.supabase.co/rest/v1/role_permissions?select=*&limit=10" \
-H "apikey: YOUR_API_KEY" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"Responses
200OK
206Partial Content
postThe permissions for a role
Parameters
| Name | In | Type | Format | Required | Description |
|---|---|---|---|---|---|
role_permissions | body | object | — | — | role_permissions |
select | query | string | — | — | Filtering Columns |
Prefer | header | string | — | — | Preference |
Example
bash
curl -X POST "https://szkofkgbqogzlbqtcrke.supabase.co/rest/v1/role_permissions" \
-H "apikey: YOUR_API_KEY" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: return=representation" \
-d '{
"role": "example",
"permission": "roles.manage"
}'Responses
201Created
patchThe permissions for a role
Parameters
| Name | In | Type | Format | Required | Description |
|---|---|---|---|---|---|
id | query | string | — | — | — |
role | query | string | — | — | The role the permission is for |
permission | query | string | — | — | The permission for the role |
role_permissions | body | object | — | — | role_permissions |
Prefer | header | string | — | — | Preference |
Example
bash
curl -X PATCH "https://szkofkgbqogzlbqtcrke.supabase.co/rest/v1/role_permissions?id=eq.YOUR_ID" \
-H "apikey: YOUR_API_KEY" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Prefer: return=representation" \
-d '{"role": "example"}'Responses
204No Content
deleteThe permissions for a role
Parameters
| Name | In | Type | Format | Required | Description |
|---|---|---|---|---|---|
id | query | string | — | — | — |
role | query | string | — | — | The role the permission is for |
permission | query | string | — | — | The permission for the role |
Prefer | header | string | — | — | Preference |
Example
bash
curl -X DELETE "https://szkofkgbqogzlbqtcrke.supabase.co/rest/v1/role_permissions?id=eq.YOUR_ID" \
-H "apikey: YOUR_API_KEY" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"Responses
204No Content
Schema
The permissions for a role
| Column | Type | Format | Nullable | Default | Notes |
|---|---|---|---|---|---|
idPK | integer | bigint | — | — | This is a Primary Key. |
role | string | character varying | — | — | FK → roles.name |
permission | enum | public.app_permissions | — | — | roles.manage, billing.manage, settings.manage… |