{
  "discoveryVersion": "v1",
  "name": "gmailpostmastertools",
  "baseUrl": "https://gmailpostmastertools.googleapis.com/",
  "servicePath": "",
  "mtlsRootUrl": "https://gmailpostmastertools.mtls.googleapis.com/",
  "title": "Gmail Postmaster Tools API",
  "revision": "20260630",
  "version": "v2",
  "canonicalName": "Postmaster Tools",
  "basePath": "",
  "parameters": {
    "callback": {
      "location": "query",
      "type": "string",
      "description": "JSONP"
    },
    "prettyPrint": {
      "type": "boolean",
      "location": "query",
      "description": "Returns response with indentations and line breaks.",
      "default": "true"
    },
    "upload_protocol": {
      "location": "query",
      "type": "string",
      "description": "Upload protocol for media (e.g. \"raw\", \"multipart\")."
    },
    "uploadType": {
      "description": "Legacy upload protocol for media (e.g. \"media\", \"multipart\").",
      "location": "query",
      "type": "string"
    },
    "oauth_token": {
      "type": "string",
      "location": "query",
      "description": "OAuth 2.0 token for the current user."
    },
    "alt": {
      "enum": [
        "json",
        "media",
        "proto"
      ],
      "description": "Data format for response.",
      "location": "query",
      "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"
      ],
      "type": "string"
    },
    "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"
    },
    "fields": {
      "description": "Selector specifying which fields to include in a partial response.",
      "type": "string",
      "location": "query"
    },
    "access_token": {
      "location": "query",
      "type": "string",
      "description": "OAuth access token."
    },
    "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.",
      "type": "string",
      "location": "query"
    },
    "$.xgafv": {
      "enum": [
        "1",
        "2"
      ],
      "description": "V1 error format.",
      "location": "query",
      "enumDescriptions": [
        "v1 error format",
        "v2 error format"
      ],
      "type": "string"
    }
  },
  "rootUrl": "https://gmailpostmastertools.googleapis.com/",
  "id": "gmailpostmastertools:v2",
  "protocol": "rest",
  "ownerName": "Google",
  "resources": {
    "domains": {
      "methods": {
        "list": {
          "id": "gmailpostmastertools.domains.list",
          "parameters": {
            "pageSize": {
              "description": "Optional. Requested page size. Server may return fewer domains than requested. If unspecified, the default value for this field is 10. The maximum value for this field is 200.",
              "location": "query",
              "format": "int32",
              "type": "integer"
            },
            "pageToken": {
              "type": "string",
              "location": "query",
              "description": "Optional. The next_page_token value returned from a previous List request, if any."
            }
          },
          "scopes": [
            "https://www.googleapis.com/auth/postmaster",
            "https://www.googleapis.com/auth/postmaster.domain"
          ],
          "response": {
            "$ref": "ListDomainsResponse"
          },
          "description": "Retrieves a list of all domains registered by you, along with their corresponding metadata. The order of domains in the response is unspecified and non-deterministic. Newly registered domains will not necessarily be added to the end of this list.",
          "parameterOrder": [],
          "path": "v2/domains",
          "flatPath": "v2/domains",
          "httpMethod": "GET"
        },
        "delete": {
          "parameters": {
            "name": {
              "location": "path",
              "description": "Required. The domain to delete.",
              "type": "string",
              "pattern": "^domains/[^/]+$",
              "required": true
            }
          },
          "id": "gmailpostmastertools.domains.delete",
          "response": {
            "$ref": "Empty"
          },
          "description": "[Developer Preview](https://developers.google.com/workspace/preview): Deletes a domain from the user's account. Returns NOT_FOUND if the domain is not registered by the user.",
          "scopes": [
            "https://www.googleapis.com/auth/postmaster",
            "https://www.googleapis.com/auth/postmaster.domain"
          ],
          "parameterOrder": [
            "name"
          ],
          "flatPath": "v2/domains/{domainsId}",
          "path": "v2/{+name}",
          "httpMethod": "DELETE"
        },
        "verify": {
          "request": {
            "$ref": "VerifyDomainRequest"
          },
          "response": {
            "$ref": "VerifyDomainResponse"
          },
          "description": "[Developer Preview](https://developers.google.com/workspace/preview): Verifies a user's ownership of a domain at the DNS level. Note that this is distinct from checking if the user has OWNER status within IRDB.",
          "scopes": [
            "https://www.googleapis.com/auth/postmaster",
            "https://www.googleapis.com/auth/postmaster.domain"
          ],
          "parameters": {
            "name": {
              "location": "path",
              "description": "Required. The domain to verify.",
              "type": "string",
              "pattern": "^domains/[^/]+$",
              "required": true
            }
          },
          "id": "gmailpostmastertools.domains.verify",
          "httpMethod": "POST",
          "flatPath": "v2/domains/{domainsId}:verify",
          "path": "v2/{+name}:verify",
          "parameterOrder": [
            "name"
          ]
        },
        "get": {
          "parameters": {
            "name": {
              "location": "path",
              "description": "Required. The resource name of the domain. Format: `domains/{domain_name}`, where domain_name is the fully qualified domain name (i.e., mymail.mydomain.com).",
              "type": "string",
              "pattern": "^domains/[^/]+$",
              "required": true
            }
          },
          "id": "gmailpostmastertools.domains.get",
          "response": {
            "$ref": "Domain"
          },
          "description": "Retrieves detailed information about a domain registered by you. Returns NOT_FOUND if the domain is not registered by you. Domain represents the metadata of a domain that has been registered within the system and linked to a user.",
          "scopes": [
            "https://www.googleapis.com/auth/postmaster",
            "https://www.googleapis.com/auth/postmaster.domain"
          ],
          "parameterOrder": [
            "name"
          ],
          "httpMethod": "GET",
          "flatPath": "v2/domains/{domainsId}",
          "path": "v2/{+name}"
        },
        "getVerificationToken": {
          "parameters": {
            "name": {
              "description": "Required. The resource name of the verification token to retrieve. Format: `domains/{domain}/verificationToken`",
              "location": "path",
              "pattern": "^domains/[^/]+/verificationToken$",
              "required": true,
              "type": "string"
            },
            "verificationMethod": {
              "description": "Required. The verification method used. Must be specified, i.e. TXT or CNAME.",
              "enum": [
                "DOMAIN_VERIFICATION_METHOD_UNSPECIFIED",
                "TXT",
                "CNAME"
              ],
              "location": "query",
              "enumDescriptions": [
                "Unspecified.",
                "Generate a DNS TXT verification token.",
                "Generate a DNS CNAME verification token."
              ],
              "type": "string"
            }
          },
          "id": "gmailpostmastertools.domains.getVerificationToken",
          "response": {
            "$ref": "DomainVerificationToken"
          },
          "description": "[Developer Preview](https://developers.google.com/workspace/preview): Gets a verification token used for verifying a user's ownership over a domain.",
          "scopes": [
            "https://www.googleapis.com/auth/postmaster",
            "https://www.googleapis.com/auth/postmaster.domain"
          ],
          "parameterOrder": [
            "name"
          ],
          "httpMethod": "GET",
          "flatPath": "v2/domains/{domainsId}/verificationToken",
          "path": "v2/{+name}"
        },
        "create": {
          "request": {
            "$ref": "CreateDomainRequest"
          },
          "response": {
            "$ref": "Domain"
          },
          "description": "[Developer Preview](https://developers.google.com/workspace/preview): Adds a domain to the user's account. Returns INVALID_ARGUMENT if a domain is not provided. Returns ALREADY_EXISTS if the domain is already registered by the user.",
          "scopes": [
            "https://www.googleapis.com/auth/postmaster",
            "https://www.googleapis.com/auth/postmaster.domain"
          ],
          "parameters": {},
          "id": "gmailpostmastertools.domains.create",
          "httpMethod": "POST",
          "flatPath": "v2/domains",
          "path": "v2/domains",
          "parameterOrder": []
        },
        "getComplianceStatus": {
          "response": {
            "$ref": "DomainComplianceStatus"
          },
          "description": "Retrieves the compliance status for a given domain. Returns PERMISSION_DENIED if you don't have permission to access compliance status for the domain.",
          "scopes": [
            "https://www.googleapis.com/auth/postmaster",
            "https://www.googleapis.com/auth/postmaster.traffic.readonly"
          ],
          "parameters": {
            "name": {
              "pattern": "^domains/[^/]+/complianceStatus$",
              "required": true,
              "type": "string",
              "description": "Required. The resource name of the domain's compliance status to retrieve. Format: `domains/{domain_id}/complianceStatus`.",
              "location": "path"
            }
          },
          "id": "gmailpostmastertools.domains.getComplianceStatus",
          "httpMethod": "GET",
          "flatPath": "v2/domains/{domainsId}/complianceStatus",
          "path": "v2/{+name}",
          "parameterOrder": [
            "name"
          ]
        }
      },
      "resources": {
        "users": {
          "methods": {
            "list": {
              "parameterOrder": [
                "parent"
              ],
              "httpMethod": "GET",
              "path": "v2/{+parent}/users",
              "flatPath": "v2/domains/{domainsId}/users",
              "id": "gmailpostmastertools.domains.users.list",
              "parameters": {
                "pageToken": {
                  "description": "Optional. The next_page_token value returned from a previous List request, if any.",
                  "location": "query",
                  "type": "string"
                },
                "parent": {
                  "location": "path",
                  "description": "Required. The parent resource name for which to list users. Format: `domains/{domain}`",
                  "type": "string",
                  "pattern": "^domains/[^/]+$",
                  "required": true
                },
                "pageSize": {
                  "description": "Optional. Requested page size. Server may return fewer users than requested. If unspecified, the default value for this field is 10. The maximum value for this field is 200.",
                  "location": "query",
                  "format": "int32",
                  "type": "integer"
                }
              },
              "scopes": [
                "https://www.googleapis.com/auth/postmaster",
                "https://www.googleapis.com/auth/postmaster.user"
              ],
              "response": {
                "$ref": "ListUsersResponse"
              },
              "description": "[Developer Preview](https://developers.google.com/workspace/preview): Lists the users that have access to a domain."
            },
            "delete": {
              "parameters": {
                "name": {
                  "location": "path",
                  "description": "Required. The resource name of the user to delete. Format: domains/{domain}/users/{user}",
                  "type": "string",
                  "pattern": "^domains/[^/]+/users/[^/]+$",
                  "required": true
                }
              },
              "id": "gmailpostmastertools.domains.users.delete",
              "response": {
                "$ref": "Empty"
              },
              "description": "[Developer Preview](https://developers.google.com/workspace/preview): Deletes a user from a domain. Returns NOT_FOUND if the user does not exist.",
              "scopes": [
                "https://www.googleapis.com/auth/postmaster",
                "https://www.googleapis.com/auth/postmaster.user"
              ],
              "parameterOrder": [
                "name"
              ],
              "flatPath": "v2/domains/{domainsId}/users/{usersId}",
              "path": "v2/{+name}",
              "httpMethod": "DELETE"
            },
            "get": {
              "scopes": [
                "https://www.googleapis.com/auth/postmaster",
                "https://www.googleapis.com/auth/postmaster.user"
              ],
              "response": {
                "$ref": "User"
              },
              "description": "[Developer Preview](https://developers.google.com/workspace/preview): Retrieves detailed information about a user that has access to a domain. Returns NOT_FOUND if the user does not exist.",
              "id": "gmailpostmastertools.domains.users.get",
              "parameters": {
                "name": {
                  "type": "string",
                  "pattern": "^domains/[^/]+/users/[^/]+$",
                  "required": true,
                  "location": "path",
                  "description": "Required. The resource name of the user to retrieve. Format: `domains/{domain}/users/{user}`"
                }
              },
              "httpMethod": "GET",
              "path": "v2/{+name}",
              "flatPath": "v2/domains/{domainsId}/users/{usersId}",
              "parameterOrder": [
                "name"
              ]
            },
            "create": {
              "httpMethod": "POST",
              "path": "v2/{+parent}/users",
              "flatPath": "v2/domains/{domainsId}/users",
              "parameterOrder": [
                "parent"
              ],
              "request": {
                "$ref": "CreateUserRequest"
              },
              "scopes": [
                "https://www.googleapis.com/auth/postmaster",
                "https://www.googleapis.com/auth/postmaster.user"
              ],
              "response": {
                "$ref": "User"
              },
              "description": "[Developer Preview](https://developers.google.com/workspace/preview): Creates a user, who has access to a domain. Returns INVALID_ARGUMENT if a user is not provided.",
              "id": "gmailpostmastertools.domains.users.create",
              "parameters": {
                "parent": {
                  "type": "string",
                  "pattern": "^domains/[^/]+$",
                  "required": true,
                  "location": "path",
                  "description": "Required. The parent resource where this user will be created. Format: domains/{domain}"
                }
              }
            },
            "patch": {
              "request": {
                "$ref": "User"
              },
              "scopes": [
                "https://www.googleapis.com/auth/postmaster",
                "https://www.googleapis.com/auth/postmaster.user"
              ],
              "response": {
                "$ref": "User"
              },
              "description": "[Developer Preview](https://developers.google.com/workspace/preview): Updates a user for a domain. Only Owners and Admins can execute this RPC, only a user's domain permission will be allowed to be updated. Returns NOT_FOUND if the user does not exist. Returns INVALID_ARGUMENT if a permission is not provided or is PERMISSION_UNSPECIFIED, NONE, or OWNER.",
              "id": "gmailpostmastertools.domains.users.patch",
              "parameters": {
                "name": {
                  "type": "string",
                  "pattern": "^domains/[^/]+/users/[^/]+$",
                  "required": true,
                  "location": "path",
                  "description": "Identifier. The resource name of the user. Format: users/{user} Note: {user} is the user's email address."
                },
                "updateMask": {
                  "location": "query",
                  "format": "google-fieldmask",
                  "type": "string",
                  "description": "The list of fields to update."
                }
              },
              "httpMethod": "PATCH",
              "path": "v2/{+name}",
              "flatPath": "v2/domains/{domainsId}/users/{usersId}",
              "parameterOrder": [
                "name"
              ]
            }
          }
        },
        "domainStats": {
          "methods": {
            "query": {
              "httpMethod": "POST",
              "path": "v2/{+parent}/domainStats:query",
              "flatPath": "v2/domains/{domainsId}/domainStats:query",
              "parameterOrder": [
                "parent"
              ],
              "request": {
                "$ref": "QueryDomainStatsRequest"
              },
              "scopes": [
                "https://www.googleapis.com/auth/postmaster",
                "https://www.googleapis.com/auth/postmaster.traffic.readonly"
              ],
              "response": {
                "$ref": "QueryDomainStatsResponse"
              },
              "description": "Retrieves a list of domain statistics for a given domain and time period. Returns statistics only for dates where data is available. Returns PERMISSION_DENIED if you don't have permission to access DomainStats for the domain.",
              "id": "gmailpostmastertools.domains.domainStats.query",
              "parameters": {
                "parent": {
                  "pattern": "^domains/[^/]+$",
                  "required": true,
                  "type": "string",
                  "description": "Required. The parent resource name where the stats are queried. Format: domains/{domain}",
                  "location": "path"
                }
              }
            }
          }
        }
      }
    },
    "domainStats": {
      "methods": {
        "batchQuery": {
          "parameters": {},
          "id": "gmailpostmastertools.domainStats.batchQuery",
          "request": {
            "$ref": "BatchQueryDomainStatsRequest"
          },
          "response": {
            "$ref": "BatchQueryDomainStatsResponse"
          },
          "description": "Executes a batch of QueryDomainStats requests for multiple domains. Returns PERMISSION_DENIED if you don't have permission to access DomainStats for any of the requested domains.",
          "scopes": [
            "https://www.googleapis.com/auth/postmaster",
            "https://www.googleapis.com/auth/postmaster.traffic.readonly"
          ],
          "parameterOrder": [],
          "httpMethod": "POST",
          "flatPath": "v2/domainStats:batchQuery",
          "path": "v2/domainStats:batchQuery"
        }
      }
    }
  },
  "auth": {
    "oauth2": {
      "scopes": {
        "https://www.googleapis.com/auth/postmaster": {
          "description": "Get email traffic metrics, manage domains, and manage domain users for the domains you have registered with Postmaster Tools"
        },
        "https://www.googleapis.com/auth/postmaster.domain": {
          "description": "View and manage the domains you have registered with Postmaster Tools"
        },
        "https://www.googleapis.com/auth/postmaster.traffic.readonly": {
          "description": "Get email traffic metrics for the domains you have registered with Postmaster Tools"
        },
        "https://www.googleapis.com/auth/postmaster.user": {
          "description": "View and manage users for the domains you have registered with Postmaster Tools"
        }
      }
    }
  },
  "fullyEncodeReservedExpansion": true,
  "ownerDomain": "google.com",
  "schemas": {
    "DateRanges": {
      "description": "A set of date ranges.",
      "type": "object",
      "id": "DateRanges",
      "properties": {
        "dateRanges": {
          "type": "array",
          "items": {
            "$ref": "DateRange"
          },
          "description": "Required. The list of date ranges for which to retrieve data."
        }
      }
    },
    "DateRange": {
      "id": "DateRange",
      "properties": {
        "start": {
          "description": "Required. The inclusive start date of the date range.",
          "$ref": "Date"
        },
        "end": {
          "description": "Required. The inclusive end date of the date range.",
          "$ref": "Date"
        }
      },
      "type": "object",
      "description": "A single date range defined by a start and end date."
    },
    "DomainVerificationToken": {
      "description": "[Developer Preview](https://developers.google.com/workspace/preview): The DNS token a user can use to verify ownership of a domain.",
      "type": "object",
      "id": "DomainVerificationToken",
      "properties": {
        "name": {
          "description": "Identifier. The resource name of the domain verification token. Format: domains/{domain}/verificationToken",
          "type": "string"
        },
        "verificationMethod": {
          "type": "string",
          "enum": [
            "DOMAIN_VERIFICATION_METHOD_UNSPECIFIED",
            "TXT",
            "CNAME"
          ],
          "description": "The verification method used.",
          "enumDescriptions": [
            "Unspecified.",
            "Generate a DNS TXT verification token.",
            "Generate a DNS CNAME verification token."
          ]
        },
        "token": {
          "description": "The verification token.",
          "type": "string"
        }
      }
    },
    "DomainComplianceData": {
      "id": "DomainComplianceData",
      "properties": {
        "oneClickUnsubscribeVerdict": {
          "description": "One-click unsubscribe compliance verdict.",
          "$ref": "OneClickUnsubscribeVerdict"
        },
        "honorUnsubscribeVerdict": {
          "description": "Unsubscribe honoring compliance verdict.",
          "$ref": "HonorUnsubscribeVerdict"
        },
        "rowData": {
          "description": "Data for each of the rows of the table. Each message contains all the data that backs a single row.",
          "items": {
            "$ref": "ComplianceRowData"
          },
          "type": "array"
        },
        "domainId": {
          "description": "Domain that this data is for.",
          "type": "string"
        },
        "deliverabilityStatusVerdict": {
          "readOnly": true,
          "description": "Output only. Deliverability status verdict.",
          "$ref": "DeliverabilityStatusVerdict"
        }
      },
      "type": "object",
      "description": "Compliance data for a given domain."
    },
    "ListUsersResponse": {
      "description": "[Developer Preview](https://developers.google.com/workspace/preview): Response message for ListUsers.",
      "type": "object",
      "id": "ListUsersResponse",
      "properties": {
        "users": {
          "items": {
            "$ref": "User"
          },
          "description": "The users that have access to the domain.",
          "type": "array"
        },
        "nextPageToken": {
          "description": "Token to retrieve the next page of results, or empty if there are no more results in the list.",
          "type": "string"
        }
      }
    },
    "CreateDomainRequest": {
      "id": "CreateDomainRequest",
      "properties": {
        "domainId": {
          "description": "Required. The domain to add. e.g., \"example.com\"",
          "type": "string"
        }
      },
      "type": "object",
      "description": "[Developer Preview](https://developers.google.com/workspace/preview): Request message for CreateDomain."
    },
    "StringList": {
      "id": "StringList",
      "properties": {
        "values": {
          "items": {
            "type": "string"
          },
          "description": "The string values.",
          "type": "array"
        }
      },
      "type": "object",
      "description": "Represents a list of strings."
    },
    "VerifyDomainRequest": {
      "description": "[Developer Preview](https://developers.google.com/workspace/preview): Request message for VerifyDomain.",
      "id": "VerifyDomainRequest",
      "properties": {
        "verificationMethod": {
          "enum": [
            "DOMAIN_VERIFICATION_METHOD_UNSPECIFIED",
            "TXT",
            "CNAME"
          ],
          "description": "Required. The verification method used. Must be specified, i.e. TXT or CNAME.",
          "enumDescriptions": [
            "Unspecified.",
            "Generate a DNS TXT verification token.",
            "Generate a DNS CNAME verification token."
          ],
          "type": "string"
        }
      },
      "type": "object"
    },
    "User": {
      "id": "User",
      "properties": {
        "user": {
          "description": "The user's email address.",
          "type": "string"
        },
        "permission": {
          "enum": [
            "PERMISSION_UNSPECIFIED",
            "READER",
            "ADMIN",
            "OWNER",
            "NONE"
          ],
          "description": "The permission level that the user has for the specified domain.",
          "enumDescriptions": [
            "Unspecified permission.",
            "User has read access to the domain.",
            "User has admin access to the domain.",
            "User has owner access to the domain.",
            "User has no access to the domain."
          ],
          "type": "string"
        },
        "accessGranter": {
          "readOnly": true,
          "description": "Output only. The user that added the current user.",
          "type": "string"
        },
        "name": {
          "description": "Identifier. The resource name of the user. Format: users/{user} Note: {user} is the user's email address.",
          "type": "string"
        },
        "createTime": {
          "description": "Output only. The time the user was granted access.",
          "readOnly": true,
          "type": "string",
          "format": "google-datetime"
        }
      },
      "type": "object",
      "description": "[Developer Preview](https://developers.google.com/workspace/preview): Information about a user's access to a domain."
    },
    "ComplianceStatus": {
      "description": "The status of a sender compliance requirement.",
      "type": "object",
      "id": "ComplianceStatus",
      "properties": {
        "status": {
          "description": "Output only. The compliance status.",
          "readOnly": true,
          "enum": [
            "STATE_UNSPECIFIED",
            "COMPLIANT",
            "NEEDS_WORK"
          ],
          "enumDescriptions": [
            "Unspecified.",
            "The compliance requirement is met, and the sender is deemed compliant.",
            "The compliance requirement is unmet, and the sender needs to do work to achieve compliance."
          ],
          "type": "string"
        }
      }
    },
    "HonorUnsubscribeVerdict": {
      "type": "object",
      "id": "HonorUnsubscribeVerdict",
      "properties": {
        "status": {
          "description": "The compliance status.",
          "$ref": "ComplianceStatus"
        },
        "reason": {
          "type": "string",
          "enum": [
            "REASON_UNSPECIFIED",
            "NOT_HONORING",
            "NOT_HONORING_TOO_FEW_CAMPAIGNS",
            "NOT_HONORING_TOO_MANY_CAMPAIGNS"
          ],
          "description": "The specific reason for the compliance verdict. Must be empty if the status is compliant.",
          "enumDescriptions": [
            "Unspecified.",
            "The sender does not honor unsubscribe requests.",
            "The sender does not honor unsubscribe requests and consider to increase the number of relevant campaigns.",
            "The sender does not honor unsubscribe requests and consider to reduce the number of relevant campaigns."
          ]
        }
      },
      "description": "Compliance verdict for whether a sender meets the unsubscribe honoring compliance requirement."
    },
    "Status": {
      "id": "Status",
      "properties": {
        "message": {
          "description": "A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.",
          "type": "string"
        },
        "details": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": {
              "type": "any",
              "description": "Properties of the object. Contains field @type with type URL."
            }
          },
          "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use."
        },
        "code": {
          "description": "The status code, which should be an enum value of google.rpc.Code.",
          "format": "int32",
          "type": "integer"
        }
      },
      "type": "object",
      "description": "The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors)."
    },
    "DomainComplianceStatus": {
      "id": "DomainComplianceStatus",
      "properties": {
        "name": {
          "description": "Identifier. The resource name of the domain's compliance status. Format: `domains/{domain_id}/complianceStatus`.",
          "type": "string"
        },
        "subdomainComplianceData": {
          "description": "Compliance data calculated specifically for the subdomain in `name`. This field is only populated if the domain in `name` is a subdomain that differs from its registrable domain (e.g., `sub.example.com`), and if compliance data is available for that specific subdomain.",
          "$ref": "DomainComplianceData"
        },
        "complianceData": {
          "description": "Compliance data for the registrable domain part of the domain in `name`. For example, if `name` is `domains/example.com/complianceStatus`, this field contains compliance data for `example.com`.",
          "$ref": "DomainComplianceData"
        }
      },
      "type": "object",
      "description": "Compliance status for a domain."
    },
    "Date": {
      "description": "Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp",
      "id": "Date",
      "properties": {
        "year": {
          "description": "Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.",
          "format": "int32",
          "type": "integer"
        },
        "month": {
          "description": "Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.",
          "type": "integer",
          "format": "int32"
        },
        "day": {
          "description": "Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.",
          "format": "int32",
          "type": "integer"
        }
      },
      "type": "object"
    },
    "Domain": {
      "type": "object",
      "id": "Domain",
      "properties": {
        "name": {
          "description": "Identifier. The resource name of the domain. Format: `domains/{domain_name}`, where domain_name is the fully qualified domain name (i.e., mymail.mydomain.com).",
          "type": "string"
        },
        "createTime": {
          "readOnly": true,
          "description": "Output only. Immutable. The timestamp at which the domain was added to the user's account.",
          "format": "google-datetime",
          "type": "string"
        },
        "permission": {
          "enumDescriptions": [
            "Unspecified permission.",
            "User has read access to the domain.",
            "User has admin access to the domain.",
            "User has owner access to the domain.",
            "User has no access to the domain."
          ],
          "type": "string",
          "description": "Output only. User's permission of this domain.",
          "readOnly": true,
          "enum": [
            "PERMISSION_UNSPECIFIED",
            "READER",
            "ADMIN",
            "OWNER",
            "NONE"
          ]
        },
        "verificationState": {
          "description": "Output only. Information about a user's verification history and properties for the domain.",
          "readOnly": true,
          "enum": [
            "VERIFICATION_STATE_UNSPECIFIED",
            "UNVERIFIED",
            "VERIFIED"
          ],
          "type": "string",
          "enumDescriptions": [
            "Unspecified.",
            "The domain is unverified.",
            "The domain is verified."
          ]
        },
        "lastVerifyTime": {
          "description": "The timestamp at which the domain was last verified by the user.",
          "format": "google-datetime",
          "type": "string"
        }
      },
      "description": "Information about a domain registered by the user."
    },
    "QueryDomainStatsResponse": {
      "description": "Response message for QueryDomainStats.",
      "id": "QueryDomainStatsResponse",
      "properties": {
        "domainStats": {
          "type": "array",
          "items": {
            "$ref": "DomainStat"
          },
          "description": "The list of domain statistics. Each DomainStat object contains the value for a metric requested in the QueryDomainStatsRequest."
        },
        "nextPageToken": {
          "description": "Token to retrieve the next page of results, or empty if there are no more results in the list.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "DomainStat": {
      "id": "DomainStat",
      "properties": {
        "name": {
          "readOnly": true,
          "description": "Output only. The resource name of the DomainStat resource. Format: domains/{domain}/domainStats/{domain_stat} The `{domain_stat}` segment is an opaque, server-generated ID. We recommend using the `metric` field to identify queried metrics instead of parsing the name.",
          "type": "string"
        },
        "value": {
          "description": "The value of the corresponding metric.",
          "$ref": "StatisticValue"
        },
        "metric": {
          "description": "The user-defined name from MetricDefinition.name in the request, used to correlate this result with the requested metric.",
          "type": "string"
        },
        "date": {
          "description": "Optional. The specific date for these stats, if granularity is DAILY. This field is populated if the QueryDomainStatsRequest specified a DAILY aggregation granularity.",
          "$ref": "Date"
        }
      },
      "type": "object",
      "description": "Email statistics for a domain for a specified time period or date."
    },
    "ListDomainsResponse": {
      "type": "object",
      "id": "ListDomainsResponse",
      "properties": {
        "nextPageToken": {
          "description": "Token to retrieve the next page of results, or empty if there are no more results in the list.",
          "type": "string"
        },
        "domains": {
          "items": {
            "$ref": "Domain"
          },
          "description": "The domains that have been registered by the user.",
          "type": "array"
        }
      },
      "description": "Response message for ListDomains."
    },
    "BatchQueryDomainStatsResult": {
      "id": "BatchQueryDomainStatsResult",
      "properties": {
        "response": {
          "description": "The successful response for the individual query.",
          "$ref": "QueryDomainStatsResponse"
        },
        "error": {
          "description": "The error status if the individual query failed.",
          "$ref": "Status"
        }
      },
      "type": "object",
      "description": "Represents the result of a single QueryDomainStatsRequest within a batch."
    },
    "VerifyDomainResponse": {
      "id": "VerifyDomainResponse",
      "properties": {},
      "type": "object",
      "description": "[Developer Preview](https://developers.google.com/workspace/preview): Response message for VerifyDomain."
    },
    "BatchQueryDomainStatsResponse": {
      "id": "BatchQueryDomainStatsResponse",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "BatchQueryDomainStatsResult"
          },
          "description": "A list of responses, one for each query in the BatchQueryDomainStatsRequest. The order of responses will correspond to the order of requests."
        }
      },
      "type": "object",
      "description": "Response message for BatchQueryDomainStats."
    },
    "OneClickUnsubscribeVerdict": {
      "type": "object",
      "id": "OneClickUnsubscribeVerdict",
      "properties": {
        "status": {
          "description": "The compliance status.",
          "$ref": "ComplianceStatus"
        },
        "reason": {
          "description": "The specific reason for the compliance verdict. Must be empty if the status is compliant.",
          "enumDescriptions": [
            "Unspecified.",
            "Sender does not support one-click unsubscribe for the majority of their messages.",
            "Sender does not support one-click unsubscribe for most messages that are manually reported as spam.",
            "Sender does not support one-click unsubscribe for most promotional messages that are manually reported as spam. This classification of messages is a subset of those encompassed by `NO_UNSUB_SPAM_REPORTS`."
          ],
          "enum": [
            "REASON_UNSPECIFIED",
            "NO_UNSUB_GENERAL",
            "NO_UNSUB_SPAM_REPORTS",
            "NO_UNSUB_PROMO_SPAM_REPORTS"
          ],
          "type": "string"
        }
      },
      "description": "Compliance verdict for whether a sender meets the one-click unsubscribe compliance requirement."
    },
    "CreateUserRequest": {
      "description": "[Developer Preview](https://developers.google.com/workspace/preview): Request message for CreateUser.",
      "type": "object",
      "id": "CreateUserRequest",
      "properties": {
        "userId": {
          "description": "Required. The user to create.",
          "type": "string"
        },
        "permission": {
          "type": "string",
          "description": "Optional. Specifies the permission level to give the user for the specified domain. If not specified, the default value for this field is READER.",
          "enumDescriptions": [
            "Unspecified permission.",
            "User has read access to the domain.",
            "User has admin access to the domain.",
            "User has owner access to the domain.",
            "User has no access to the domain."
          ],
          "enum": [
            "PERMISSION_UNSPECIFIED",
            "READER",
            "ADMIN",
            "OWNER",
            "NONE"
          ]
        }
      }
    },
    "TimeQuery": {
      "id": "TimeQuery",
      "properties": {
        "dateList": {
          "description": "A list of specific dates.",
          "$ref": "DateList"
        },
        "dateRanges": {
          "description": "A list of date ranges.",
          "$ref": "DateRanges"
        }
      },
      "type": "object",
      "description": "The date ranges or specific dates for which you want to retrieve data."
    },
    "QueryDomainStatsRequest": {
      "type": "object",
      "id": "QueryDomainStatsRequest",
      "properties": {
        "pageToken": {
          "description": "Optional. The next_page_token value returned from a previous List request, if any. If the aggregation granularity is DAILY, the page token will be the encoded date + \"/\" + metric name. If the aggregation granularity is OVERALL, the page token will be the encoded metric name.",
          "type": "string"
        },
        "timeQuery": {
          "description": "Required. The time range or specific dates for which to retrieve the metrics.",
          "$ref": "TimeQuery"
        },
        "pageSize": {
          "description": "Optional. The maximum number of DomainStats resources to return in the response. The server may return fewer than this value. If unspecified, a default value of 10 will be used. The maximum value is 200.",
          "format": "int32",
          "type": "integer"
        },
        "aggregationGranularity": {
          "enum": [
            "AGGREGATION_GRANULARITY_UNSPECIFIED",
            "DAILY",
            "OVERALL"
          ],
          "description": "Optional. The granularity at which to aggregate the statistics. If unspecified, defaults to DAILY.",
          "enumDescriptions": [
            "Unspecified granularity. Defaults to DAILY.",
            "Statistics are aggregated on a daily basis. Each DomainStats entry in the response will correspond to a single day.",
            "Statistics are aggregated over the entire requested time period. Each DomainStats entry in the response will represent the total for the period."
          ],
          "type": "string"
        },
        "parent": {
          "description": "Required. The parent resource name where the stats are queried. Format: domains/{domain}",
          "type": "string"
        },
        "metricDefinitions": {
          "items": {
            "$ref": "MetricDefinition"
          },
          "description": "Required. The specific metrics to query. You can define a custom name for each metric, which will be used in the response.",
          "type": "array"
        }
      },
      "description": "Request message for QueryDomainStats."
    },
    "StatisticValue": {
      "description": "The actual value of a statistic.",
      "type": "object",
      "id": "StatisticValue",
      "properties": {
        "intValue": {
          "description": "Integer value.",
          "type": "string",
          "format": "int64"
        },
        "floatValue": {
          "type": "number",
          "format": "float",
          "description": "Float value."
        },
        "doubleValue": {
          "format": "double",
          "type": "number",
          "description": "Double value."
        },
        "stringValue": {
          "description": "String value.",
          "type": "string"
        },
        "stringList": {
          "description": "List of string values.",
          "$ref": "StringList"
        }
      }
    },
    "BaseMetric": {
      "description": "Specifies the base metric to query, which can be a predefined standard metric or a user-defined custom metric (if supported in the future).",
      "type": "object",
      "id": "BaseMetric",
      "properties": {
        "standardMetric": {
          "type": "string",
          "description": "A predefined standard metric.",
          "enumDescriptions": [
            "Unspecified standard metric. This value should not be used directly.",
            "Predefined metric for Feedback Loop (FBL) id. The `filter` field supports selecting the aggregation key type. Supported format: `aggregation_key_type` = \"\". Supported values: * `FROM_HEADER`: (Default) The metric includes messages with From: header domain matching the requested domain. * `ALL_DKIM`: The metric includes messages with one of the signed DKIM domains matching the requested domain.",
            "Predefined metric for Feedback Loop (FBL) spam rate. The `filter` field requires a `feedback_loop_id` and optionally accepts an `aggregation_key_type`. Supported formats are: * `feedback_loop_id` = \"\" * `feedback_loop_id` = \"\" AND `aggregation_key_type` = \"\" If `aggregation_key_type` is omitted, it defaults to `FROM_HEADER`. Supported values: * `FROM_HEADER`: (Default) The metric includes messages with From: header domain matching the requested domain. * `ALL_DKIM`: The metric includes messages with one of the signed DKIM domains matching the requested domain.",
            "Predefined metric for spam rate.",
            "The success rate of authentication mechanisms (DKIM, SPF, DMARC). Filter must be of type auth_type = \"\" where is one of: [spf, dkim, dmarc]",
            "The rate of messages that were TLS encrypted in transit Filter must be of type traffic_direction = \"\" where is one of: [inbound, outbound]",
            "The rate of messages that were TLS encrypted in transit Filter must be of type traffic_direction = \"\" where is one of: [inbound, outbound]",
            "The total count of delivery errors encountered (temporary or permanent rejects). The `filter` field supports a limited syntax. Supported formats are: * Empty: No filter is applied. * `error_type` = \"\" * `error_type` = \"\" AND `error_reason` = \"\" If an empty filter is provided, the metric will be aggregated across all error types and reasons. If only `error_type` is specified, the metric will be aggregated across all reasons for that type. Supported values: * reject * temp_fail Supported values depend on the : * For 'reject': [bad_attachment, bad_or_missing_ptr_record, ip_in_rbls, low_domain_reputation, low_ip_reputation, spammy_content, stamp_policy_error, other] * For 'temp_fail': [anomalous_traffic_pattern, other]",
            "Delivery error rate for the specified delivery error type. The `filter` field supports a limited syntax. Supported formats are: * Empty: No filter is applied. * `error_type` = \"\" * `error_type` = \"\" AND `error_reason` = \"\" If an empty filter is provided, the metric will be aggregated across all error types and reasons. If only `error_type` is specified, the metric will be aggregated across all reasons for that type. Supported values: * reject * temp_fail Supported values depend on the : * For 'reject': [bad_attachment, bad_or_missing_ptr_record, ip_in_rbls, low_domain_reputation, low_ip_reputation, spammy_content, stamp_policy_error, other] * For 'temp_fail': [anomalous_traffic_pattern, other]"
          ],
          "enum": [
            "STANDARD_METRIC_UNSPECIFIED",
            "FEEDBACK_LOOP_ID",
            "FEEDBACK_LOOP_SPAM_RATE",
            "SPAM_RATE",
            "AUTH_SUCCESS_RATE",
            "TLS_ENCRYPTION_MESSAGE_COUNT",
            "TLS_ENCRYPTION_RATE",
            "DELIVERY_ERROR_COUNT",
            "DELIVERY_ERROR_RATE"
          ]
        }
      }
    },
    "DateList": {
      "description": "A set of specific dates.",
      "id": "DateList",
      "properties": {
        "dates": {
          "type": "array",
          "items": {
            "$ref": "Date"
          },
          "description": "Required. The list of specific dates for which to retrieve data."
        }
      },
      "type": "object"
    },
    "Empty": {
      "id": "Empty",
      "properties": {},
      "type": "object",
      "description": "A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }"
    },
    "BatchQueryDomainStatsRequest": {
      "id": "BatchQueryDomainStatsRequest",
      "properties": {
        "requests": {
          "type": "array",
          "items": {
            "$ref": "QueryDomainStatsRequest"
          },
          "description": "Required. A list of individual query requests. Each request can be for a different domain. A maximum of 100 requests can be included in a single batch."
        }
      },
      "type": "object",
      "description": "Request message for BatchQueryDomainStats."
    },
    "MetricDefinition": {
      "description": "Defines a specific metric to query, including a user-defined name, the base metric type, and optional filters.",
      "type": "object",
      "id": "MetricDefinition",
      "properties": {
        "baseMetric": {
          "description": "Required. The underlying metric to query.",
          "$ref": "BaseMetric"
        },
        "filter": {
          "description": "Optional. Optional filters to apply to the metric.",
          "type": "string"
        },
        "name": {
          "description": "Required. The user-defined name for this metric. This name will be used as the key for this metric's value in the response.",
          "type": "string"
        }
      }
    },
    "ComplianceRowData": {
      "description": "Data for a single row of the compliance status table.",
      "id": "ComplianceRowData",
      "properties": {
        "requirement": {
          "type": "string",
          "enum": [
            "COMPLIANCE_REQUIREMENT_UNSPECIFIED",
            "SPF",
            "DKIM",
            "SPF_AND_DKIM",
            "DMARC_POLICY",
            "DMARC_ALIGNMENT",
            "MESSAGE_FORMATTING",
            "DNS_RECORDS",
            "ENCRYPTION",
            "USER_REPORTED_SPAM_RATE",
            "ONE_CLICK_UNSUBSCRIBE",
            "HONOR_UNSUBSCRIBE"
          ],
          "description": "The compliance requirement.",
          "enumDescriptions": [
            "Unspecified.",
            "Whether the sender has properly configured SPF.",
            "Whether the sender has properly configured DKIM.",
            "Whether the sender has properly configured both SPF and DKIM.",
            "Whether the sender has configured DMARC policy.",
            "Whether the From: header is aligned with DKIM or SPF",
            "Whether messages are correctly formatted according to RFC 5322.",
            "Whether the domain has forward and reverse DNS records.",
            "Whether messages has TLS encryption.",
            "Whether the sender is below a threshold for user-reported spam rate.",
            "Whether the sender sufficiently supports one-click unsubscribe. Note that the user-facing requirement is \"one-click unsubscribe\", but we require satisfaction of multiple \"unsubscribe support\" rules.",
            "Whether the sender honors user-initiated unsubscribe requests."
          ]
        },
        "status": {
          "description": "The compliance status for the requirement.",
          "$ref": "ComplianceStatus"
        }
      },
      "type": "object"
    },
    "DeliverabilityStatusVerdict": {
      "description": "[Developer Preview](https://developers.google.com/workspace/preview): Verdict of domain deliverability status.",
      "id": "DeliverabilityStatusVerdict",
      "properties": {
        "state": {
          "readOnly": true,
          "description": "Output only. The compliance state.",
          "$ref": "ComplianceStatus"
        },
        "reason": {
          "readOnly": true,
          "enum": [
            "REASON_UNSPECIFIED",
            "MESSAGE_VOLUME_LOW",
            "SMTP_ERRORS_HIGH",
            "SENDER_NOT_COMPLIANT",
            "SPAM_RATE_HIGH",
            "USER_FEEDBACK_NEGATIVE",
            "USER_FEEDBACK_LOW",
            "USER_FEEDBACK_POSITIVE"
          ],
          "description": "Output only. The specific reason for the compliance verdict.",
          "enumDescriptions": [
            "Unspecified.",
            "Not enough outgoing email.",
            "Many messages with delivery errors.",
            "The sender does not meet the sender requirements.",
            "The spam rate is above 0.1%.",
            "Indicates users do not want to receive email messages.",
            "Users do not take action on messages.",
            "Users signal they want to receive email messages."
          ],
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "description": "The Postmaster Tools API is a RESTful API that provides programmatic access to email traffic metrics (like spam reports, delivery errors etc) otherwise available through the Gmail Postmaster Tools UI currently.",
  "batchPath": "batch",
  "kind": "discovery#restDescription",
  "version_module": true,
  "icons": {
    "x32": "http://www.google.com/images/icons/product/search-32.gif",
    "x16": "http://www.google.com/images/icons/product/search-16.gif"
  },
  "documentationLink": "https://developers.google.com/workspace/gmail/postmaster"
}
