openapi: 3.2.0 info: title: Google AdMob Mediation Ab Experiments API version: v1beta description: 'The AdMob API allows publishers to programmatically get information about their AdMob account. ' contact: name: Google url: https://developers.google.com/admob/api/ termsOfService: https://developers.google.com/terms license: name: Google APIs Terms of Service url: https://developers.google.com/terms x-discovery-revision: '20260731' x-discovery-source: https://admob.googleapis.com/$discovery/rest?version=v1beta servers: - url: https://admob.googleapis.com description: Google AdMob API security: - GoogleOAuth2: - https://www.googleapis.com/auth/admob.readonly - https://www.googleapis.com/auth/admob.report tags: - name: mediationAbExperiments paths: /v1beta/accounts/{accountsId}/mediationGroups/{mediationGroupsId}/mediationAbExperiments: post: operationId: accounts_mediationGroups_mediationAbExperiments_create summary: Create an A/B testing experiment for a specified AdMob account and a mediation group description: Create an A/B testing experiment for a specified AdMob account and a mediation group. This method has limited access. If you see a 403 permission denied error, please reach out to your account manager for access. tags: - mediationAbExperiments x-resource-name-parameter: parent: pattern: ^accounts/[^/]+/mediationGroups/[^/]+$ description: 'Required. The parent which owns the mediation group. Format: accounts/{publisher_id}/mediationGroups/{mediation_group_id}' parameters: - name: accountsId in: path required: true schema: type: string description: Path segment of the resource name. - name: mediationGroupsId in: path required: true schema: type: string description: Path segment of the resource name. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/MediationAbExperiment' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/MediationAbExperiment' '400': description: INVALID_ARGUMENT — malformed request, unknown publisher id, or incompatible report metrics/dimensions. content: application/json: schema: $ref: '#/components/schemas/GoogleRpcStatus' '401': description: UNAUTHENTICATED — missing or invalid OAuth 2.0 access token. content: application/json: schema: $ref: '#/components/schemas/GoogleRpcStatus' '403': description: PERMISSION_DENIED — AdMob API not enabled on the project, or the effective user lacks access to the resource. content: application/json: schema: $ref: '#/components/schemas/GoogleRpcStatus' '429': description: RESOURCE_EXHAUSTED — per-project quota exceeded. content: application/json: schema: $ref: '#/components/schemas/GoogleRpcStatus' '500': description: INTERNAL — unexpected server error. content: application/json: schema: $ref: '#/components/schemas/GoogleRpcStatus' /v1beta/accounts/{accountsId}/mediationGroups/{mediationGroupsId}/mediationAbExperiments:stop: post: operationId: accounts_mediationGroups_mediationAbExperiments_stop summary: Stop the mediation A/B experiment and choose a variant description: Stop the mediation A/B experiment and choose a variant. This method has limited access. If you see a 403 permission denied error, please reach out to your account manager for access. tags: - mediationAbExperiments x-resource-name-parameter: name: pattern: ^accounts/[^/]+/mediationGroups/[^/]+/mediationAbExperiments$ description: 'Name of the mediation group, the experiment for which to choose a variant for. Example: accounts/pub-9876543210987654/mediationGroups/0123456789/ mediationAbExperiments' parameters: - name: accountsId in: path required: true schema: type: string description: Path segment of the resource name. - name: mediationGroupsId in: path required: true schema: type: string description: Path segment of the resource name. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/StopMediationAbExperimentRequest' responses: '200': description: Successful response content: application/json: schema: $ref: '#/components/schemas/MediationAbExperiment' '400': description: INVALID_ARGUMENT — malformed request, unknown publisher id, or incompatible report metrics/dimensions. content: application/json: schema: $ref: '#/components/schemas/GoogleRpcStatus' '401': description: UNAUTHENTICATED — missing or invalid OAuth 2.0 access token. content: application/json: schema: $ref: '#/components/schemas/GoogleRpcStatus' '403': description: PERMISSION_DENIED — AdMob API not enabled on the project, or the effective user lacks access to the resource. content: application/json: schema: $ref: '#/components/schemas/GoogleRpcStatus' '429': description: RESOURCE_EXHAUSTED — per-project quota exceeded. content: application/json: schema: $ref: '#/components/schemas/GoogleRpcStatus' '500': description: INTERNAL — unexpected server error. content: application/json: schema: $ref: '#/components/schemas/GoogleRpcStatus' components: schemas: MediationGroupMediationGroupLine: type: object description: Settings for an ad network used by a mediation group. properties: cpmMicros: type: string format: int64 description: The CPM for this allocation line. $0.01 is the minimum allowed amount. For LIVE CPM modes, the default amount is $0.01. This value is ignored if `cpm_mode` is `LIVE`. **Warning:** "USD" is the only supported currency at the moment. The unit is in micros. adSourceId: type: string description: The ID of the ad source this mediation line is associated with. experimentVariant: type: string description: Output only. The Mediation A/B experiment variant to which the mediation group line belongs to. enum: - VARIANT_UNSPECIFIED - VARIANT_A - VARIANT_B - ORIGINAL x-enum-descriptions: - Default value for an unset field. Do not use. - The mediation group line belongs to the variant A. - The mediation group line belongs to the variant B. - The mediation group line isn't a part of an experiment. readOnly: true displayName: type: string description: User-provided label for this mediation line. The maximum length allowed is 255 characters. adUnitMappings: type: object description: References of the ad unit mappings for each ad unit associated with this mediation line. Key is the ad unit ID, value is resource name of the ad unit mapping. For mediation lines where the ad source id is the AdMob Network, ad unit mappings will be ignored. additionalProperties: type: string id: type: string description: The 16 digit ID for this mediation line e.g. 0123456789012345. When creating a new mediation group line, use a distinct negative integer as the ID place holder. state: type: string description: The status of the mediation group line. Only enabled mediation group lines will be served. enum: - STATE_UNSPECIFIED - ENABLED - DISABLED - REMOVED x-enum-descriptions: - Default value for an unset field. Do not use. - The mediation group line is active and used to serve ads. - The mediation group line has been disabled and is no longer served. Disabled mediation group lines can be re-enabled. - The mediation group line will be removed and no longer served. Removed mediation group lines can not be re-enabled and will no longer be visible. This is an input only field. cpmMode: type: string description: Indicates how the CPM for this mediation line is provided. Note that `MANUAL` and `LIVE` are the only fully-supported mode at the moment. Please use the AdMob UI (https://admob.google.com) if you wish to create or update to other cpm modes. enum: - CPM_MODE_UNSPECIFIED - LIVE - MANUAL - ANO x-enum-descriptions: - Default value for an unset field. Do not use. - CPM is calculated per ad request based on the ad auction. - CPM is set by the user manually. - CPM is retrieved from the ad network using the publisher specified credentials. Output only. MediationAbExperimentExperimentMediationLine: type: object description: The mediation group line for the experiment. It will be used for serving during the run of the experiment. properties: mediationGroupLine: $ref: '#/components/schemas/MediationGroupMediationGroupLine' StopMediationAbExperimentRequest: type: object description: Request to end the mediation A/B experiment and choose a winning variant. properties: variantChoice: type: string description: The choice for the winning variant. enum: - VARIANT_CHOICE_UNSPECIFIED - VARIANT_CHOICE_A - VARIANT_CHOICE_B x-enum-descriptions: - Default value for an unset field. Do not use. - Use the mediation lines from Variant A and complete the experiment. Variant A contains the original serving lines before the experiment creation. - Use the mediation lines form Variant B and complete the experiment. Variant B contains the newly added serving lines. GoogleRpcStatus: type: object description: Canonical Google API error envelope (google.rpc.Status), returned inside an `error` wrapper. properties: code: type: integer description: The status code, which should be an enum value of google.rpc.Code. message: type: string description: A developer-facing error message in English. status: type: string description: The canonical error reason, e.g. INVALID_ARGUMENT, RESOURCE_EXHAUSTED. details: type: array items: type: object description: A list of messages that carry the error details. x-source: Derived from Google's documented AdMob error responses at https://developers.google.com/admob/api/v1/errors; not present in the Discovery Document. MediationAbExperiment: type: object description: The mediation A/B experiment. properties: displayName: type: string description: The display name for the mediation A/B experiment. mediationGroupId: type: string description: Output only. The mediation group id this experiment belongs to. This can be used for filtering the experiments in the list experiments API. readOnly: true endTime: type: string format: google-datetime description: Output only. The time at which the experiment was ended or target to end (in UTC). readOnly: true name: type: string description: 'Resource name for this experiment. The format is accounts/{publisher_id}/ mediationGroups/{mediation_group_id}/mediationAbExperiment/ {mediation_group_experiment_id}. For example: accounts/pub-9876543210987654/mediationGroups/0123456789/ mediationAbExperiment/12345' experimentId: type: string description: Output only. Unique identifier for the mediation A/B experiment. It is an output only property. readOnly: true treatmentTrafficPercentage: type: string format: int64 description: The percentage of the mediation A/B experiment traffic that will be send to the treatment (variant B). The remainder is sent to the control (variant A). The percentage is expressed as an integer in the inclusive range of [1,99]. See https://support.google.com/admob/answer/9572326 for details. controlMediationLines: type: array description: Output only. The experiment mediation lines for control. They are inherited from the parent mediation group. It is an output only field. readOnly: true items: $ref: '#/components/schemas/MediationAbExperimentExperimentMediationLine' startTime: type: string format: google-datetime description: Output only. The time at which the experiment was started (in UTC). readOnly: true treatmentMediationLines: type: array description: The experiment mediation lines created for the treatment. They will be used for serving when the experiment status is RUNNING. items: $ref: '#/components/schemas/MediationAbExperimentExperimentMediationLine' state: type: string description: Output only. The state of the experiment. It is an output only field. enum: - EXPERIMENT_STATE_UNSPECIFIED - EXPIRED - RUNNING - ENDED x-enum-descriptions: - Default for an unset field. Do not use. - The experiment has expired. - The experiment is running and thus used in serving. - The experiment is ended, but not yet expired. Serving continues in the original configurations while the experiment is ready to call an action. readOnly: true variantLeader: type: string description: Output only. The variant leader for the experiment according to some key metrics. enum: - VARIANT_LEADER_UNSPECIFIED - CONTROL - TREATMENT - INSUFFICIENT_DATA - TOO_EARLY_TO_CALL - NO_VARIANT_LEADER x-enum-descriptions: - Default value of the enum. Do not use. - The control leading the experiment. - The treatment leading the experiment. - Collected data (impressions) are insufficient to determine a leader. - Experiment hasn't run long enough to determine a leader. - Neither variant is a decisive winner in the observed data. readOnly: true securitySchemes: GoogleOAuth2: type: oauth2 description: Google OAuth 2.0 user authorization. AdMob does not support service accounts. flows: authorizationCode: authorizationUrl: https://accounts.google.com/o/oauth2/v2/auth tokenUrl: https://oauth2.googleapis.com/token scopes: https://www.googleapis.com/auth/admob.readonly: See your AdMob data https://www.googleapis.com/auth/admob.report: See your AdMob data externalDocs: description: AdMob API documentation url: https://developers.google.com/admob/api/