https://cerbos.dev logo
Title
a

ANILA SOMAN

05/10/2023, 9:15 AM
Hi - Is it possible to do CRUD operation of policies using API? Especially update and delete policies
a

Andrew Haines (Cerbos)

05/10/2023, 9:23 AM
Assuming you are storing your policies in a database (using the sqlite3, mysql, or postgres storage drivers), then yes: https://docs.cerbos.dev/cerbos/latest/api/admin_api.html You can't delete policies, but you can disable them which has the same effect.
a

ANILA SOMAN

05/10/2023, 9:31 AM
Yes we are using mysql
a

Andrew Haines (Cerbos)

05/10/2023, 9:38 AM
Cool, then you'll just need to enable the admin API in your Cerbos server config. Are you using the Go SDK? It has an AdminClient to handle the API interactions.
a

ANILA SOMAN

05/10/2023, 9:38 AM
yes using Go SDK
@Andrew Haines (Cerbos) Thanks for the update