---
title: "POST /v1/organizations/{organizationsId}/locations/{locationsId}:enrollResource"
method: POST
path: "/v1/organizations/{organizationsId}/locations/{locationsId}:enrollResource"
tags: ["organizations"]
---

# POST /v1/organizations/{organizationsId}/locations/{locationsId}:enrollResource

`POST /v1/organizations/{organizationsId}/locations/{locationsId}:enrollResource`

## Request

- Base URL: `https://auditmanager.googleapis.com`
- URL: `https://auditmanager.googleapis.com/v1/organizations/{organizationsId}/locations/{locationsId}:enrollResource`
- Auth: one of:
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud-auditmanager`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-auditmanager`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud-platform`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`

Adds your project, folder, or organization to Audit Manager. This method creates the Audit Manager service agent in your workload and grants required permissions to the service agent. If you make this request on a workload that's already enrolled, then this method overrides the existing set of destinations.

## Path parameters

- `organizationsId` string, required
- `locationsId` string, required

## Query parameters

- `$.xgafv` '1' | '2'
- `access_token` string
- `alt` 'json' | 'media' | 'proto'
- `callback` string
- `fields` string
- `key` string
- `oauth_token` string
- `prettyPrint` boolean
- `quotaUser` string
- `uploadType` string
- `upload_protocol` string

## Request body

- EnrollResourceRequest: Request message for EnrollResource.
  - `destinations` EligibleDestination[]: Required. Cloud Storage buckets that you can upload your audit reports to during the audit process. When you enroll an organization or folder, you can choose a Cloud Storage bucket from any project in the organization or folder. If you run an audit at the project level using the service agent at the organization or folder level, all the buckets that are associated with the service agent are available.
    - `eligibleGcsBucket` string: The location of the Cloud Storage bucket where you want to upload the audit report and evidence during the GenerateAuditReport API call.
  - `validateOnly` boolean: Optional. If `true`, only validates the request and does not enroll the resource. This executes standard request validation (such as schema, IAM, and destination checks) and skips the apply phase. Use this field for the following purposes: * **Infrastructure as Code (IaC)**: Allow tools like Terraform to run dry-run mutations (e.g., `terraform plan`) without creating real resources or incurring costs. * **User Interface Validation**: Enable real-time form and permission validation in custom UIs before submitting requests. * **CI/CD & Automation**: Test your scripts, permissions, and parameters safely without consuming resource quotas.

## Response `200`

Successful response

- Enrollment: Organization, folder, or project to enroll for audit reports.
  - `destinationDetails` DestinationDetails[]: Output only. Cloud Storage buckets where you want to upload the audit reports.
    - `gcsBucketUri` string: URI for the Cloud Storage bucket, in the format `gs://{bucket_name}`.
  - `name` string: Identifier. Name of the enrollment, in one of the following formats: * `projects/{project}/locations/{location}/enrollments/{enrollment}` * `folders/{folder}/locations/{location}/enrollments/{enrollment}` * `organizations/{organization}/locations/{location}/enrollments/{enrollment}`

## Changes

- **2026-11-18** `8e1ab1224a21`: 4 info
  - the security scope `https://www.googleapis.com/auth/cloud-auditmanager` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-auditmanager` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2c`
- **2026-11-04** `18e8b165f65f`: 4 info
  - the security scope `https://www.googleapis.com/auth/cloud-auditmanager` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-auditmanager` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was removed from the endpoint's security scheme `Oauth2c`

[Operation history](https://skmtc.dev/google/apis/auditmanager/changes/v1/organizations/:organizationsId/locations/:locationsId:enrollResource/post.md)

---

[API](https://skmtc.dev/google/apis/auditmanager.md) - [All operations](https://skmtc.dev/google/apis/auditmanager/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/auditmanager/revisions/8e1ab1224a21?raw)
