{"openapi":"3.1.0","info":{"title":"userdb","version":"1.0"},"servers":[{"url":"https://e-{networkId}.adzerk.net/udb/{networkId}","variables":{"networkId":{"default":"networkId"}}}],"components":{"securitySchemes":{}},"security":[{}],"paths":{"/read":{"get":{"summary":"Read User Record","description":"This endpoint returns all data about a specific user record in UserDB.","operationId":"read-a-users-record","parameters":[{"name":"networkId","in":"path","description":"Your account (network) ID","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"key\": \"ue1-e397eb5990\",\n    \"interests\": [\n        \"news\",\n        \"sports\"\n    ],\n    \"segments\": [\n        79\n    ],\n    \"blockedItems\": {\n        \"advertisers\": [\n            1234,\n            1235\n        ],\n        \"campaigns\": [\n            12345,\n            12346\n        ],\n        \"creatives\": [\n            123456,\n            123457\n        ],\n        \"flights\": [\n            234567,\n            234568\n        ]\n    },\n    \"partnerUserIds\": {\n        \"p1\": [\n            \"0shj0we09hw\"\n        ]\n    },\n    \"retargetingSegments\": {\n        \"b12345\": [\n            2,\n            3,\n            4\n        ]\n    },\n    \"custom\": {\n        \"anything\": \"goes\",\n        \"lookAtMe\": [\n            \"itsAnArray\",\n            42\n        ]\n    },\n    \"consent\": {\n        \"gdpr\": true\n    },\n    \"optOut\": false,\n    \"ip\": \"10.10.10.10\"\n}"}},"schema":{"type":"object","properties":{"key":{"type":"string","example":"ue1-e397eb5990"},"interests":{"type":"array","items":{"type":"string","example":"news"}},"segments":{"type":"array","items":{"type":"integer","example":79,"default":0}},"blockedItems":{"type":"object","properties":{"advertisers":{"type":"array","items":{"type":"integer","example":1234,"default":0}},"campaigns":{"type":"array","items":{"type":"integer","example":12345,"default":0}},"creatives":{"type":"array","items":{"type":"integer","example":123456,"default":0}},"flights":{"type":"array","items":{"type":"integer","example":234567,"default":0}}}},"partnerUserIds":{"type":"object","properties":{"p1":{"type":"array","items":{"type":"string","example":"0shj0we09hw"}}}},"retargetingSegments":{"type":"object","properties":{"b12345":{"type":"array","items":{"type":"integer","example":2,"default":0}}}},"custom":{"type":"object","properties":{"anything":{"type":"string","example":"goes"},"lookAtMe":{"type":"array"}}},"consent":{"type":"object","properties":{"gdpr":{"type":"boolean","example":true,"default":true}}},"optOut":{"type":"boolean","example":false,"default":true},"ip":{"type":"string","example":"10.10.10.10"}}}}}}},"deprecated":false,"security":[],"x-readme":{"code-samples":[{"language":"curl","code":"curl -b \"azk=ue1-e397eb5990\" \"https://e-23.adzerk.net/udb/23/read\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/decision-sdk');\n\n// Demo network ID; find your own via the Adzerk UI!\nlet client = new Adzerk.Client({networkId: 23});\nclient.userDb.read(\"ue1-e397eb5990\").then(response => console.log(response));"},{"language":"java","code":"import com.adzerk.sdk.*;\nimport com.adzerk.sdk.generated.ApiException;\nimport com.adzerk.sdk.model.UserRecord;\nimport org.apache.commons.lang3.builder.ToStringBuilder;\n\npublic class FetchUserDb {\n  public static void main(String[] argv) throws ApiException {\n    // Demo network ID; find your own via the Adzerk UI!    \n    Client client = new Client(new ClientOptions(23));\n    UserRecord record = client.userDb().read(\"ue1-e397eb5990\");\n    System.out.println(ToStringBuilder.reflectionToString(record));\n  }  \n}\n"},{"language":"python","code":"import adzerk_decision_sdk\n\n# Demo network ID; find your own via the Adzerk UI!\nclient = adzerk_decision_sdk.Client(23)\nrecord = client.user_db.read(\"ue1-e397eb5990\")\nprint(record)"},{"language":"ruby","code":"require \"adzerk_decision_sdk\"\n\n# Demo network ID; find your own via the Adzerk UI!\nclient = AdzerkDecisionSdk::Client.new(network_id: 23)\npp client.user_db.read(\"ue1-e397eb5990\")"},{"language":"clojure","code":"(ns read-userdb-sample\n  (:use clojure.pprint)\n  (:import (com.adzerk.sdk Client ClientOptions)))\n\n(defn -main []\n  ; Demo network ID; find your own via the Adzerk UI!\n  (let [client (Client. (doto (ClientOptions. (int 23))))]\n    (pprint (bean (-> client (.userDb) (.read \"ue1-e397eb5990\"))))))\n"},{"language":"swift","code":"import AdzerkSDK\n\n// Demo network ID; find your own via the Adzerk UI!\nDecisionSDK.defaultNetworkId = 23\n\nlet keyStore = UserKeyStoreKeychain()\nkeyStore.save(userKey: \"ue1-e397eb5990\")\n\nlet client = DecisionSDK(keyStore: keyStore)\n\nclient.userDB().readUser() {response in\n  dump(response)\n}"}],"samples-languages":["curl","javascript","java","python","ruby","clojure","swift"]}}},"/custom":{"post":{"summary":"Set Custom Properties","description":"With this you can tie Custom Properties to a specific UserKey using key/value pairs. For instance, `{\"Key\":\"Value\"}` could be `{\"favoriteColor\": \"blue\"}`.  Note that each call to set custom properties will replace any existing custom properties.","operationId":"set-custom-properties-to-user","parameters":[{"name":"property","in":"query","description":"Appends one or more key/value pairs to be shipped to UserDB logs. In the format `?property:Key1=Value&property:Key2=Value` etc.","schema":{"type":"string"}},{"name":"networkId","in":"path","description":"Your account (network) ID","schema":{"type":"integer","format":"int32"},"required":true},{"in":"query","name":"group","schema":{"type":"integer"},"description":"Optional. Sets the user's incrementality group (1–100) as part of this request; use `group=null` to clear it, or omit to leave it unchanged. Invalid values reject the entire request."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Key/Value Object"],"properties":{"Key/Value Object":{"type":"string","description":"This is a JSON object that can be anything since it's custom data. For instance, `{\"favoriteColor\": \"blue\"}`."}}}}}},"responses":{"200":{"description":"200","content":{"text/plain":{"examples":{"Result":{"value":"[Returns a 1x1 transparent GIF image]"}}}}}},"security":[],"x-readme":{"code-samples":[{"language":"curl","code":"curl -b \"azk=ue1-e397eb5990\" -X POST https://e-23.adzerk.net/udb/23/custom -d '{\"favoriteColor\":\"blue\"}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/decision-sdk');\n\n// Demo network ID; find your own via the Adzerk UI!\nlet client = new Adzerk.Client({networkId: 23});\n\nlet props = {\n  favoriteColor: \"blue\",\n  favoriteNumber: 42,\n  favoriteFoods: [\"strawberries\", \"chocolate\"]\n};\n\nclient.userDb.setCustomProperties(\"ue1-e397eb5990\", props);\n"},{"language":"java","code":"import java.util.*;\nimport com.adzerk.sdk.*;\nimport com.adzerk.sdk.generated.ApiException;\n\npublic class SetUserDb {\n  public static void main(String[] argv) throws ApiException {\n    // Demo network ID; find your own via the Adzerk UI!\n    Client client = new Client(new ClientOptions(23));\n\n    Map props = Map.of(\n      \"favoriteColor\", \"blue\",\n      \"favoriteNumber\", 42,\n      \"favoriteFoods\", new String[] {\"strawberries\", \"chocolate\"});\n\n    client.userDb().setCustomProperties(\"ue1-e397eb5990\", props);\n  }\n}"},{"language":"python","code":"import adzerk_decision_sdk\n\n# Demo network ID; find your own via the Adzerk UI!\nclient = adzerk_decision_sdk.Client(23)\n\nprops = {\n  \"favoriteColor\": \"blue\",\n  \"favoriteNumber\": 42,\n  \"favoriteFoods\": [\"strawberries\", \"chocolate\"],\n}\n\nclient.user_db.set_custom_properties(\"ue1-e397eb5990\", props)"},{"language":"ruby","code":"require \"adzerk_decision_sdk\"\n\n# Demo network ID; find your own via the Adzerk UI!\nclient = AdzerkDecisionSdk::Client.new(network_id: 23)\n\nprops = {\n  favoriteColor: \"blue\",\n  favoriteNumber: 42,\n  favoriteFoods: [\"strawberries\", \"chocolate\"],\n}\n\nclient.user_db.set_custom_properties(\"ue1-e397eb5990\", props)"},{"language":"clojure","code":"(ns set-userdb-sample\n  (:import (com.adzerk.sdk Client ClientOptions)))\n\n(defn -main []\n  ; Demo network ID; find your own via the Adzerk UI!\n  (let [client (Client. (doto (ClientOptions. (int 23))))\n        props {\"favoriteColor\" \"blue\"\n               \"favoriteNumber\" 42\n               \"favoriteFoods\" [\"strawberries\", \"chocolate\"]}]\n    (-> client (.userDb) (.setCustomProperties \"ue1-e397eb5990\" props))))\n"},{"language":"swift","code":"import AdzerkSDK\n\n// Demo network ID; find your own via the Adzerk UI!\nDecisionSDK.defaultNetworkId = 23\n\nlet keyStore = UserKeyStoreKeychain()\nkeyStore.save(userKey: \"abc\")\n\nlet client = DecisionSDK(keyStore: keyStore)\n\nlet props:[String: AnyCodable] = [\n    \"favoriteColor\":  .string(\"blue\"),\n    \"favoriteNumber\": .int(42),\n    \"favoriteFoods\":  .array([\n        .string(\"strawberries\"),\n        .string(\"chocolate\"),\n    ])\n]\n\nclient.userDB().postProperties(props) {response in\n  dump(response)\n}"}],"samples-languages":["curl","javascript","java","python","ruby","clojure","swift"]}}},"/customProperties":{"post":{"summary":"Set Custom Properties (REST)","description":"","operationId":"set-custom-properties-alternative","parameters":[{"name":"networkId","in":"path","description":"Your account (network) ID","schema":{"type":"integer","format":"int32"},"required":true},{"name":"userKey","in":"query","required":true,"schema":{"type":"string"}},{"in":"query","name":"group","schema":{"type":"integer"},"description":"Optional. Sets the user's incrementality group (1–100) as part of this request; use `group=null` to clear it, or omit to leave it unchanged. Invalid values reject the entire request."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"RAW_BODY":{"type":"string","description":"A JSON object that can be anything since it's custom data. For instance, `{\"favoriteColor\": \"blue\"}`.","format":"json"}}}}}},"responses":{"200":{"description":"200","content":{"text/plain":{"examples":{"Result":{"value":"[Returns a 1x1 transparent GIF image]\n"}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"x-readme":{"code-samples":[{"language":"curl","code":"curl -H \"X-Adzerk-ApiKey: $ADZERK_API_KEY\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '{\"favoriteColor\":\"blue\"}' \\\n     \"https://e-23.adzerk.net/udb/23/customProperties?userKey=ue1-e397eb5990\""}],"samples-languages":["curl"]}}},"/interest/i.gif?userKey={UserKey}&interest={interest}":{"get":{"summary":"Add Interest To A User","description":"This pixel endpoint adds an Interest to a specific UserKey via query params.  Calling this endpoint multiple times will add multiple Interests.","operationId":"add-interest-to-user","parameters":[{"name":"userKey","in":"query","description":"UserDB ID for the user","required":true,"schema":{"type":"string"}},{"name":"interest","in":"query","description":"The interest category friendly name you want to tie to the user","required":true,"schema":{"type":"string"}},{"name":"property","in":"query","description":"Appends one or more key/value pairs to be shipped to UserDB logs. In the format `?property:Key1=Value&property:Key2=Value` etc.","schema":{"type":"string"}},{"name":"networkId","in":"path","description":"Your account (network) ID","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"text/plain":{"examples":{"Result":{"value":"[Returns a 1x1 transparent GIF image]"}}}}}},"deprecated":false,"security":[],"x-readme":{"code-samples":[{"language":"curl","code":"curl \"https://e-23.adzerk.net/udb/23/interest/i.gif?userKey=ue1-e397eb5990&interest=Sports\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/decision-sdk');\n\n// Demo network ID; find your own via the Adzerk UI!\nlet client = new Adzerk.Client({networkId: 23});\nclient.userDb.addInterest(\"ue1-e397eb5990\", \"Sports\");"},{"language":"java","code":"import com.adzerk.sdk.*;\nimport com.adzerk.sdk.generated.ApiException;\n\npublic class AddInterestUserDB {\n  public static void main(String[] argv) throws ApiException {\n    // Demo network ID; find your own via the Adzerk UI!\n    Client client = new Client(new ClientOptions(23));\n    client.userDb().addInterest(\"ue1-e397eb5990\", \"Sports\");\n  }\n}  "},{"language":"python","code":"import adzerk_decision_sdk\n\n# Demo network ID; find your own via the Adzerk UI!\nclient = adzerk_decision_sdk.Client(23)\nclient.user_db.add_interest(\"ue1-e397eb5990\", \"Sports\")"},{"language":"ruby","code":"require \"adzerk_decision_sdk\"\n\n# Demo network ID; find your own via the Adzerk UI!\nclient = AdzerkDecisionSdk::Client.new(network_id: 23)\nclient.user_db.add_interest(\"ue1-e397eb5990\", \"Sports\")"},{"language":"clojure","code":"(ns add-interest-userdb-sample\n  (:import (com.adzerk.sdk Client ClientOptions)))\n\n(defn -main []\n  ; Demo network ID; find your own via the Adzerk UI!\n  (let [client (Client. (doto (ClientOptions. (int 23))))]\n    (-> client (.userDb) (.addInterest \"ue1-e397eb5990\" \"Sports\"))))"},{"language":"swift","code":"import AdzerkSDK\n\n// Demo network ID; find your own via the Kevel UI!\nDecisionSDK.defaultNetworkId = 23\n\nlet keyStore = UserKeyStoreKeychain()\nkeyStore.save(userKey: \"abc\")\n\nlet client = DecisionSDK(keyStore: keyStore)\n\nclient.userDB().addInterest(\"Sports\") {response in\n  dump(response)\n}"}],"samples-languages":["curl","javascript","java","python","ruby","clojure","swift"]}}},"/interests":{"post":{"summary":"Add Multiple Interests to a User","description":"This REST endpoint adds multiple Interests to a specific UserKey via query params.","operationId":"add-interests","parameters":[{"name":"networkId","in":"path","description":"Your account (network) ID","schema":{"type":"integer","format":"int32"},"required":true},{"name":"userKey","in":"query","description":"UserDB ID for the user","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["RAW_BODY"],"properties":{"RAW_BODY":{"type":"array","description":"Interests to be added to the User Record","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"200","content":{"text/plain":{"examples":{"Result":{"value":"[Returns a 1x1 transparent GIF image]"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -H \"X-Adzerk-ApiKey: $ADZERK_API_KEY\" \\\n     -H \"Content-Type: application/json\" \\\n     -d '[\"Biking\", \"Hiking\"]' \\\n     \"https://e-23.adzerk.net/udb/23/interests?userKey=ue1-e397eb5990\""}],"samples-languages":["curl"]}},"delete":{"summary":"Remove Multiple Interests","description":"This REST endpoint removes multiple Interests to a specific UserKey via query params.","operationId":"remove-multiple-interests","parameters":[{"name":"networkId","in":"path","description":"Your account (network) ID","schema":{"type":"integer","format":"int32"},"required":true},{"name":"userKey","in":"query","description":"UserDB ID for the user","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"RAW_BODY":{"type":"array","description":"Interests to be removed to the User Record","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"200","content":{"text/plain":{"examples":{"Result":{"value":"[Returns a 1x1 transparent GIF image]"}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -H \"X-Adzerk-ApiKey: $ADZERK_API_KEY\" \\\n     -H \"Content-Type: application/json\" \\\n     -X DELETE \\\n     -d '[\"Biking\", \"Hiking\"]' \\\n     \"https://e-23.adzerk.net/udb/23/interests?userKey=ue1-e397eb5990\""}],"samples-languages":["curl"]}}},"/rt/{advertiserID}/{segment}/i.gif":{"get":{"summary":"Add User To Retargeting Segment","description":"This pixel endpoint adds a specific UserKey to a Retargeting Segment.","operationId":"add-user-to-retargeting-segment","parameters":[{"name":"networkId","in":"path","description":"Your account (network) ID","schema":{"type":"integer","format":"int32"},"required":true},{"name":"advertiserId","in":"path","description":"The ID of the Advertiser","schema":{"type":"integer","format":"int32"},"required":true},{"name":"segment","in":"path","description":"This is an integer you choose to denote the Retargeting segment. You could have multiple if you wanted to track multiple pages. That said, this is rare and most advertisers will just want a single pixel. In this case, you can just set `segment` to `1`.","schema":{"type":"integer","format":"int32"},"required":true},{"name":"property","in":"query","description":"Appends one or more key/value pairs to be shipped to UserDB logs. In the format `?property:Key1=Value&property:Key2=Value` etc.","schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"text/plain":{"examples":{"Result":{"value":"[Returns a 1x1 transparent GIF image]"}}}}}},"deprecated":false,"security":[],"x-readme":{"code-samples":[{"language":"curl","code":"curl -b \"azk=ue1-e397eb5990\" https://e-23.adzerk.net/udb/23/rt/78189/1/i.gif"},{"language":"javascript","code":"const Adzerk = require('@adzerk/decision-sdk');\n\n// Demo network ID; find your own via the Adzerk UI!\nlet client = new Adzerk.Client({networkId: 23});\nclient.userDb.addRetargetingSegment(\"ue1-e397eb5990\", 78189, 1);"},{"language":"java","code":"import com.adzerk.sdk.*;\nimport com.adzerk.sdk.generated.ApiException;\n\npublic class RetargetingSegmentUserDB {\n  public static void main(String[] argv) throws ApiException {\n    // Demo network ID; find your own via the Adzerk UI!\n    Client client = new Client(new ClientOptions(23));\n    client.userDb().addRetargetingSegment(\"ue1-e397eb5990\", 78189, 1);\n  }\n}"},{"language":"python","code":"import adzerk_decision_sdk\n\n# Demo network ID; find your own via the Adzerk UI!\nclient = adzerk_decision_sdk.Client(23)\nclient.user_db.add_retargeting_segment(\"ue1-e397eb5990\", 78189, 1)"},{"language":"ruby","code":"require \"adzerk_decision_sdk\"\n\n# Demo network ID; find your own via the Adzerk UI!\nclient = AdzerkDecisionSdk::Client.new(network_id: 23)\nclient.user_db.add_retargeting_segment(\"ue1-e397eb5990\", 78189, 1)"},{"language":"clojure","code":"(ns retargeting-userdb-sample\n  (:import (com.adzerk.sdk Client ClientOptions)))\n\n(defn -main []\n  ; Demo network ID; find your own via the Adzerk UI!\n  (let [client (Client. (doto (ClientOptions. (int 23))))]\n    (-> client (.userDb) (.addRetargetingSegment \"ue1-e397eb5990\", 78189, 1))))"},{"language":"swift","code":"import AdzerkSDK\n\n// Demo network ID; find your own via the Kevel UI!\nDecisionSDK.defaultNetworkId = 23\n\nlet keyStore = UserKeyStoreKeychain()\nkeyStore.save(userKey: \"abc\")\n\nlet client = DecisionSDK(keyStore: keyStore)\n\nclient.userDB().retargetUser(advertiserId: 78189, segment: 1) {response in\n  dump(response)\n}"}],"samples-languages":["curl","javascript","java","python","ruby","clojure","swift"]}}},"/optout/i.gif":{"get":{"summary":"Opt-Out A User","description":"If you'd like to opt-out a user from UserDB tracking, you can do that by firing the pixel below. This prevents future data from being written.  It also excludes the user from frequency capping.","operationId":"opt-out-a-user","parameters":[{"name":"property","in":"query","description":"Appends one or more key/value pairs to be shipped to UserDB logs. In the format `?property:Key1=Value&property:Key2=Value` etc.","schema":{"type":"string"}},{"name":"networkId","in":"path","description":"Your account (network) ID","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"text/plain":{"examples":{"Result":{"value":"[Returns a 1x1 transparent GIF image]"}}}}}},"deprecated":false,"security":[],"x-readme":{"code-samples":[{"language":"curl","code":"curl -b \"azk=ue1-e397eb5990\" https://e-23.adzerk.net/udb/23/optout/i.gif"},{"language":"javascript","code":"const Adzerk = require('@adzerk/decision-sdk');\n\n// Demo network ID; find your own via the Adzerk UI!\nlet client = new Adzerk.Client({networkId: 23});\n\n// REMEMBER: after opt-out a record becomes read-only\n// until you \"forget\" it and recreate!\nclient.userDb.optOut(\"ue1-e397eb5990\");"},{"language":"java","code":"import com.adzerk.sdk.*;\nimport com.adzerk.sdk.generated.ApiException;\n\npublic class OptOutUserDB {\n  public static void main(String[] argv) throws ApiException {\n    // Demo network ID; find your own via the Adzerk UI!\n    Client client = new Client(new ClientOptions(23));\n\n    // REMEMBER: after opt-out a record becomes read-only\n    // until you \"forget\" it and recreate!\n    client.userDb().optOut(\"ue1-e397eb5990\");\n  }\n}\n"},{"language":"python","code":"import adzerk_decision_sdk\n\n# Demo network ID; find your own via the Adzerk UI!\nclient = adzerk_decision_sdk.Client(23)\n\n# REMEMBER: after opt-out a record becomes read-only\n# until you \"forget\" it and recreate!\nclient.user_db.opt_out(\"ue1-e397eb5990\")"},{"language":"ruby","code":"require \"adzerk_decision_sdk\"\n\n# Demo network ID; find your own via the Adzerk UI!\nclient = AdzerkDecisionSdk::Client.new(network_id: 23)\n\n# REMEMBER: after opt-out a record becomes read-only\n# until you \"forget\" it and recreate!\nclient.user_db.opt_out(\"ue1-e397eb5990\")"},{"language":"clojure","code":"(ns readme-userdb-opt-out\n  (:import (com.adzerk.sdk Client ClientOptions)))\n\n(defn -main []\n  ; Demo network ID; find your own via the Adzerk UI!\n  (let [client (Client. (doto (ClientOptions. (int 23))))]\n    ; REMEMBER: after opt-out a record becomes read-only\n    ; until you \"forget\" it and recreate!\n    (-> client (.userDb) (.optOut \"ue1-e397eb5990\"))))"},{"language":"swift","code":"import AdzerkSDK\n\n// Demo network ID; find your own via the Kevel UI!\nDecisionSDK.defaultNetworkId = 23\n\nlet keyStore = UserKeyStoreKeychain()\nkeyStore.save(userKey: \"abc\")\n\nlet client = DecisionSDK(keyStore: keyStore)\n\n// REMEMBER: after opt-out a record becomes read-only\n// until you \"forget\" it and recreate!\nclient.userDB().optOut() {response in\n  dump(response)\n}"}],"samples-languages":["curl","javascript","java","python","ruby","clojure","swift"]}}},"/ip/i.gif?ip={IP}":{"get":{"summary":"IP Address Override","description":"You can set an IP address on a user that will be used as the effective IP whenever that user makes an request. For example, the actual IP address of the user may be proxied or unreadable at serving time, which would require you to use a stored IP.\n\nAn HTTP status of 200 indicates that the IP address was set on the user. If you read the user's key using the /read endpoint, you'll see the new top-level parameter ip with the IP address.","operationId":"ip-address-override","parameters":[{"name":"networkId","in":"path","description":"Your account (network) ID","schema":{"type":"integer","format":"int32"},"required":true},{"name":"IP","in":"path","description":"This is the IP to exclude","schema":{"type":"string"},"required":true},{"name":"property","in":"query","description":"Appends one or more key/value pairs to be shipped to UserDB logs. In the format `?property:Key1=Value&property:Key2=Value` etc.","schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"text/plain":{"examples":{"Result":{"value":"[Returns a 1x1 transparent GIF image]"}}}}}},"deprecated":false,"security":[],"x-readme":{"code-samples":[{"language":"curl","code":"curl -b \"azk=ue1-e397eb5990\" \"https://e-23.adzerk.net/udb/23/ip/i.gif?ip=10.10.10.10\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/decision-sdk');\n\n// Demo network ID; find your own via the Adzerk UI!\nlet client = new Adzerk.Client({networkId: 23});\nclient.userDb.ipOverride(\"ue1-e397eb5990\", \"10.10.10.10\");"},{"language":"java","code":"import com.adzerk.sdk.*;\nimport com.adzerk.sdk.generated.ApiException;\n\npublic class OverrideIpAddressUserDB {\n  public static void main(String[] argv) throws ApiException {\n    // Demo network ID; find your own via the Adzerk UI!\n    Client client = new Client(new ClientOptions(23));\n    client.userDb().ipOverride(\"ue1-e397eb5990\", \"10.10.10.10\");\n  }\n}"},{"language":"python","code":"import adzerk_decision_sdk\n\n# Demo network ID; find your own via the Adzerk UI!\nclient = adzerk_decision_sdk.Client(23)\nclient.user_db.ip_override(\"ue1-e397eb5990\", \"10.10.10.10\")"},{"language":"ruby","code":"require \"adzerk_decision_sdk\"\n\n# Demo network ID; find your own via the Adzerk UI!\nclient = AdzerkDecisionSdk::Client.new(network_id: 23)\nclient.user_db.ip_override(\"ue1-e397eb5990\", \"10.10.10.10\")"},{"language":"clojure","code":"(ns override-ip-userdb-sample\n  (:import (com.adzerk.sdk Client ClientOptions)))\n\n(defn -main []\n  ; Demo network ID; find your own via the Adzerk UI!\n  (let [client (Client. (doto (ClientOptions. (int 23))))]\n    (-> client (.userDb) (.ipOverride \"ue1-e397eb5990\" \"10.10.10.10\"))))"}],"samples-languages":["curl","javascript","java","python","ruby","clojure"]}}},"/?userKey={userKey}":{"delete":{"summary":"Forget User","description":"The forget user endpoint goes further than the opt-out endpoint by removing a UserDB record entirely and unsetting the azk cookie that contains the UserKey. It provides users tracked by Kevel customers with the right to be forgotten. Note that this endpoint requires Kevel authentication.","operationId":"forget-user","parameters":[{"name":"userKey","in":"query","description":"The UserDB ID attached to the user","required":true,"schema":{"type":"string"}},{"name":"property","in":"query","description":"Appends one or more key/value pairs to be shipped to UserDB logs. In the format `?property:Key1=Value&property:Key2=Value` etc.","schema":{"type":"string"}},{"name":"networkId","in":"path","description":"Your account (network) ID","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"text/plain":{"examples":{"Result":{"value":"[Endpoint has no response]"}}}}},"401":{"description":"401","content":{"text/plain":{"examples":{"Result":{"value":"You must provide your Adzerk API key in the X-Adzerk-ApiKey header."}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X DELETE -H \"X-Adzerk-ApiKey:<YOUR-API-KEY>\"  https://e-23.adzerk.net/udb/23?userKey=ue1-e397eb5990"},{"language":"javascript","code":"const Adzerk = require('@adzerk/decision-sdk');\n\n// Demo network ID and API key; find your own via the Kevel UI!\nlet client = new Adzerk.Client({networkId: 23, apiKey: \"YOUR-API-KEY\"});\nclient.userDb.forget(\"ue1-e397eb5990\");"},{"language":"java","code":"import com.adzerk.sdk.*;\nimport com.adzerk.sdk.generated.ApiException;\n\npublic class ForgetUserDb {\n  public static void main(String[] argv) throws ApiException {\n    // Demo network ID and API key; find your own via the Adzerk UI!\n    Client client = new Client(new ClientOptions(23).apiKey(\"YOUR-API-KEY\"));\n    client.userDb().forget(\"ue1-e397eb5990\");\n  }\n}"},{"language":"python","code":"import adzerk_decision_sdk\n\n# Demo network ID and API key; find your own via the Adzerk UI!\nclient = adzerk_decision_sdk.Client(23, api_key=\"YOUR_API_KEY\")\nclient.user_db.forget(\"ue1-e397eb5990\")"},{"language":"ruby","code":"require \"adzerk_decision_sdk\"\n\n# Demo network ID and API key; find your own via the Adzerk UI!\nclient = AdzerkDecisionSdk::Client.new(network_id: 23, api_key: \"YOUR_API_KEY\")\nclient.user_db.forget(\"ue1-e397eb5990\")"},{"language":"clojure","code":"(ns forget-userdb-sample\n  (:import (com.adzerk.sdk Client ClientOptions)))\n\n(defn -main []\n  ; Demo network ID and API key; find your own via the Adzerk UI!\n  (let [client (Client. (doto (ClientOptions. (int 23)) (.apiKey \"YOUR-API-KEY\")))]\n    (-> client (.userDb) (.forget \"ue1-e397eb5990\"))))"}],"samples-languages":["curl","javascript","java","python","ruby","clojure"]}}},"/consent":{"post":{"summary":"GDPR Consent","description":"You can set GDPR consent for a specific user in UserDB with the consent endpoint. The consent status will be honored anytime the UserKey is used in a request.  This endpoint requires authentication.","operationId":"gdpr-consent","parameters":[{"name":"property","in":"query","description":"Appends one or more key/value pairs to be shipped to UserDB logs. In the format `?property:Key1=Value&property:Key2=Value` etc.","schema":{"type":"string"}},{"name":"networkId","in":"path","description":"Your account (network) ID","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["userKey","consent"],"properties":{"userKey":{"type":"string","description":"The UserDB ID of the user"},"consent":{"type":"object","description":"Object. Set to `\"consent\": {\"gdpr\": true}}` or `\"consent\": {\"gdpr\": false}}`","properties":{}}}}}}},"responses":{"200":{"description":"200","content":{"text/plain":{"examples":{"Result":{"value":"[Returns a 1x1 transparent GIF image]"}}}}},"401":{"description":"401","content":{"text/plain":{"examples":{"Result":{"value":"You must provide your Adzerk API key in the X-Adzerk-ApiKey header."}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X POST -H \"X-Adzerk-ApiKey:<API-KEY>\" https://e-23.adzerk.net/udb/23/consent  -d '{\"userKey\":\"ue1-e397eb5990\", \"consent\": {\"gdpr\": true}}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/decision-sdk');\n\n// Demo network ID and API key; find your own via the Kevel UI!\nlet client = new Adzerk.Client({networkId: 23, apiKey: \"YOUR-API-KEY\"});\n\nclient.userDb.gdprConsent({\n  userKey: \"ue1-e397eb5990\",\n  consent: {gdpr: true},\n});"},{"language":"java","code":"import com.adzerk.sdk.*;\nimport com.adzerk.sdk.generated.ApiException;\n\npublic class GdprConsentUserDB {\n  public static void main(String[] argv) throws ApiException {\n    // Demo network ID and API key; find your own via the Adzerk UI!\n    Client client = new Client(new ClientOptions(23).apiKey(\"YOUR-API-KEY\"));\n\n    ConsentRequest consentRequest = new ConsentRequest()\n      .userKey(\"ue1-e397eb5990\")\n      .consent(Map.of(\"gdpr\", true));\n    \n    client.userDb().gdprConsent(consentRequest);\n  }\n}"},{"language":"python","code":"import adzerk_decision_sdk\n\n# Demo network ID and API key; find your own via the Adzerk UI!\nclient = adzerk_decision_sdk.Client(23, api_key=\"YOUR_API_KEY\")\n\nclient.user_db.gdpr_consent({\n  \"userKey\": \"ue1-e397eb5990\",\n  \"consent\": {\"gdpr\": True}\n})"},{"language":"ruby","code":"require \"adzerk_decision_sdk\"\n\n# Demo network ID and API key; find your own via the Adzerk UI!\nclient = AdzerkDecisionSdk::Client.new(network_id: 23, api_key: \"YOUR_API_KEY\")\n\nclient.user_db.gdpr_consent({\n  userKey: \"ue1-e397eb5990\",\n  consent: {gdpr: true}\n})"},{"language":"clojure","code":"(ns gdpr-consent-userdb-sample\n  (:import (com.adzerk.sdk Client ClientOptions)\n           (com.adzerk.sdk.generated.model ConsentRequest)))\n\n(defn -main []\n  ; Demo network ID and API key; find your own via the Adzerk UI!\n  (let [client (Client. (doto (ClientOptions. (int 23) (.apiKey \"YOUR-API-KEY\"))))\n        consent (doto (ConsentRequest. (.userKey \"abc\") (.consent {\"gdpr\" true})))]\n    (-> client (.userDb) (.gdprConsent consent))))"}],"samples-languages":["curl","javascript","java","python","ruby","clojure"]}}},"/sync/i.gif?partnerid={partnerid}&userId={userid}":{"get":{"summary":"User Matching","description":"This endpoint writes the value of a given RTB Partner's User ID to the user's record in UserDB.","operationId":"user-matching-1","parameters":[{"name":"partnerId","in":"query","description":"The ID of the RTB provider in Adzerk. Contact Support if you don't have the ID.","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"userId","in":"query","description":"This is the UserID the individual RTB provider has of the user. This is NOT the UserDB userkey.","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"property","in":"query","description":"Appends one or more key/value pairs to be shipped to UserDB logs. In the format `?property:Key1=Value&property:Key2=Value` etc.","schema":{"type":"string"}},{"name":"networkId","in":"path","description":"Your account (network) ID","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"text/plain":{"examples":{"Result":{"value":"[Returns a 1x1 transparent GIF image]"}}}}}},"deprecated":false,"security":[],"x-readme":{"code-samples":[{"language":"curl","code":"curl -b \"azk=ue1-e397eb5990\" \"https://e-23.adzerk.net/udb/23/sync/i.gif?partnerId=1&userId=12345\"\n\n"},{"language":"javascript","code":"const Adzerk = require('@adzerk/decision-sdk');\n\n// Demo network ID; find your own via the Kevel UI!\nlet client = new Adzerk.Client({networkId: 23});\nclient.userDb.matchUser(\"ue1-e397eb5990\", 1, 12345);"},{"language":"java","code":"import com.adzerk.sdk.*;\nimport com.adzerk.sdk.generated.ApiException;\n\npublic class RtbUserMatchUserDB {\n  public static void main(String[] argv) throws ApiException {\n    // Demo network ID; find your own via the Adzerk UI!\n    Client client = new Client(new ClientOptions(23));\n    client.userDb().matchUser(\"ue1-e397eb5990\", 1, 12345);\n  }\n}"},{"language":"python","code":"import adzerk_decision_sdk\n\n# Demo network ID; find your own via the Adzerk UI!\nclient = adzerk_decision_sdk.Client(23)\nclient.user_db.match_user(\"ue1-e397eb5990\", 1, 12345)"},{"language":"ruby","code":"require \"adzerk_decision_sdk\"\n\n# Demo network ID; find your own via the Adzerk UI!\nclient = AdzerkDecisionSdk::Client.new(network_id: 23)\nclient.user_db.match_user(\"ue1-e397eb5990\", 1, 12345)"},{"language":"clojure","code":"(ns rtb-user-match-userdb-sample\n  (:import (com.adzerk.sdk Client ClientOptions)))\n\n(defn -main []\n  ; Demo network ID; find your own via the Adzerk UI!\n  (let [client (Client. (doto (ClientOptions. (int 23))))]\n    (-> client (.userDb) (.matchUser \"ue1-e397eb5990\", 1, 12345))))"}],"samples-languages":["curl","javascript","java","python","ruby","clojure"]}}},"/set/i.gif?userKey={UserKey}":{"get":{"summary":"Set User Cookie","description":"Sets the current user's `azk` cookie to the userKey specified in the query parameter. If this user record exists, existing data on the record will become available. If the user record doesn't exist, it will be created.","operationId":"set-user-cookie","parameters":[{"name":"userKey","in":"query","description":"UserDB ID of the user","required":true,"schema":{"type":"string"}},{"name":"property","in":"query","description":"Appends one or more key/value pairs to be shipped to UserDB logs. In the format `?property:Key1=Value&property:Key2=Value` etc.","schema":{"type":"string"}},{"name":"networkId","in":"path","description":"Your account (network) ID","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"text/plain":{"examples":{"Result":{"value":"[Returns a 1x1 transparent GIF image]"}}}}}},"deprecated":false,"security":[],"x-readme":{"code-samples":[{"language":"html","code":"<img src=\"https://e-23.adzerk.net/udb/23/set/i.gif?userKey=ue1-e397eb5990\"/>"}],"samples-languages":["html"]}}},"/segments":{"get":{"summary":"Get Segments for a User","description":"This endpoint returns all segments for a specific user record in UserDB.","operationId":"get-segments-for-a-user","parameters":[{"name":"networkId","in":"path","description":"Your account (network) ID","schema":{"type":"integer","format":"int32"},"required":true},{"name":"userKey","in":"query","description":"The User ID to fetch","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"key\": \"ue1-e397eb5990\",\n    \"segments\": [\n        78\n    ]\n}"}},"schema":{"type":"object","properties":{"key":{"type":"string","example":"ue1-e397eb5990"},"segments":{"type":"array","items":{"type":"integer","example":78,"default":0}}}}}}},"400":{"description":"400","content":{"text/plain":{"examples":{"Result":{"value":"userKey is required"}}}}}},"deprecated":false},"post":{"summary":"Add Segments To A User","description":"This endpoint adds a Segment to a specific UserKey via query params.  Calling this endpoint multiple times will add multiple Segments.","operationId":"add-segments-to-a-user","parameters":[{"name":"networkId","in":"path","description":"Your account (network) ID","schema":{"type":"integer","format":"int32"},"required":true},{"name":"userKey","in":"query","description":"The user ID to update","required":true,"schema":{"type":"string"}},{"in":"query","name":"group","schema":{"type":"integer"},"description":"Optional. Sets the user's incrementality group (1–100) as part of this request; use `group=null` to clear it, or omit to leave it unchanged. Invalid values reject the entire request."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["segments"],"properties":{"segments":{"type":"array","items":{"type":"integer","format":"int32"}}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"key\": \"ue1-e397eb5990\",\n    \"segments\": [\n        79,\n        80\n    ]\n}"}},"schema":{"type":"object","properties":{"key":{"type":"string","example":"ue1-e397eb5990"},"segments":{"type":"array","items":{"type":"integer","example":79,"default":0}}}}}}},"400":{"description":"400","content":{"text/plain":{"examples":{"Result":{"value":"userKey is required"}}}}}}},"put":{"summary":"Replace Segments for a User","description":"Replace the full list of segments","operationId":"replace-segments-for-a-user","parameters":[{"name":"networkId","in":"path","description":"Your account (network) ID","schema":{"type":"integer","format":"int32"},"required":true},{"name":"userKey","in":"query","description":"The user ID to update","required":true,"schema":{"type":"string"}},{"in":"query","name":"group","schema":{"type":"integer"},"description":"Optional. Sets the user's incrementality group (1–100) as part of this request; use `group=null` to clear it, or omit to leave it unchanged. Invalid values reject the entire request."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["segments"],"properties":{"segments":{"type":"array","items":{"type":"integer","format":"int32"}}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"key\": \"ue1-e397eb5990\",\n    \"segments\": [\n        40,\n        41,\n        42\n    ]\n}"}},"schema":{"type":"object","properties":{"key":{"type":"string","example":"ue1-e397eb5990"},"segments":{"type":"array","items":{"type":"integer","example":40,"default":0}}}}}}},"400":{"description":"400","content":{"text/plain":{"examples":{"Result":{"value":"userKey is required"}}}}}}},"delete":{"summary":"Remove one or more Segments","description":"Remove a specific segment form a user","operationId":"remove-a-segment","parameters":[{"name":"networkId","in":"path","description":"Your account (network) ID","schema":{"type":"integer","format":"int32"},"required":true},{"name":"userKey","in":"query","description":"The user ID to update","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"segments":{"type":"array","description":"Specify the Segment IDs to be removed from the user record. To delete all Segments for the user, send a DELETE request with no body params.","items":{"type":"integer","format":"int32"}}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"key\": \"ue1-e397eb5990\",\n    \"segments\": []\n}"}},"schema":{"type":"object","properties":{"key":{"type":"string","example":"ue1-e397eb5990"},"segments":{"type":"array"}}}}}},"400":{"description":"400","content":{"text/plain":{"examples":{"Result":{"value":"userKey is required"}}}}}},"deprecated":false}},"/group":{"get":{"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"group":{"type":"integer"}},"required":["key"]},"examples":{"OK":{"summary":"OK","value":{"key":"ue1-e397eb5990","group":42}}}}}}},"parameters":[{"in":"query","name":"userKey","schema":{"type":"string"},"description":"The user ID to read. Can also come from the UserDB `azk` cookie."}],"summary":"Read User Group","operationId":"get_group","x-readme":{"code-samples":[{"code":"","language":"shell","name":""}],"samples-languages":["shell"]}},"post":{"responses":{"200":{"description":"","content":{"application/json":{"examples":{"OK":{"summary":"OK","value":{"key":"ue1-e397eb5990","group":42}}}}}}},"parameters":[{"in":"query","name":"userKey","schema":{"type":"string"},"description":"The user ID to read. Can also come from the UserDB `azk` cookie."}],"summary":"Set User Group","operationId":"post_group","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"group":{"type":"integer","description":"Min: 1, Max: 100, nullable. Send 1–100 to set the group, or null to clear it."}},"required":["group"]}}}}}}},"x-readme":{"headers":[],"explorer-enabled":false,"proxy-enabled":true},"x-readme-fauxas":true}