{
  "basePath": "",
  "canonicalName": "Agent Identity Credentials",
  "ownerName": "Google",
  "auth": {
    "oauth2": {
      "scopes": {
        "https://www.googleapis.com/auth/cloud-platform": {
          "description": "See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account."
        }
      }
    }
  },
  "revision": "20260826",
  "version_module": true,
  "protocol": "rest",
  "servicePath": "",
  "batchPath": "batch",
  "fullyEncodeReservedExpansion": true,
  "ownerDomain": "google.com",
  "icons": {
    "x16": "http://www.google.com/images/icons/product/search-16.gif",
    "x32": "http://www.google.com/images/icons/product/search-32.gif"
  },
  "resources": {
    "projects": {
      "resources": {
        "locations": {
          "resources": {
            "authProviders": {
              "resources": {
                "credentials": {
                  "methods": {
                    "retrieve": {
                      "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/authProviders/{authProvidersId}/credentials:retrieve",
                      "id": "agentidentitycredentials.projects.locations.authProviders.credentials.retrieve",
                      "parameterOrder": [
                        "authProvider"
                      ],
                      "path": "v1alpha/{+authProvider}/credentials:retrieve",
                      "scopes": [
                        "https://www.googleapis.com/auth/cloud-platform"
                      ],
                      "httpMethod": "POST",
                      "description": "Retrieves authorization credentials for an auth provider, or indicates what action needs to be taken to obtain credentials. If the `token` field in the response is populated, credential retrieval was successful. If one of the fields in the `result` oneof is populated, further action is required to obtain credentials, such as redirecting the user for consent. View comments on `RetrieveCredentialsResponse` for more information.",
                      "response": {
                        "$ref": "GoogleCloudAgentidentitycredentialsV1alpha_RetrieveCredentialsResponse"
                      },
                      "parameters": {
                        "authProvider": {
                          "pattern": "^projects/[^/]+/locations/[^/]+/authProviders/[^/]+$",
                          "location": "path",
                          "description": "Required. The resource name of the auth provider. Format: `projects/{project}/locations/{location}/authProviders/{auth_provider}`",
                          "type": "string",
                          "required": true
                        }
                      },
                      "request": {
                        "$ref": "GoogleCloudAgentidentitycredentialsV1alpha_RetrieveCredentialsRequest"
                      }
                    },
                    "finalize": {
                      "parameterOrder": [
                        "authProvider"
                      ],
                      "httpMethod": "POST",
                      "request": {
                        "$ref": "GoogleCloudAgentidentitycredentialsV1alpha_FinalizeCredentialsRequest"
                      },
                      "id": "agentidentitycredentials.projects.locations.authProviders.credentials.finalize",
                      "path": "v1alpha/{+authProvider}/credentials:finalize",
                      "parameters": {
                        "authProvider": {
                          "type": "string",
                          "description": "Required. The resource name of the auth provider. Format: `projects/{project}/locations/{location}/authProviders/{auth_provider}`",
                          "location": "path",
                          "pattern": "^projects/[^/]+/locations/[^/]+/authProviders/[^/]+$",
                          "required": true
                        }
                      },
                      "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/authProviders/{authProvidersId}/credentials:finalize",
                      "response": {
                        "$ref": "GoogleCloudAgentidentitycredentialsV1alpha_FinalizeCredentialsResponse"
                      },
                      "description": "Finalizes the credentials after a successful consent flow.",
                      "scopes": [
                        "https://www.googleapis.com/auth/cloud-platform"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "schemas": {
    "GoogleCloudAgentidentitycredentialsV1alpha_ConsentRejected": {
      "id": "GoogleCloudAgentidentitycredentialsV1alpha_ConsentRejected",
      "description": "Indicates the user has rejected the permission delegation or canceled the request.",
      "type": "object",
      "properties": {}
    },
    "GoogleCloudAgentidentitycredentialsV1alpha_RetrieveCredentialsResponse": {
      "type": "object",
      "id": "GoogleCloudAgentidentitycredentialsV1alpha_RetrieveCredentialsResponse",
      "properties": {
        "uriConsentRequired": {
          "description": "Message indicating URI-based consent is required.",
          "$ref": "GoogleCloudAgentidentitycredentialsV1alpha_UriConsentRequired"
        },
        "success": {
          "description": "Message indicating credentials were successfully retrieved.",
          "$ref": "GoogleCloudAgentidentitycredentialsV1alpha_Success"
        },
        "consentRejected": {
          "$ref": "GoogleCloudAgentidentitycredentialsV1alpha_ConsentRejected",
          "description": "Message indicating consent was rejected."
        },
        "pending": {
          "description": "Message indicating credential retrieval is pending.",
          "$ref": "GoogleCloudAgentidentitycredentialsV1alpha_Pending"
        }
      },
      "description": "Response message for `RetrieveCredentials`. Contains the access tokens and related artifacts."
    },
    "GoogleCloudAgentidentitycredentialsV1alpha_UriConsentRequired": {
      "properties": {
        "authorizationUri": {
          "readOnly": true,
          "description": "Output only. The URL where the user should be redirected to grant consent. This will always be present.",
          "type": "string"
        },
        "uid": {
          "readOnly": true,
          "type": "string",
          "description": "Output only. The unique ID of the credentials retrieval operation."
        },
        "consentNonce": {
          "readOnly": true,
          "type": "string",
          "description": "Output only. A one-time, randomly generated value that validates the entire consent flow is handled by a single user, avoiding CSRF attacks. It must be submitted with the `FinalizeCredentials` request to complete the OAuth exchange. This will always be present. Implemented per [RFC 6819 Section 5.3.5](https://www.rfc-editor.org/rfc/rfc6819#section-5.3.5)."
        }
      },
      "description": "Indicates that the user must visit the provided URI to consent to delegate permission to the agent to act on their behalf. The caller can either poll the `RetrieveCredentials` method, or await the /ValidateUserId callback.",
      "id": "GoogleCloudAgentidentitycredentialsV1alpha_UriConsentRequired",
      "type": "object"
    },
    "GoogleCloudAgentidentitycredentialsV1alpha_RetrieveCredentialsRequest": {
      "id": "GoogleCloudAgentidentitycredentialsV1alpha_RetrieveCredentialsRequest",
      "properties": {
        "userId": {
          "type": "string",
          "description": "Required. The identity of the end user."
        },
        "scopes": {
          "type": "array",
          "description": "Optional. The OAuth scopes required for this access.",
          "items": {
            "type": "string"
          }
        },
        "continueUri": {
          "description": "Optional. The URI to redirect the user to after consent is completed. This field is required for auth providers using the 3-legged OAuth flow. For other auth provider types, this field is unused but not rejected.",
          "type": "string"
        },
        "forceRefreshToken": {
          "description": "Optional. Input only. Set this field only if the previous token was expired or invalid. This value must be the full, previously returned token string. Setting this field triggers a refresh of the access token with a stored refresh token, if possible, or a new consent flow.",
          "type": "string"
        }
      },
      "description": "Request message for `RetrieveCredentials`.",
      "type": "object"
    },
    "GoogleCloudAgentidentitycredentialsV1alpha_FinalizeCredentialsResponse": {
      "id": "GoogleCloudAgentidentitycredentialsV1alpha_FinalizeCredentialsResponse",
      "type": "object",
      "description": "Response message for `FinalizeCredentials`. Intentionally empty.",
      "properties": {}
    },
    "GoogleCloudAgentidentitycredentialsV1alpha_Success": {
      "properties": {
        "scopes": {
          "type": "array",
          "description": "The scopes actually associated with the retrieved token. End users may have rejected some requested scopes, or the third-party authorization servers can return a different set of scopes than what was asked for. Callers should verify that all required scopes for their intended use are included in this list.",
          "items": {
            "type": "string"
          }
        },
        "token": {
          "type": "string",
          "description": "The retrieved access token or credential for the end user. On an MCP tool call, for an invalid token the OAuth spec states that this should return `401` or `403`, but MCP servers may implement this differently. If you get any flavor of `PERMISSION_DENIED`, retry your original request to `RetrieveCredentials` with force_refresh_token set to the expired/invalid token string, which will fetch a new token or initiate a new consent flow."
        },
        "expireTime": {
          "description": "The expiration time of the token. This does not guarantee that the token will be valid until this time, since the token could be revoked earlier. There could also be clock skew between the auth provider and the client so it may expire slightly earlier. If not set, the token might be permanent or it may be that the service does not (or cannot) know when it will expire.",
          "type": "string",
          "format": "google-datetime"
        },
        "header": {
          "description": "The HTTP header name where the token should be placed.",
          "type": "string"
        }
      },
      "type": "object",
      "description": "Message indicating successful retrieval of credentials.",
      "id": "GoogleCloudAgentidentitycredentialsV1alpha_Success"
    },
    "GoogleCloudAgentidentitycredentialsV1alpha_FinalizeCredentialsRequest": {
      "description": "Request message for `FinalizeCredentials`.",
      "id": "GoogleCloudAgentidentitycredentialsV1alpha_FinalizeCredentialsRequest",
      "properties": {
        "userId": {
          "description": "Required. The identity of the end user.",
          "type": "string"
        },
        "consentNonce": {
          "description": "Required. The same `consent_nonce` value that was provided during retrieval in the [UriConsentRequired](https://cloud.google.com/iam/docs/reference/agentidentitycredentials/rest/v1/projects.locations.authProviders.credentials/retrieve#UriConsentRequired) metadata.",
          "type": "string"
        },
        "userIdValidationState": {
          "description": "Required. The encrypted state passed back from the consent flow.",
          "type": "string",
          "format": "byte"
        }
      },
      "type": "object"
    },
    "GoogleCloudAgentidentitycredentialsV1alpha_Pending": {
      "description": "Indicates that the credential retrieval is pending. The caller should retry the `RetrieveCredentials` request after some time.",
      "id": "GoogleCloudAgentidentitycredentialsV1alpha_Pending",
      "type": "object",
      "properties": {}
    }
  },
  "description": "The Agent Identity Credentials API retrieves and finalizes authorization credentials for auth providers.",
  "rootUrl": "https://agentidentitycredentials.googleapis.com/",
  "baseUrl": "https://agentidentitycredentials.googleapis.com/",
  "title": "Agent Identity Credentials API",
  "id": "agentidentitycredentials:v1alpha",
  "documentationLink": "https://cloud.google.com/iam/docs/",
  "discoveryVersion": "v1",
  "mtlsRootUrl": "https://agentidentitycredentials.mtls.googleapis.com/",
  "name": "agentidentitycredentials",
  "parameters": {
    "$.xgafv": {
      "enum": [
        "1",
        "2"
      ],
      "description": "V1 error format.",
      "type": "string",
      "location": "query",
      "enumDescriptions": [
        "v1 error format",
        "v2 error format"
      ]
    },
    "fields": {
      "location": "query",
      "type": "string",
      "description": "Selector specifying which fields to include in a partial response."
    },
    "prettyPrint": {
      "location": "query",
      "default": "true",
      "type": "boolean",
      "description": "Returns response with indentations and line breaks."
    },
    "access_token": {
      "location": "query",
      "description": "OAuth access token.",
      "type": "string"
    },
    "key": {
      "location": "query",
      "type": "string",
      "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token."
    },
    "callback": {
      "description": "JSONP",
      "location": "query",
      "type": "string"
    },
    "oauth_token": {
      "location": "query",
      "type": "string",
      "description": "OAuth 2.0 token for the current user."
    },
    "quotaUser": {
      "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.",
      "type": "string",
      "location": "query"
    },
    "uploadType": {
      "location": "query",
      "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
      "type": "string"
    },
    "upload_protocol": {
      "location": "query",
      "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
      "type": "string"
    },
    "alt": {
      "description": "Data format for response.",
      "type": "string",
      "enumDescriptions": [
        "Responses with Content-Type of application/json",
        "Media download with context-dependent Content-Type",
        "Responses with Content-Type of application/x-protobuf"
      ],
      "location": "query",
      "enum": [
        "json",
        "media",
        "proto"
      ],
      "default": "json"
    }
  },
  "kind": "discovery#restDescription",
  "version": "v1alpha"
}
