Delete a policy

A policy is an authorization rule that controls which principals may perform which actions on matching resources. Policies connect identities to allowed operations on objects and other API resources.

Deletes the policy identified by the policy query parameter. The request has no body, and a successful deletion returns 204 No Content.

Deleting a policy removes that access definition. Use Get a policy to review it before deletion, then List policies to confirm that it is no longer returned.

An unknown identifier returns 404. For 401 or 403, check the x-api-key header and whether that key can delete the policy.

DELETE
{{host}}/v1/policy?policy={{policy}}
VERB:DELETE
BASE URL:{{host}}/v1/policy
QUERY STRING:?policy={{policy}}

Query parameters#

  • policystring
    Required

    Unique identifier of the policy in the URL.

    example: all

Headers#

Send these headers with the request. Names are case-insensitive per HTTP rules.
  • x-api-keyRequired

    Your BigState API key.

    {{apiKey}}
  • Content-TypeRequired

    MIME type of the request body.

    application/json
  • AcceptRequired

    MIME types the client can understand in the response.

    application/json

Need a session token? See Token sign in.

  • 204Response body · no content

    The policy was deleted.

  • 401

    Unauthorized.

  • 403

    Access denied. The caller does not have sufficient rights to perform this operation.

  • 404

    No policy exists for the given identifier.

  • 400Response body · object

    Bad request.

    {
    "error": 6,
    "desc": "Invalid request"
    }
    • errornumber

      Numeric error code. Use the response `desc` field for the human-readable explanation.

    • descstring

      Human-readable description of the error.

Delete a policy

Remove a policy by identifier (query only). Success: 204, no body.

curl https://api.bigstate.dev/v1/policy?policy=all \
--request DELETE \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json'

© 2024 BigState