{
  "fullyEncodeReservedExpansion": true,
  "parameters": {
    "alt": {
      "type": "string",
      "location": "query",
      "enum": [
        "json",
        "media",
        "proto"
      ],
      "description": "Data format for response.",
      "default": "json",
      "enumDescriptions": [
        "Responses with Content-Type of application/json",
        "Media download with context-dependent Content-Type",
        "Responses with Content-Type of application/x-protobuf"
      ]
    },
    "oauth_token": {
      "description": "OAuth 2.0 token for the current user.",
      "location": "query",
      "type": "string"
    },
    "uploadType": {
      "location": "query",
      "type": "string",
      "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\")."
    },
    "quotaUser": {
      "location": "query",
      "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"
    },
    "$.xgafv": {
      "enumDescriptions": [
        "v1 error format",
        "v2 error format"
      ],
      "location": "query",
      "type": "string",
      "description": "V1 error format.",
      "enum": [
        "1",
        "2"
      ]
    },
    "fields": {
      "location": "query",
      "description": "Selector specifying which fields to include in a partial response.",
      "type": "string"
    },
    "access_token": {
      "description": "OAuth access token.",
      "type": "string",
      "location": "query"
    },
    "key": {
      "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",
      "type": "string"
    },
    "callback": {
      "location": "query",
      "description": "JSONP",
      "type": "string"
    },
    "prettyPrint": {
      "description": "Returns response with indentations and line breaks.",
      "default": "true",
      "location": "query",
      "type": "boolean"
    },
    "upload_protocol": {
      "type": "string",
      "description": "Upload protocol for media (e.g. \"raw\", \"multipart\").",
      "location": "query"
    }
  },
  "description": "The Agent Identity Credentials API retrieves and finalizes authorization credentials for auth providers.",
  "title": "Agent Identity Credentials API",
  "servicePath": "",
  "version": "v1alpha",
  "ownerDomain": "google.com",
  "mtlsRootUrl": "https://agentidentitycredentials.mtls.googleapis.com/",
  "discoveryVersion": "v1",
  "name": "agentidentitycredentials",
  "kind": "discovery#restDescription",
  "ownerName": "Google",
  "schemas": {
    "GoogleCloudAgentidentitycredentialsV1alpha_UriConsentRequired": {
      "properties": {
        "authorizationUri": {
          "readOnly": true,
          "type": "string",
          "description": "Output only. The URL where the user should be redirected to grant consent. This will always be present."
        },
        "consentNonce": {
          "readOnly": true,
          "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).",
          "type": "string"
        },
        "uid": {
          "description": "Output only. The unique ID of the credentials retrieval operation.",
          "readOnly": true,
          "type": "string"
        }
      },
      "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.",
      "type": "object",
      "id": "GoogleCloudAgentidentitycredentialsV1alpha_UriConsentRequired"
    },
    "GoogleCloudAgentidentitycredentialsV1alpha_Pending": {
      "type": "object",
      "description": "Indicates that the credential retrieval is pending. The caller should retry the `RetrieveCredentials` request after some time.",
      "id": "GoogleCloudAgentidentitycredentialsV1alpha_Pending",
      "properties": {}
    },
    "GoogleCloudAgentidentitycredentialsV1alpha_RetrieveCredentialsRequest": {
      "description": "Request message for `RetrieveCredentials`.",
      "type": "object",
      "properties": {
        "continueUri": {
          "type": "string",
          "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."
        },
        "userId": {
          "description": "Required. The identity of the end user.",
          "type": "string"
        },
        "forceRefreshToken": {
          "type": "string",
          "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."
        },
        "scopes": {
          "description": "Optional. The OAuth scopes required for this access.",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "id": "GoogleCloudAgentidentitycredentialsV1alpha_RetrieveCredentialsRequest"
    },
    "GoogleCloudAgentidentitycredentialsV1alpha_ExchangeCredentialsRequest": {
      "id": "GoogleCloudAgentidentitycredentialsV1alpha_ExchangeCredentialsRequest",
      "description": "Request message for `ExchangeCredentials`.",
      "type": "object",
      "properties": {
        "sourceCredential": {
          "description": "Required. The incoming identity or assertion token to be exchanged.",
          "type": "string"
        },
        "scopes": {
          "description": "Optional. The desired downstream OAuth scopes to request for the exchanged token.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "targetTokenType": {
          "enumDescriptions": [
            "Unspecified target token type. The service will apply default exchange semantics based on the target AuthProvider's configuration.",
            "Request an OAuth access token.",
            "Request an Identity Assertion Authorization Grant (ID-JAG) token."
          ],
          "type": "string",
          "description": "Optional. The desired target token type to be returned from the exchange. If unspecified, defaults to the token type configured on the AuthProvider.",
          "enum": [
            "TARGET_TOKEN_TYPE_UNSPECIFIED",
            "TARGET_TOKEN_TYPE_ACCESS_TOKEN",
            "TARGET_TOKEN_TYPE_ID_JAG"
          ]
        },
        "tokenBinding": {
          "$ref": "GoogleCloudAgentidentitycredentialsV1alpha_TokenBinding",
          "description": "Optional. The token binding parameters to be applied to downstream tokens and embedded into the ID-JAG assertion."
        }
      }
    },
    "GoogleCloudAgentidentitycredentialsV1alpha_FinalizeCredentialsRequest": {
      "properties": {
        "userId": {
          "type": "string",
          "description": "Required. The identity of the end user."
        },
        "userIdValidationState": {
          "description": "Required. The encrypted state passed back from the consent flow.",
          "type": "string",
          "format": "byte"
        },
        "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."
        }
      },
      "type": "object",
      "description": "Request message for `FinalizeCredentials`.",
      "id": "GoogleCloudAgentidentitycredentialsV1alpha_FinalizeCredentialsRequest"
    },
    "GoogleCloudAgentidentitycredentialsV1alpha_RetrieveCredentialsResponse": {
      "description": "Response message for `RetrieveCredentials`. Contains the access tokens and related artifacts.",
      "id": "GoogleCloudAgentidentitycredentialsV1alpha_RetrieveCredentialsResponse",
      "type": "object",
      "properties": {
        "uriConsentRequired": {
          "description": "Message indicating URI-based consent is required.",
          "$ref": "GoogleCloudAgentidentitycredentialsV1alpha_UriConsentRequired"
        },
        "success": {
          "$ref": "GoogleCloudAgentidentitycredentialsV1alpha_Success",
          "description": "Message indicating credentials were successfully retrieved."
        },
        "consentRejected": {
          "$ref": "GoogleCloudAgentidentitycredentialsV1alpha_ConsentRejected",
          "description": "Message indicating consent was rejected."
        },
        "pending": {
          "description": "Message indicating credential retrieval is pending.",
          "$ref": "GoogleCloudAgentidentitycredentialsV1alpha_Pending"
        }
      }
    },
    "GoogleCloudAgentidentitycredentialsV1alpha_ExchangeCredentialsResponse": {
      "id": "GoogleCloudAgentidentitycredentialsV1alpha_ExchangeCredentialsResponse",
      "properties": {
        "scopes": {
          "description": "The scopes actually associated with the retrieved token.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "token": {
          "type": "string",
          "description": "The user-consented workforce access token resulting from the exchange."
        },
        "acquireTime": {
          "format": "google-datetime",
          "description": "Optional. The time when the token was acquired.",
          "type": "string"
        },
        "expireTime": {
          "description": "Optional. The expiration time of the exchanged access token.",
          "type": "string",
          "format": "google-datetime"
        }
      },
      "description": "Response message for `ExchangeCredentials` containing the resulting credentials.",
      "type": "object"
    },
    "GoogleCloudAgentidentitycredentialsV1alpha_TokenBinding": {
      "properties": {
        "certificateFingerprint": {
          "type": "string",
          "description": "Optional. The base64url-encoded SHA-256 hash of the DER-encoded X.509 client certificate, as defined in RFC 8705 Section 3.1 (corresponding to \"x5t#S256\"). Format requirements: - Base64url encoding (RFC 4648 Section 5) using URL-safe characters ('-' and '_') without padding ('='). - Exactly 43 characters long for a 256-bit SHA-256 digest."
        }
      },
      "description": "Configuration for binding downstream credentials to client communication channel properties.",
      "id": "GoogleCloudAgentidentitycredentialsV1alpha_TokenBinding",
      "type": "object"
    },
    "GoogleCloudAgentidentitycredentialsV1alpha_Success": {
      "type": "object",
      "properties": {
        "header": {
          "type": "string",
          "description": "The HTTP header name where the token should be placed."
        },
        "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"
          }
        },
        "expireTime": {
          "type": "string",
          "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.",
          "format": "google-datetime"
        },
        "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."
        }
      },
      "id": "GoogleCloudAgentidentitycredentialsV1alpha_Success",
      "description": "Message indicating successful retrieval of credentials."
    },
    "GoogleCloudAgentidentitycredentialsV1alpha_FinalizeCredentialsResponse": {
      "description": "Response message for `FinalizeCredentials`. Intentionally empty.",
      "id": "GoogleCloudAgentidentitycredentialsV1alpha_FinalizeCredentialsResponse",
      "type": "object",
      "properties": {}
    },
    "GoogleCloudAgentidentitycredentialsV1alpha_ConsentRejected": {
      "type": "object",
      "properties": {},
      "id": "GoogleCloudAgentidentitycredentialsV1alpha_ConsentRejected",
      "description": "Indicates the user has rejected the permission delegation or canceled the request."
    }
  },
  "baseUrl": "https://agentidentitycredentials.googleapis.com/",
  "basePath": "",
  "revision": "20261201",
  "id": "agentidentitycredentials:v1alpha",
  "batchPath": "batch",
  "protocol": "rest",
  "resources": {
    "projects": {
      "resources": {
        "locations": {
          "resources": {
            "authProviders": {
              "resources": {
                "credentials": {
                  "methods": {
                    "retrieve": {
                      "scopes": [
                        "https://www.googleapis.com/auth/cloud-platform"
                      ],
                      "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.",
                      "httpMethod": "POST",
                      "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/authProviders/{authProvidersId}/credentials:retrieve",
                      "response": {
                        "$ref": "GoogleCloudAgentidentitycredentialsV1alpha_RetrieveCredentialsResponse"
                      },
                      "parameterOrder": [
                        "authProvider"
                      ],
                      "parameters": {
                        "authProvider": {
                          "description": "Required. The resource name of the auth provider. Format: `projects/{project}/locations/{location}/authProviders/{auth_provider}`",
                          "required": true,
                          "location": "path",
                          "type": "string",
                          "pattern": "^projects/[^/]+/locations/[^/]+/authProviders/[^/]+$"
                        }
                      },
                      "request": {
                        "$ref": "GoogleCloudAgentidentitycredentialsV1alpha_RetrieveCredentialsRequest"
                      },
                      "id": "agentidentitycredentials.projects.locations.authProviders.credentials.retrieve",
                      "path": "v1alpha/{+authProvider}/credentials:retrieve"
                    },
                    "exchange": {
                      "parameterOrder": [
                        "authProvider"
                      ],
                      "response": {
                        "$ref": "GoogleCloudAgentidentitycredentialsV1alpha_ExchangeCredentialsResponse"
                      },
                      "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/authProviders/{authProvidersId}/credentials:exchange",
                      "request": {
                        "$ref": "GoogleCloudAgentidentitycredentialsV1alpha_ExchangeCredentialsRequest"
                      },
                      "description": "Swaps an input credential for a target credential as per the rules and provider defined in the given auth provider.",
                      "httpMethod": "POST",
                      "scopes": [
                        "https://www.googleapis.com/auth/cloud-platform"
                      ],
                      "path": "v1alpha/{+authProvider}/credentials:exchange",
                      "id": "agentidentitycredentials.projects.locations.authProviders.credentials.exchange",
                      "parameters": {
                        "authProvider": {
                          "description": "Required. The resource name of the auth provider. Format: `projects/{project}/locations/{location}/authProviders/{auth_provider}`",
                          "type": "string",
                          "location": "path",
                          "required": true,
                          "pattern": "^projects/[^/]+/locations/[^/]+/authProviders/[^/]+$"
                        }
                      }
                    },
                    "finalize": {
                      "request": {
                        "$ref": "GoogleCloudAgentidentitycredentialsV1alpha_FinalizeCredentialsRequest"
                      },
                      "httpMethod": "POST",
                      "scopes": [
                        "https://www.googleapis.com/auth/cloud-platform"
                      ],
                      "id": "agentidentitycredentials.projects.locations.authProviders.credentials.finalize",
                      "path": "v1alpha/{+authProvider}/credentials:finalize",
                      "parameterOrder": [
                        "authProvider"
                      ],
                      "response": {
                        "$ref": "GoogleCloudAgentidentitycredentialsV1alpha_FinalizeCredentialsResponse"
                      },
                      "flatPath": "v1alpha/projects/{projectsId}/locations/{locationsId}/authProviders/{authProvidersId}/credentials:finalize",
                      "parameters": {
                        "authProvider": {
                          "description": "Required. The resource name of the auth provider. Format: `projects/{project}/locations/{location}/authProviders/{auth_provider}`",
                          "location": "path",
                          "required": true,
                          "type": "string",
                          "pattern": "^projects/[^/]+/locations/[^/]+/authProviders/[^/]+$"
                        }
                      },
                      "description": "Finalizes the credentials after a successful consent flow."
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "canonicalName": "Agent Identity Credentials",
  "icons": {
    "x16": "http://www.google.com/images/icons/product/search-16.gif",
    "x32": "http://www.google.com/images/icons/product/search-32.gif"
  },
  "version_module": true,
  "rootUrl": "https://agentidentitycredentials.googleapis.com/",
  "documentationLink": "https://cloud.google.com/iam/docs/",
  "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."
        }
      }
    }
  }
}
