{
  "documentationLink": "https://cloud.google.com/iam/docs/",
  "rootUrl": "https://agentidentitycredentials.googleapis.com/",
  "baseUrl": "https://agentidentitycredentials.googleapis.com/",
  "basePath": "",
  "ownerDomain": "google.com",
  "parameters": {
    "fields": {
      "type": "string",
      "description": "Selector specifying which fields to include in a partial response.",
      "location": "query"
    },
    "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.",
      "location": "query",
      "type": "string"
    },
    "oauth_token": {
      "description": "OAuth 2.0 token for the current user.",
      "location": "query",
      "type": "string"
    },
    "alt": {
      "description": "Data format for response.",
      "default": "json",
      "location": "query",
      "type": "string",
      "enum": [
        "json",
        "media",
        "proto"
      ],
      "enumDescriptions": [
        "Responses with Content-Type of application/json",
        "Media download with context-dependent Content-Type",
        "Responses with Content-Type of application/x-protobuf"
      ]
    },
    "upload_protocol": {
      "location": "query",
      "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
      "type": "string"
    },
    "callback": {
      "description": "JSONP",
      "location": "query",
      "type": "string"
    },
    "key": {
      "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.",
      "location": "query"
    },
    "uploadType": {
      "location": "query",
      "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
      "type": "string"
    },
    "access_token": {
      "location": "query",
      "description": "OAuth access token.",
      "type": "string"
    },
    "$.xgafv": {
      "location": "query",
      "enumDescriptions": [
        "v1 error format",
        "v2 error format"
      ],
      "type": "string",
      "description": "V1 error format.",
      "enum": [
        "1",
        "2"
      ]
    },
    "prettyPrint": {
      "description": "Returns response with indentations and line breaks.",
      "default": "true",
      "type": "boolean",
      "location": "query"
    }
  },
  "protocol": "rest",
  "description": "The Agent Identity Credentials API retrieves and finalizes authorization credentials for auth providers.",
  "id": "agentidentitycredentials:v1",
  "discoveryVersion": "v1",
  "resources": {
    "projects": {
      "resources": {
        "locations": {
          "resources": {
            "authProviders": {
              "resources": {
                "credentials": {
                  "methods": {
                    "retrieve": {
                      "parameterOrder": [
                        "authProvider"
                      ],
                      "scopes": [
                        "https://www.googleapis.com/auth/cloud-platform"
                      ],
                      "response": {
                        "$ref": "GoogleCloudAgentidentitycredentialsV1_RetrieveCredentialsResponse"
                      },
                      "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.",
                      "request": {
                        "$ref": "GoogleCloudAgentidentitycredentialsV1_RetrieveCredentialsRequest"
                      },
                      "httpMethod": "POST",
                      "id": "agentidentitycredentials.projects.locations.authProviders.credentials.retrieve",
                      "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/authProviders/{authProvidersId}/credentials:retrieve",
                      "path": "v1/{+authProvider}/credentials:retrieve",
                      "parameters": {
                        "authProvider": {
                          "description": "Required. The resource name of the auth provider. Format: `projects/{project}/locations/{location}/authProviders/{auth_provider}`",
                          "type": "string",
                          "pattern": "^projects/[^/]+/locations/[^/]+/authProviders/[^/]+$",
                          "required": true,
                          "location": "path"
                        }
                      }
                    },
                    "finalize": {
                      "parameters": {
                        "authProvider": {
                          "description": "Required. The resource name of the auth provider. Format: `projects/{project}/locations/{location}/authProviders/{auth_provider}`",
                          "type": "string",
                          "required": true,
                          "pattern": "^projects/[^/]+/locations/[^/]+/authProviders/[^/]+$",
                          "location": "path"
                        }
                      },
                      "response": {
                        "$ref": "GoogleCloudAgentidentitycredentialsV1_FinalizeCredentialsResponse"
                      },
                      "scopes": [
                        "https://www.googleapis.com/auth/cloud-platform"
                      ],
                      "id": "agentidentitycredentials.projects.locations.authProviders.credentials.finalize",
                      "path": "v1/{+authProvider}/credentials:finalize",
                      "httpMethod": "POST",
                      "description": "Finalizes the credentials after a successful consent flow.",
                      "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/authProviders/{authProvidersId}/credentials:finalize",
                      "request": {
                        "$ref": "GoogleCloudAgentidentitycredentialsV1_FinalizeCredentialsRequest"
                      },
                      "parameterOrder": [
                        "authProvider"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "title": "Agent Identity Credentials API",
  "name": "agentidentitycredentials",
  "mtlsRootUrl": "https://agentidentitycredentials.mtls.googleapis.com/",
  "ownerName": "Google",
  "kind": "discovery#restDescription",
  "version": "v1",
  "batchPath": "batch",
  "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."
        }
      }
    }
  },
  "servicePath": "",
  "fullyEncodeReservedExpansion": true,
  "canonicalName": "Agent Identity Credentials",
  "version_module": true,
  "icons": {
    "x16": "http://www.google.com/images/icons/product/search-16.gif",
    "x32": "http://www.google.com/images/icons/product/search-32.gif"
  },
  "revision": "20260826",
  "schemas": {
    "GoogleCloudAgentidentitycredentialsV1_Success": {
      "id": "GoogleCloudAgentidentitycredentialsV1_Success",
      "description": "Message indicating successful retrieval of credentials.",
      "properties": {
        "header": {
          "description": "The HTTP header name where the token should be placed.",
          "type": "string"
        },
        "scopes": {
          "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.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "token": {
          "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.",
          "type": "string"
        },
        "expireTime": {
          "type": "string",
          "format": "google-datetime",
          "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": "object"
    },
    "GoogleCloudAgentidentitycredentialsV1_FinalizeCredentialsRequest": {
      "properties": {
        "consentNonce": {
          "type": "string",
          "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."
        },
        "userIdValidationState": {
          "type": "string",
          "description": "Required. The encrypted state passed back from the consent flow.",
          "format": "byte"
        },
        "userId": {
          "type": "string",
          "description": "Required. The identity of the end user."
        }
      },
      "id": "GoogleCloudAgentidentitycredentialsV1_FinalizeCredentialsRequest",
      "description": "Request message for `FinalizeCredentials`.",
      "type": "object"
    },
    "GoogleCloudAgentidentitycredentialsV1_ConsentRejected": {
      "properties": {},
      "type": "object",
      "description": "Indicates the user has rejected the permission delegation or canceled the request.",
      "id": "GoogleCloudAgentidentitycredentialsV1_ConsentRejected"
    },
    "GoogleCloudAgentidentitycredentialsV1_FinalizeCredentialsResponse": {
      "type": "object",
      "properties": {},
      "id": "GoogleCloudAgentidentitycredentialsV1_FinalizeCredentialsResponse",
      "description": "Response message for `FinalizeCredentials`. Intentionally empty."
    },
    "GoogleCloudAgentidentitycredentialsV1_RetrieveCredentialsRequest": {
      "description": "Request message for `RetrieveCredentials`.",
      "properties": {
        "scopes": {
          "description": "Optional. The OAuth scopes required for this access.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "userId": {
          "type": "string",
          "description": "Required. The identity of the end user."
        },
        "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"
        },
        "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"
        }
      },
      "id": "GoogleCloudAgentidentitycredentialsV1_RetrieveCredentialsRequest",
      "type": "object"
    },
    "GoogleCloudAgentidentitycredentialsV1_RetrieveCredentialsResponse": {
      "description": "Response message for `RetrieveCredentials`. Contains the access tokens and related artifacts.",
      "type": "object",
      "id": "GoogleCloudAgentidentitycredentialsV1_RetrieveCredentialsResponse",
      "properties": {
        "consentRejected": {
          "description": "Message indicating consent was rejected.",
          "$ref": "GoogleCloudAgentidentitycredentialsV1_ConsentRejected"
        },
        "success": {
          "$ref": "GoogleCloudAgentidentitycredentialsV1_Success",
          "description": "Message indicating credentials were successfully retrieved."
        },
        "pending": {
          "description": "Message indicating credential retrieval is pending.",
          "$ref": "GoogleCloudAgentidentitycredentialsV1_Pending"
        },
        "uriConsentRequired": {
          "description": "Message indicating URI-based consent is required.",
          "$ref": "GoogleCloudAgentidentitycredentialsV1_UriConsentRequired"
        }
      }
    },
    "GoogleCloudAgentidentitycredentialsV1_Pending": {
      "id": "GoogleCloudAgentidentitycredentialsV1_Pending",
      "properties": {},
      "description": "Indicates that the credential retrieval is pending. The caller should retry the `RetrieveCredentials` request after some time.",
      "type": "object"
    },
    "GoogleCloudAgentidentitycredentialsV1_UriConsentRequired": {
      "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": "GoogleCloudAgentidentitycredentialsV1_UriConsentRequired",
      "properties": {
        "consentNonce": {
          "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).",
          "readOnly": true
        },
        "uid": {
          "readOnly": true,
          "description": "Output only. The unique ID of the credentials retrieval operation.",
          "type": "string"
        },
        "authorizationUri": {
          "type": "string",
          "description": "Output only. The URL where the user should be redirected to grant consent. This will always be present.",
          "readOnly": true
        }
      },
      "type": "object"
    }
  }
}
