← Back to API Reference

/role_permissions

Tag: role_permissions

getThe permissions for a role

Parameters

NameInTypeFormatRequiredDescription
idquerystring
rolequerystringThe role the permission is for
permissionquerystringThe permission for the role
selectquerystringFiltering Columns
orderquerystringOrdering
RangeheaderstringLimiting and Pagination
Range-UnitheaderstringLimiting and Pagination
offsetquerystringLimiting and Pagination
limitquerystringLimiting and Pagination
PreferheaderstringPreference

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

NameInTypeFormatRequiredDescription
role_permissionsbodyobjectrole_permissions
selectquerystringFiltering Columns
PreferheaderstringPreference

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

NameInTypeFormatRequiredDescription
idquerystring
rolequerystringThe role the permission is for
permissionquerystringThe permission for the role
role_permissionsbodyobjectrole_permissions
PreferheaderstringPreference

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

NameInTypeFormatRequiredDescription
idquerystring
rolequerystringThe role the permission is for
permissionquerystringThe permission for the role
PreferheaderstringPreference

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

ColumnTypeFormatNullableDefaultNotes
idPK
integerbigintThis is a Primary Key.
role
stringcharacter varyingFK → roles.name
permission
enumpublic.app_permissionsroles.manage, billing.manage, settings.manage