//Protocolversion:v.24//Copyright2024GoogleInc.AllRightsReserved.//Thetypeofidentifierbeinguploaded.enumUserIdType{//Auseridentifierreceivedthroughthecookiematchingservice.GOOGLE_USER_ID=0;//iOSAdvertisingID.IDFA=1;//AndroidAdvertisingID.ANDROID_ADVERTISING_ID=2;//RokuID.RIDA=5;//AmazonFireTVID.AFAI=6;//XBOX/MicrosoftID.MSAI=7;//A"generic"categoryforanyUUIDformatteddeviceprovidedID.//Allowspartneruploadswithoutneedingtoselectaspecific,//pre-existingDeviceIDtype.GENERIC_DEVICE_ID=9;//PartnerprovidedID.Useridentifierinpartner's namespace.//Ifthepartnerhassentthepartneruseridentifierduringcookiematching,//thenGooglewillbeabletostoreuserlistmembershipassociatedwith//thepartner's user identifier.//Seecookiematchingdocumentation://https://developers.google.com/authorized-buyers/rtb/cookie-guidePARTNER_PROVIDED_ID=4;}//Notificationcode.enumNotificationCode{//AcookieisconsideredinactiveifGooglehasnotseenanyactivityrelated//tothecookieinseveraldays.INACTIVE_COOKIE=0;}//Notificationstatuscode.enumNotificationStatus{//Noneedtosendnotificationsforthisrequest.NO_NOTIFICATION=0;//Googledecidedtonotsendnotifications,eventhoughtherewere//notificationstosend.NOTIFICATIONS_OMITTED=1;}//Updatedataforasingleuser.messageUserDataOperation{//Userid.Thetypeisdeterminedbytheuser_id_typefield.////Mustalwaysbepresent.Specifieswhichuserthisoperationappliesto.optionalstringuser_id=1[default=""];//Thetypeoftheuserid.optionalUserIdTypeuser_id_type=14[default=GOOGLE_USER_ID];//Theidoftheuserlist.ThiscanberetrievedfromtheAdXUIforAdX//customers,theAdWordsAPIfornon-AdXcustomers,orthroughyourTechnical//AccountManager.optionalint64user_list_id=4[default=0];//Optionaltime(secondssincetheepoch)whentheuserperformedanaction//causingthemtobeaddedtothelist.Usingthedefaultvalueof0//indicatesthatthecurrenttimeontheservershouldbeused.optionalint64time_added_to_user_list=5[default=0];//Sameastime_added_to_user_listbutwithfinergrainedtimeresolution,in//microseconds.Ifbothtimestampsarespecified,//time_added_to_user_list_in_usecwillbeused.optionalint64time_added_to_user_list_in_usec=8[default=0];//Settotrueiftheoperationisadeletion.optionalbooldelete=6[default=false];//Settrueiftheuseroptedoutfrombeingtargeted.optionalboolopt_out=12[default=false];//Anidindicatingthedatasourcewhichcontributedthismembership.Theid//isrequiredtobeintherangeof1to1000andanyidsgreaterthanthis//willresultinanerroroftypeBAD_DATA_SOURCE_ID.Theseidsdon't have//anysemanticsforGoogleandmaybeusedaslabelsforreportingpurposes.optionalint32data_source_id=7[default=0];}//Thisprotocolbufferisusedtoupdateuserdata.Itissentasthepayload//ofanHTTPSPOSTrequestwiththeContent-Typeheadersetto//"application/octet-stream"(preferrablyContent-Encoding:gzip).messageUpdateUsersDataRequest{//Multipleoperationsoveruserattributesoruserlists.repeatedUserDataOperationops=1;//Iftrue,requestsendingnotificationsaboutthegivenusersinthe//response.Notethatinsomecircumstancesnotificationsmaynotbesent//evenifrequested.Inthiscasethenotification_statusfieldofthe//responsewillbesettoNOTIFICATIONS_OMITTED.optionalboolsend_notifications=2[default=false];//PartnersusingtheBulkUploadAPImustindicatethattheyhavetheproper//legalbasistoshareuserdatawithGoogleforBulkUploadpurposesusing//theprocess_consentparameter.ThisrequirementappliestoallBulkUpload//requests.////Foruserdatathatrequiresend-userconsentas//requiredbyGoogle's EU User Consent Policy//(seehttps://www.google.com/about/company/user-consent-policy/)or//byotherlocallaws,partnersarerequiredtoobtain//end-userconsentandindicategatheredconsent//bysettingprocess_consent=True.////Foruserdatawhichisnotsubjecttoend-userconsentrequirements,//partnersarerequiredtoindicatethatconsentisnot//requiredbysettingprocess_consent=True.////Requestswithout`process_consent=True`willbefiltered.optionalboolprocess_consent=3[default=false];}//Responseerrorcodes.enumErrorCode{NO_ERROR=0;//Someoftheuserdataoperationsfailed.Seecommentsinthe//UpdateUserDataResponsePARTIAL_SUCCESS=1;//Providednetwork_idcannotadddatatoattribute_idornon-HTTPS.PERMISSION_DENIED=2;//Cannotparsepayload.BAD_DATA=3;//Cannotdecodeprovidedcookie.BAD_COOKIE=4;//Invalidorcloseduser_list_id.BAD_ATTRIBUTE_ID=5;//Aninvalidnidparameterwasprovidedintherequest.BAD_NETWORK_ID=7;//Requestpayloadsizeoverallowedlimit.REQUEST_TOO_BIG=8;//NoUserDataOperationmessagesinUpdateUsersDataRequest.EMPTY_REQUEST=9;//Theservercouldnotprocesstherequestduetoaninternalerror.Retrying//thesamerequestlaterissuggested.INTERNAL_ERROR=10;//Baddata_source_id--mostlikelyoutofrangefrom[1,1000].BAD_DATA_SOURCE_ID=11;//Thetimestampisapast/futuretimethatistoofarfromcurrenttime.BAD_TIMESTAMP=12;//PartnersusingtheBulkUploadAPImustindicatethattheyhavetheproper//legalbasistoshareuserdatawithGoogleforBulkUploadpurposesusing//theprocess_consentparameter.ThisrequirementappliestoallBulkUpload//requests.////Foruserdatathatrequiresend-userconsentas//requiredbyGoogle's EU User Consent Policy//(seehttps://www.google.com/about/company/user-consent-policy/)or//byotherlocallaws,partnersarerequiredtoobtain//end-userconsentandindicategatheredconsent//bysettingprocess_consent=True.////Foruserdatawhichisnotsubjecttoend-userconsentrequirements,//partnersarerequiredtoindicatethatconsentisnot//requiredbysettingprocess_consent=True.////Requestswhere`process_consent`ismissingwillbefilteredand//returnthefollowingerror:MISSING_CONSENT_WILL_BE_DROPPED=22;//Requestswhere`process_consent`issetto`false`willbefilteredand//returnthefollowingerror:MISSING_CONSENT=23;//Missinginternalmapping.//IfoperationisPARTNER_PROVIDED_ID,thenthiserrormeansourmapping//tabledoesnotcontaincorrespondinggoogleuserid.Thismappingis//recordedduringCookieMatching.//Forotheroperations,thenitmaybeinternalerror.UNKNOWN_ID=21;}//Informationaboutanerrorwithanindividualuseroperation.messageErrorInfo{//Theuser_list_idintherequestwhichcausedproblems.Thismaybeempty//iftheproblemwaswithaparticularuserid.optionalint64user_list_id=2[default=0];//Theuser_idwhichcausedproblems.Thismaybeemptyifotherdatawasbad//regardlessofacookie.optionalstringuser_id=3[default=""];//ThetypeoftheuserID.optionalUserIdTypeuser_id_type=7[default=GOOGLE_USER_ID];optionalErrorCodeerror_code=4;}//Perusernotificationinformation.messageNotificationInfo{//Theuser_idforwhichthenotificationapplies.Oneoftheuser_idssent//inaUserDataOperation.optionalstringuser_id=1[default=""];optionalNotificationCodenotification_code=2;}//ResponsetotheUpdateUsersDataRequest.SentinHTTPresponsetothe//originalPOSTrequest,withtheContent-Typeheadersetto//"application/octet-stream".TheHTTPresponsestatusiseither200(no//errors)or400,inwhichcasetheprotocolbufferwillprovideerrordetails.messageUpdateUsersDataResponse{//Whenstatus==PARTIAL_SUCCESS,some(notall)oftheoperationsfailedand//the"errors"fieldhasdetailsonthetypesandnumberoferrors//encountered.Whenstatus==NO_ERROR,allthedatawasimported//successfully.Whenstatus > PARTIAL_SUCCESSnodatawasimported.optionalErrorCodestatus=1;//Eachoperationthatfailedisreportedasaseparateerrorherewhen//status==PARTIAL_SUCCESS.repeatedErrorInfoerrors=2;//Useful,non-error,informationabouttheuseridsintherequest.Each//NotificationInfoprovidesinformationaboutasingleuserid.Onlysentif//UpdateUsersDataRequest.send_notificationsissettotrue.repeatedNotificationInfonotifications=3;//Indicateswhyanotificationhasnotbeensent.optionalNotificationStatusnotification_status=4;}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThis document outlines the protocol buffer used for updating user data through an HTTPS POST request with a specified content type.\u003c/p\u003e\n"],["\u003cp\u003eIt defines various data structures such as \u003ccode\u003eUserDataOperation\u003c/code\u003e, \u003ccode\u003eUpdateUsersDataRequest\u003c/code\u003e, and \u003ccode\u003eUpdateUsersDataResponse\u003c/code\u003e for managing user information, including user IDs, user list memberships, and data sources.\u003c/p\u003e\n"],["\u003cp\u003eIt also defines error codes and notification mechanisms for handling data upload operations and potential issues.\u003c/p\u003e\n"],["\u003cp\u003ePartners must indicate legal consent for data sharing via the \u003ccode\u003eprocess_consent\u003c/code\u003e parameter in bulk upload requests.\u003c/p\u003e\n"],["\u003cp\u003eThe response provides status codes, error details, and notifications regarding the success or failure of the data update operation.\u003c/p\u003e\n"]]],[],null,["[View raw content](/static/authorized-buyers/rtb/downloads/cookie-bulk-upload-proto.txt)\n[Back to Reference page](/authorized-buyers/rtb/data#protos) \n\n```gdscript\n// Protocol version: v.24\n// Copyright 2024 Google Inc. All Rights Reserved.\n\n// The type of identifier being uploaded.\nenum UserIdType {\n // A user identifier received through the cookie matching service.\n GOOGLE_USER_ID = 0;\n\n // iOS Advertising ID.\n IDFA = 1;\n\n // Android Advertising ID.\n ANDROID_ADVERTISING_ID = 2;\n\n // Roku ID.\n RIDA = 5;\n\n // Amazon Fire TV ID.\n AFAI = 6;\n\n // XBOX/Microsoft ID.\n MSAI = 7;\n\n // A \"generic\" category for any UUID formatted device provided ID.\n // Allows partner uploads without needing to select a specific,\n // pre-existing Device ID type.\n GENERIC_DEVICE_ID = 9;\n\n // Partner provided ID. User identifier in partner's namespace.\n // If the partner has sent the partner user identifier during cookie matching,\n // then Google will be able to store user list membership associated with\n // the partner's user identifier.\n // See cookie matching documentation:\n // https://developers.google.com/authorized-buyers/rtb/cookie-guide\n PARTNER_PROVIDED_ID = 4;\n}\n\n// Notification code.\nenum NotificationCode {\n // A cookie is considered inactive if Google has not seen any activity related\n // to the cookie in several days.\n INACTIVE_COOKIE = 0;\n}\n\n// Notification status code.\nenum NotificationStatus {\n // No need to send notifications for this request.\n NO_NOTIFICATION = 0;\n\n // Google decided to not send notifications, even though there were\n // notifications to send.\n NOTIFICATIONS_OMITTED = 1;\n}\n\n// Update data for a single user.\nmessage UserDataOperation {\n // User id. The type is determined by the user_id_type field.\n //\n // Must always be present. Specifies which user this operation applies to.\n optional string user_id = 1 [default = \"\"];\n\n // The type of the user id.\n optional UserIdType user_id_type = 14 [default = GOOGLE_USER_ID];\n\n // The id of the userlist. This can be retrieved from the AdX UI for AdX\n // customers, the AdWords API for non-AdX customers, or through your Technical\n // Account Manager.\n optional int64 user_list_id = 4 [default = 0];\n\n // Optional time (seconds since the epoch) when the user performed an action\n // causing them to be added to the list. Using the default value of 0\n // indicates that the current time on the server should be used.\n optional int64 time_added_to_user_list = 5 [default = 0];\n\n // Same as time_added_to_user_list but with finer grained time resolution, in\n // microseconds. If both timestamps are specified,\n // time_added_to_user_list_in_usec will be used.\n optional int64 time_added_to_user_list_in_usec = 8 [default = 0];\n\n // Set to true if the operation is a deletion.\n optional bool delete = 6 [default = false];\n\n // Set true if the user opted out from being targeted.\n optional bool opt_out = 12 [default = false];\n\n // An id indicating the data source which contributed this membership. The id\n // is required to be in the range of 1 to 1000 and any ids greater than this\n // will result in an error of type BAD_DATA_SOURCE_ID. These ids don't have\n // any semantics for Google and may be used as labels for reporting purposes.\n optional int32 data_source_id = 7 [default = 0];\n}\n\n// This protocol buffer is used to update user data. It is sent as the payload\n// of an HTTPS POST request with the Content-Type header set to\n// \"application/octet-stream\" (preferrably Content-Encoding: gzip).\nmessage UpdateUsersDataRequest {\n // Multiple operations over user attributes or user lists.\n repeated UserDataOperation ops = 1;\n\n // If true, request sending notifications about the given users in the\n // response. Note that in some circumstances notifications may not be sent\n // even if requested. In this case the notification_status field of the\n // response will be set to NOTIFICATIONS_OMITTED.\n optional bool send_notifications = 2 [default = false];\n\n // Partners using the Bulk Upload API must indicate that they have the proper\n // legal basis to share user data with Google for Bulk Upload purposes using\n // the process_consent parameter. This requirement applies to all Bulk Upload\n // requests.\n //\n // For user data that requires end-user consent as\n // required by Google's EU User Consent Policy\n // (see https://www.google.com/about/company/user-consent-policy/) or\n // by other local laws, partners are required to obtain\n // end-user consent and indicate gathered consent\n // by setting process_consent=True.\n //\n // For user data which is not subject to end-user consent requirements,\n // partners are required to indicate that consent is not\n // required by setting process_consent=True.\n //\n // Requests without `process_consent=True` will be filtered.\n optional bool process_consent = 3 [default = false];\n}\n\n// Response error codes.\nenum ErrorCode {\n NO_ERROR = 0;\n\n // Some of the user data operations failed. See comments in the\n // UpdateUserDataResponse\n PARTIAL_SUCCESS = 1;\n\n // Provided network_id cannot add data to attribute_id or non-HTTPS.\n PERMISSION_DENIED = 2;\n\n // Cannot parse payload.\n BAD_DATA = 3;\n\n // Cannot decode provided cookie.\n BAD_COOKIE = 4;\n\n // Invalid or closed user_list_id.\n BAD_ATTRIBUTE_ID = 5;\n\n // An invalid nid parameter was provided in the request.\n BAD_NETWORK_ID = 7;\n\n // Request payload size over allowed limit.\n REQUEST_TOO_BIG = 8;\n\n // No UserDataOperation messages in UpdateUsersDataRequest.\n EMPTY_REQUEST = 9;\n\n // The server could not process the request due to an internal error. Retrying\n // the same request later is suggested.\n INTERNAL_ERROR = 10;\n\n // Bad data_source_id -- most likely out of range from [1, 1000].\n BAD_DATA_SOURCE_ID = 11;\n\n // The timestamp is a past/future time that is too far from current time.\n BAD_TIMESTAMP = 12;\n\n // Partners using the Bulk Upload API must indicate that they have the proper\n // legal basis to share user data with Google for Bulk Upload purposes using\n // the process_consent parameter. This requirement applies to all Bulk Upload\n // requests.\n //\n // For user data that requires end-user consent as\n // required by Google's EU User Consent Policy\n // (see https://www.google.com/about/company/user-consent-policy/) or\n // by other local laws, partners are required to obtain\n // end-user consent and indicate gathered consent\n // by setting process_consent=True.\n //\n // For user data which is not subject to end-user consent requirements,\n // partners are required to indicate that consent is not\n // required by setting process_consent=True.\n //\n // Requests where `process_consent` is missing will be filtered and\n // return the following error:\n MISSING_CONSENT_WILL_BE_DROPPED = 22;\n\n // Requests where `process_consent` is set to `false` will be filtered and\n // return the following error:\n MISSING_CONSENT = 23;\n\n // Missing internal mapping.\n // If operation is PARTNER_PROVIDED_ID, then this error means our mapping\n // table does not contain corresponding google user id. This mapping is\n // recorded during Cookie Matching.\n // For other operations, then it may be internal error.\n UNKNOWN_ID = 21;\n}\n\n// Information about an error with an individual user operation.\nmessage ErrorInfo {\n // The user_list_id in the request which caused problems. This may be empty\n // if the problem was with a particular user id.\n optional int64 user_list_id = 2 [default = 0];\n\n // The user_id which caused problems. This may be empty if other data was bad\n // regardless of a cookie.\n optional string user_id = 3 [default = \"\"];\n\n // The type of the user ID.\n optional UserIdType user_id_type = 7 [default = GOOGLE_USER_ID];\n\n optional ErrorCode error_code = 4;\n}\n\n// Per user notification information.\nmessage NotificationInfo {\n // The user_id for which the notification applies. One of the user_ids sent\n // in a UserDataOperation.\n optional string user_id = 1 [default = \"\"];\n\n optional NotificationCode notification_code = 2;\n}\n\n// Response to the UpdateUsersDataRequest. Sent in HTTP response to the\n// original POST request, with the Content-Type header set to\n// \"application/octet-stream\". The HTTP response status is either 200 (no\n// errors) or 400, in which case the protocol buffer will provide error details.\nmessage UpdateUsersDataResponse {\n // When status == PARTIAL_SUCCESS, some (not all) of the operations failed and\n // the \"errors\" field has details on the types and number of errors\n // encountered. When status == NO_ERROR, all the data was imported\n // successfully. When status \u003e PARTIAL_SUCCESS no data was imported.\n optional ErrorCode status = 1;\n\n // Each operation that failed is reported as a separate error here when\n // status == PARTIAL_SUCCESS.\n repeated ErrorInfo errors = 2;\n\n // Useful, non-error, information about the user ids in the request. Each\n // NotificationInfo provides information about a single user id. Only sent if\n // UpdateUsersDataRequest.send_notifications is set to true.\n repeated NotificationInfo notifications = 3;\n\n // Indicates why a notification has not been sent.\n optional NotificationStatus notification_status = 4;\n}\n```"]]