Google

Organization Policy API

The Organization Policy API allows users to configure governance rules on their Google Cloud resources across the resource hierarchy.

Developer tools#openapi#analytics#media

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

The Organization Policy API allows users to configure governance rules on their Google Cloud resources across the resource hierarchy.

Endpoints 9

projects.constraints

  • GETLists constraints that could be applied on the specified resource./v2/:parent/constraints?pageSize=0&pageToken=stringLists constraints that could be applied on the specified resource.

projects.policies

  • GETRetrieves all of the policies that exist on a particular resource./v2/:parent/policies?pageSize=0&pageToken=stringRetrieves all of the policies that exist on a particular resource.
  • POSTCreates a policy/v2/:parent/policiesCreates a policy. Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the constraint does not exist. Returns a google.rpc.Status with…
  • GETGets a policy on a resource/v2/:nameGets a policy on a resource. If no policy is set on the resource, NOT_FOUND is returned. The entity tag (ETag) can be used with UpdatePolicy() to update a…
  • DELETEDeletes a policy/v2/:name?etag=stringDeletes a policy. Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the constraint or organization policy does not exist.
  • PATCHUpdates a policy/v2/:name?updateMask=stringUpdates a policy. Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the constraint or the policy doesn't exist. Returns a google.rpc.Status with…
  • GETGets the effective policy on a resource/v2/:name:getEffectivePolicyGets the effective policy on a resource. This is the result of merging policies in the resource hierarchy and evaluating conditions. The returned policy will…

organizations.customConstraints

  • GETRetrieves all of the custom constraints that exist on a particular organization resource./v2/:parent/customConstraints?pageSize=0&pageToken=stringRetrieves all of the custom constraints that exist on a particular organization resource.
  • POSTCreates a custom constraint/v2/:parent/customConstraintsCreates a custom constraint. Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the organization does not exist. Returns a google.rpc.Status with…

API details

Base URL
https://orgpolicy.googleapis.com
Authentication
OAuth 2.0 (authorization code flow) with 3 scopes
An API key in the key query parameter
Operations
9 operations on 5 pathsGET 5POST 2PATCH 1DELETE 1
Main resources
projects.policies 6organizations.customConstraints 2projects.constraints 1
Response formats
application/json
Description format
Google API Discovery, API version v2

How to test the Organization Policy API in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the Organization Policy API collection, without the publisher's secrets.
  3. Add your credentialsThis API uses OAuth 2.0 (authorization code flow) with 3 scopes. Add yours in the collection's variables or an environment; the requests already reference it.
  4. Send a requestPick an endpoint, for example “Lists constraints that could be applied on the specified resource.” (GET /v2/:parent/constraints?pageSize=0&pageToken=string), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the Organization Policy API?

The Organization Policy API allows users to configure governance rules on their Google Cloud resources across the resource hierarchy. It is listed under Developer tools and has 9 endpoints.

Who publishes the Organization Policy API?

It is listed from Google's public API description (an OpenAPI document), not published by Google on Swastik Codes. Anyone who controls googleapis.com can claim the profile by adding a DNS TXT record.

What is the base URL of the Organization Policy API?

Requests go to https://orgpolicy.googleapis.com. Endpoint paths are added to this base URL.

How do I authenticate with the Organization Policy API?

It accepts 2 methods: OAuth 2.0 (authorization code flow) with 3 scopes; an API key in the key query parameter.

How many endpoints does the Organization Policy API have?

9 operations on 5 paths (5 GET, 2 POST, 1 PATCH, 1 DELETE). The largest groups are projects.policies, organizations.customConstraints, projects.constraints.

Is forking the Organization Policy API free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.