{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-campaign-manager/json-schema/google-campaign-manager-dynamic-feeds-insert-request-schema.json",
  "title": "DynamicFeedsInsertRequest",
  "description": "Dynamic profile ID is required for dynamic feed insert as the current GPA API only can create a dynamic feed under profile context,even though the dynamic feed itself don't need the dynamic profile id.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-campaign-manager-dynamic-feeds-api-openapi.yml#/components/schemas/DynamicFeedsInsertRequest",
  "type": "object",
  "properties": {
    "dynamicProfileId": {
      "description": "Required. Dynamic profile ID of the inserted dynamic feed.",
      "format": "int64",
      "type": "string"
    },
    "dynamicFeed": {
      "$ref": "#/$defs/DynamicFeed",
      "description": "Required. Dynamic feed to insert."
    }
  },
  "$defs": {
    "ContentSource": {
      "properties": {
        "resourceLink": {
          "type": "string",
          "description": "Required. The link to the file of the content source."
        },
        "contentSourceName": {
          "type": "string",
          "description": "Optional. The name of the content source. It is defaulted to content source file name if not provided."
        },
        "lastModifiedInfo": {
          "$ref": "#/$defs/LastModifiedInfo",
          "description": "Output only. The last modified timestamp of the content source. This is a read-only field."
        },
        "createInfo": {
          "$ref": "#/$defs/LastModifiedInfo",
          "description": "Output only. The creation timestamp of the content source. This is a read-only field."
        },
        "metaData": {
          "$ref": "#/$defs/ContentSourceMetaData",
          "description": "Output only. Metadata of the content source. It contains the number of rows and the column names from resource link. This is a read-only field."
        },
        "resourceType": {
          "description": "Required. The resource type of the content source.",
          "type": "string",
          "enum": [
            "RESOURCE_TYPE_UNSPECIFIED",
            "RESOURCE_TYPE_GOOGLE_SPREADSHEET",
            "RESOURCE_TYPE_REMOTE_FILE"
          ]
        }
      },
      "type": "object",
      "description": "Contains the content source of the dynamic feed."
    },
    "ContentSourceMetaData": {
      "properties": {
        "separator": {
          "description": "Output only. The separator of the content source.",
          "type": "string",
          "readOnly": true
        },
        "charset": {
          "description": "Output only. The charset of the content source.",
          "readOnly": true,
          "type": "string"
        },
        "rowNumber": {
          "type": "integer",
          "format": "int32",
          "readOnly": true,
          "description": "Output only. The number of rows in the content source."
        },
        "fieldNames": {
          "readOnly": true,
          "description": "Output only. The list of column names in the content source.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "description": "Contains the meta data of the content source. This is a read-only field.",
      "type": "object"
    },
    "DynamicFeed": {
      "description": " *Beta:* This API resource is available only to a very limited number of customers. If you'd like to use this resource, please reach out to your Google sales representative. Contains dynamic feed information.",
      "type": "object",
      "properties": {
        "element": {
          "$ref": "#/$defs/Element",
          "description": "Required. The element of the dynamic feed that is to specify the schema of the feed. This is a required field."
        },
        "status": {
          "readOnly": true,
          "type": "string",
          "description": "Output only. The status of the feed. It is a read-only field that depends on the the feed ingestion status. The default value is INACTIVE, and it will be updated to ACTIVE once the feed is ingested successfully.",
          "enum": [
            "STATUS_UNKNOWN",
            "ACTIVE",
            "INACTIVE",
            "DELETED"
          ]
        },
        "hasPublished": {
          "description": "Output only. Indicates whether the dynamic feed has a published version. This is a read-only field.",
          "type": "boolean",
          "readOnly": true
        },
        "feedIngestionStatus": {
          "$ref": "#/$defs/FeedIngestionStatus",
          "description": "Output only. The ingestion status of the dynamic feed. This is a read-only field."
        },
        "contentSource": {
          "$ref": "#/$defs/ContentSource",
          "description": "Required. The content source of the dynamic feed. This is a required field."
        },
        "createInfo": {
          "$ref": "#/$defs/LastModifiedInfo",
          "description": "Output only. The creation timestamp of the dynamic feed. This is a read-only field."
        },
        "studioAdvertiserId": {
          "type": "string",
          "description": "Required. Advertiser ID of this dynamic feed. This is a required field.",
          "format": "int64"
        },
        "dynamicFeedId": {
          "type": "string",
          "format": "int64",
          "description": "Output only. Unique ID of this dynamic feed. This is a read-only, auto-generated field.",
          "readOnly": true
        },
        "feedSchedule": {
          "$ref": "#/$defs/FeedSchedule",
          "description": "Optional. The schedule of the dynamic feed. It can be set if the feed is published."
        },
        "lastModifiedInfo": {
          "$ref": "#/$defs/LastModifiedInfo",
          "description": "Output only. The last modified timestamp of the dynamic feed. This is a read-only field."
        },
        "dynamicFeedName": {
          "description": "Optional. Name of this dynamic feed. It is defaulted to content source file name if not provided.",
          "type": "string"
        }
      }
    },
    "Element": {
      "properties": {
        "endTimestampFieldId": {
          "format": "int32",
          "description": "Optional. The field ID to specify the field that represents the end timestamp. Only applicable if you're planning to use scheduling in your dynamic creative.",
          "type": "integer"
        },
        "isLocalTimestamp": {
          "description": "Optional. Whether the start and end timestamp is local timestamp. The default value is false which means start and end timestamp is in UTC.",
          "type": "boolean"
        },
        "createInfo": {
          "$ref": "#/$defs/LastModifiedInfo",
          "description": "Output only. The creation timestamp of the element. This is a read-only field."
        },
        "lastModifiedInfo": {
          "$ref": "#/$defs/LastModifiedInfo",
          "description": "Output only. The last modified timestamp of the element. This is a read-only field."
        },
        "proximityTargetingFieldId": {
          "description": "Optional. The field ID that specify field used for proximity targeting.",
          "type": "integer",
          "format": "int32"
        },
        "defaultFieldId": {
          "type": "integer",
          "format": "int32",
          "description": "Optional. The field ID to specify the field that represents the default field in the feed."
        },
        "elementName": {
          "type": "string",
          "description": "Optional. The name of the element. It is defaulted to resource file name if not provided."
        },
        "reportingLabelFieldId": {
          "description": "Required. The field ID to specify the field used for dynamic reporting in Campaign Manager 360.",
          "type": "integer",
          "format": "int32"
        },
        "externalIdFieldId": {
          "description": "Required. The field ID to specify the field used for uniquely identifying the feed row. This is a required field.",
          "format": "int32",
          "type": "integer"
        },
        "feedFields": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/FeedField"
          },
          "description": "Required. The list of fields of the element. The field order and name should match the meta data in the content source source."
        },
        "startTimestampFieldId": {
          "type": "integer",
          "format": "int32",
          "description": "Optional. The field ID to specify the field that represents the start timestamp. Only applicable if you're planning to use scheduling in your dynamic creative."
        },
        "activeFieldId": {
          "format": "int32",
          "description": "Optional. The field ID to specify the active field in the feed.",
          "type": "integer"
        }
      },
      "description": "Contains the element of the dynamic feed.",
      "type": "object"
    },
    "FeedField": {
      "properties": {
        "type": {
          "description": "Required. The type of the field.",
          "type": "string",
          "enum": [
            "TYPE_UNKNOWN",
            "STRING",
            "LONG",
            "GPA_SERVED_IMAGE_URL",
            "GPA_SERVED_ASSET_URL",
            "COUNTRY_CODE_ISO",
            "FLOAT",
            "CM360_KEYWORD",
            "CM360_SITE_ID",
            "BOOL",
            "EXIT_URL",
            "DATETIME",
            "CM360_CREATIVE_ID",
            "CM360_PLACEMENT_ID",
            "CM360_AD_ID",
            "CM360_ADVERTISER_ID",
            "CM360_CAMPAIGN_ID",
            "CITY",
            "REGION",
            "POSTAL_CODE",
            "METRO",
            "CUSTOM_VALUE",
            "REMARKETING_VALUE",
            "GEO_CANONICAL",
            "WEIGHT",
            "STRING_LIST",
            "CREATIVE_DIMENSION",
            "USERLIST_ID",
            "ASSET_LIBRARY_DIRECTORY_HANDLE",
            "ASSET_LIBRARY_VIDEO_HANDLE",
            "ASSET_LIBRARY_HANDLE",
            "THIRD_PARTY_SERVED_URL",
            "CM360_DYNAMIC_TARGETING_KEY",
            "DV360_LINE_ITEM_ID"
          ]
        },
        "filterable": {
          "description": "Optional. Whether the field is filterable. Could be set as true when the field type is any of the following and is not renderable: - STRING - BOOL - COUNTRY_CODE_ISO - CM360_SITE_ID - CM360_KEYWORD - CM360_CREATIVE_ID - CM360_PLACEMENT_ID - CM360_AD_ID - CM360_ADVERTISER_ID - CM360_CAMPAIGN_ID - CITY - REGION - POSTAL_CODE - METRO - CUSTOM_VALUE - REMARKETING_VALUE - GEO_CANONICAL - STRING_LIST - CREATIVE_DIMENSION - USERLIST_ID - CM360_DYNAMIC_TARGETING_KEY - DV360_LINE_ITEM_ID ",
          "type": "boolean"
        },
        "id": {
          "type": "integer",
          "format": "int32",
          "description": "Required. The ID of the field. The ID is based on the column index starting from 0, and it should match the column index in the resource link."
        },
        "defaultValue": {
          "type": "string",
          "description": "Optional. The default value of the field."
        },
        "renderable": {
          "type": "boolean",
          "description": "Optional. Whether the field is able to display. Could be set as true when the field type is not in any of the following and the field is not filterable: - COUNTRY_CODE_ISO - CITY - REGION - POSTAL_CODE - METRO - GEO_CANONICAL - USERLIST_ID - CONTEXTUAL_KEYWORD - CM360_DYNAMIC_TARGETING_KEY - WEIGHT "
        },
        "name": {
          "type": "string",
          "description": "Required. The name of the field."
        },
        "required": {
          "description": "Optional. Whether the field is required and should not be empty in the feed. Could be set as true when the field type is any of the following: - GPA_SERVED_IMAGE_URL - GPA_SERVED_ASSET_URL - ASSET_LIBRARY_HANDLE - ASSET_LIBRARY_VIDEO_HANDLE - ASSET_LIBRARY_DIRECTORY_HANDLE ",
          "type": "boolean"
        }
      },
      "description": "Each field of the element. This is a required field.",
      "type": "object"
    },
    "FeedIngestionStatus": {
      "type": "object",
      "description": "Contains the ingestion status of the dynamic feed. Feed ingestion is an asynchronous process. If the feed create request is successful, feed ingestion will be processed in the background, including validation, assets retrieval, and saving the data from the resource link. The processing time is dependent on the data size in the resource link. This read-only status field contains the current stage of that processing and its ingestion state.",
      "properties": {
        "ingestionStatus": {
          "$ref": "#/$defs/IngestionStatus",
          "description": "Output only. The ingestion status of the feed."
        },
        "ingestionErrorRecords": {
          "description": "Output only. The ingestion error records of the feed.",
          "readOnly": true,
          "type": "array",
          "items": {
            "$ref": "#/$defs/IngestionErrorRecord"
          }
        },
        "state": {
          "type": "string",
          "description": "Output only. The processing state of the feed.",
          "enum": [
            "FEED_PROCESSING_STATE_UNKNOWN",
            "CANCELLED",
            "INGESTING_QUEUED",
            "INGESTING",
            "INGESTED_SUCCESS",
            "INGESTED_FAILURE",
            "REQUEST_TO_PUBLISH",
            "PUBLISHING",
            "PUBLISHED_SUCCESS",
            "PUBLISHED_FAILURE"
          ],
          "readOnly": true
        }
      }
    },
    "FeedSchedule": {
      "description": "Contains the schedule of the dynamic feed.",
      "properties": {
        "repeatValue": {
          "type": "string",
          "description": "Optional. The number of times the feed retransforms within one day. This is a required field if the schedule is enabled. Acceptable values are between 1 to 6, inclusive.",
          "format": "int64"
        },
        "startHour": {
          "type": "string",
          "description": "Optional. The hour of the day to start the feed. It is applicable if the repeat value is equal to 1. Default value is 0."
        },
        "startMinute": {
          "description": "Optional. The minute of the hour to start the feed. It is applicable if the repeat value is equal to 1. Default value is 0.",
          "type": "string"
        },
        "scheduleEnabled": {
          "type": "boolean",
          "description": "Optional. Whether the schedule is enabled."
        },
        "timeZone": {
          "description": "Optional. The time zone to schedule the feed. It is applicable if the repeat value is equal to 1. Default value is \"America/Los_Angeles\".",
          "type": "string"
        }
      },
      "type": "object"
    },
    "FieldError": {
      "description": "Contains the field error of the dynamic feed.",
      "properties": {
        "fieldId": {
          "description": "Output only. The ID of the field.",
          "format": "int32",
          "type": "integer",
          "readOnly": true
        },
        "isError": {
          "readOnly": true,
          "description": "Output only. Incidcates whether the field has error or warning.",
          "type": "boolean"
        },
        "fieldName": {
          "type": "string",
          "description": "Output only. The name of the field.",
          "readOnly": true
        },
        "fieldValues": {
          "readOnly": true,
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Output only. The list of values of the field."
        },
        "ingestionError": {
          "enum": [
            "UNKNOWN_PARSING_ERROR",
            "MISSING_ID",
            "MISSING_REPORTING_LABEL",
            "EMPTY_VALUE",
            "ASSET_DOWNLOAD_ERROR",
            "ID_TOO_LONG",
            "DUPLICATE_ID",
            "PARSING_ERROR",
            "COUNTRY_PARSING_ERROR",
            "LONG_PARSING_ERROR",
            "BOOL_PARSING_ERROR",
            "EXPANDED_URL_PARSING_ERROR",
            "FLOAT_PARSING_ERROR",
            "DATETIME_PARSING_ERROR",
            "INVALID_PREFERENCE_VALUE",
            "GEO_NOT_FOUND_ERROR",
            "GEO_PARSING_ERROR",
            "GEO_PROXIMITY_TARGETING_MULTIPLE_LOCATION_ERROR",
            "POSTAL_CODE_PARSING_ERROR",
            "METRO_CODE_PARSING_ERROR",
            "DATETIME_WITHOUT_TIMEZONE_PARSING_ERROR",
            "WEIGHT_PARSING_ERROR",
            "CREATIVE_DIMENSION_PARSING_ERROR",
            "MULTIVALUE_ID",
            "ENDTIME_BEFORE_STARTTIME",
            "INVALID_ASSET_LIBRARY_HANDLE",
            "INVALID_ASSET_LIBRARY_VIDEO_HANDLE",
            "INVALID_ASSET_LIBRARY_DIRECTORY_HANDLE",
            "DYNAMIC_TARGETING_KEY_NOT_DEFINED_FOR_ADVERTISER",
            "USERLIST_ID_NOT_ACCESSIBLE_FOR_ADVERTISER",
            "ENDTIME_PASSED",
            "ENDTIME_TOO_SOON",
            "TEXT_ASSET_REFERENCE",
            "IMAGE_ASSET_SCS_REFERENCE",
            "AIRPORT_GEO_TARGET",
            "CANONICAL_NAME_QUERY_MISMATCH",
            "NO_DEFAULT_ROW",
            "NO_ACTIVE_DEFAULT_ROW",
            "NO_DEFAULT_ROW_IN_DATE_RANGE",
            "NO_ACTIVE_DEFAULT_ROW_IN_DATE_RANGE",
            "PAYLOAD_LIMIT_EXCEEDED",
            "SSL_NOT_COMPLIANT"
          ],
          "type": "string",
          "readOnly": true,
          "description": "Output only. The ingestion error of the field."
        }
      },
      "type": "object"
    },
    "IngestionErrorRecord": {
      "type": "object",
      "properties": {
        "recordId": {
          "readOnly": true,
          "description": "Output only. The record ID of the ingestion error record.",
          "type": "string"
        },
        "errors": {
          "items": {
            "$ref": "#/$defs/FieldError"
          },
          "readOnly": true,
          "type": "array",
          "description": "Output only. The list of field errors of the ingestion error record."
        }
      },
      "description": "Contains the ingestion error record of the dynamic feed. limited to 100 records."
    },
    "IngestionStatus": {
      "type": "object",
      "properties": {
        "numActiveRows": {
          "readOnly": true,
          "description": "Output only. The number of active rows in the feed.",
          "type": "string",
          "format": "int64"
        },
        "numRowsProcessed": {
          "readOnly": true,
          "type": "string",
          "format": "int64",
          "description": "Output only. The number of rows processed in the feed."
        },
        "numRowsWithErrors": {
          "format": "int64",
          "type": "string",
          "readOnly": true,
          "description": "Output only. The number of rows with errors in the feed."
        },
        "numRowsTotal": {
          "readOnly": true,
          "description": "Output only. The total number of rows in the feed.",
          "format": "int64",
          "type": "string"
        },
        "numWarningsTotal": {
          "readOnly": true,
          "type": "string",
          "description": "Output only. The total number of warnings in the feed.",
          "format": "int64"
        }
      },
      "description": "Contains the ingestion status of the dynamic feed."
    },
    "LastModifiedInfo": {
      "description": "Modification timestamp.",
      "properties": {
        "time": {
          "type": "string",
          "description": "Timestamp of the last change in milliseconds since epoch.",
          "format": "int64"
        }
      },
      "type": "object"
    }
  }
}