{"openapi":"3.1.0","info":{"title":"Contact data fields","version":"2.0.1","description":"Manage the custom data fields used to store structured attributes against contacts. Use this API to create new fields (string, numeric, date, or boolean), list all fields defined in the account, and delete fields that are no longer needed. Contact data fields drive personalisation, segmentation, and targeting across your marketing activity.\n"},"x-readme":{"headers":[],"explorer-enabled":true,"proxy-enabled":true},"x-readme-fauxas":true,"x-samples-languages":["curl","csharp","java","javascript","node","python","php","ruby"],"externalDocs":{"description":"Learn more about Dotdigital APIs","url":"https://developer.dotdigital.com"},"servers":[{"url":"https://{region}-api.dotdigital.com","variables":{"region":{"default":"r1","enum":["r1","r2","r3"],"description":"The Dotdigital region id your account belongs to"}}}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic"}},"schemas":{"dataType":{"type":"string","enum":["String","Numeric","Date","Boolean"],"description":"The data type of the contact data field you''re creating.","examples":["Date"]},"visibility":{"type":"string","enum":["Public","Private"],"examples":["Public"]}}},"paths":{"/v2/data-fields":{"parameters":[{"in":"header","name":"x-ddg-integration-token","required":false,"description":"If you are a partner of Dotdigital and have a [verified integration](https://developer.dotdigital.com/docs/partner-integration-verification) then include your [integration tracking token](https://developer.dotdigital.co/docs/verified-integration-tracking) here.","schema":{"type":"string","pattern":"/^(?:\\{{0,1}(?:[0-9a-fA-F]){8}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){12}\\}{0,1})$/","example":"5a96bc79-19a7-4544-973b-e2da0c9136f9"}}],"post":{"summary":"Create contact data field","deprecated":false,"description":"Creates a contact data field within the account","operationId":"create-contact-data-field","tags":["Contact data fields"],"parameters":[],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name","type"],"properties":{"name":{"type":"string","maxLength":20,"pattern":"[a-zA-Z0-9_-]{1,20}","description":"The name of the contact data field being created. It can be a maximum of 20 characters in length and must contain alphanumeric characters only, with hyphens and underscores if required."},"type":{"type":"string","enum":["String","Numeric","Date","Boolean"],"description":"The data type of the contact data field you''re creating.","examples":["Date"]},"visibility":{"type":"string","description":"Choose for your data field to be either private or public","default":"Private","enum":["Private","Public"]},"defaultValue":{"type":"string","description":"The default value of your data field. It can be any data type."}}},"examples":{"Request Example":{"value":{"name":"BIRTHDAY","type":"Date"},"summary":"Request Example"}}}}},"responses":{"201":{"description":"201","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","examples":["BIRTHDAY"]},"type":{"type":"string","enum":["String","Numeric","Date","Boolean"],"description":"The data type of the contact data field you''re creating.","examples":["Date"]},"visibility":{"type":"string","enum":["Public","Private"],"examples":["Public"]},"defaultValue":{}}},"examples":{"Result":{"summary":"Result","value":{"name":"BIRTHDAY","type":"Date","visibility":"Private","defaultValue":null}}}}}}}},"get":{"summary":"Get contact data fields","deprecated":false,"description":"Lists all contact data fields within the account","operationId":"get-contact-data-fields","tags":["Contact data fields"],"parameters":[],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","required":["name","type","visibility","defaultValue"],"properties":{"name":{"type":"string","examples":["FIRSTNAME"]},"type":{"type":"string","enum":["String","Numeric","Date","Boolean"],"description":"The data type of the contact data field you''re creating.","examples":["Date"]},"visibility":{"type":"string","enum":["Public","Private"],"examples":["Public"]},"defaultValue":{}}}},"examples":{"Result":{"summary":"Result","value":[{"name":"FIRSTNAME","type":"String","visibility":"Public","defaultValue":null},{"name":"LASTNAME","type":"String","visibility":"Public","defaultValue":null},{"name":"FULLNAME","type":"String","visibility":"Public","defaultValue":null},{"name":"IS_HAPPY","type":"Boolean","visibility":"Public","defaultValue":true},{"name":"BIRTHDAY","type":"Date","visibility":"Public","defaultValue":null}]}}}}}}}},"/v2/data-fields/{name}":{"parameters":[{"in":"header","name":"x-ddg-integration-token","required":false,"description":"If you are a partner of Dotdigital and have a [verified integration](https://developer.dotdigital.com/docs/partner-integration-verification) then include your [integration tracking token](https://developer.dotdigital.co/docs/verified-integration-tracking) here.","schema":{"type":"string","pattern":"/^(?:\\{{0,1}(?:[0-9a-fA-F]){8}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){4}-(?:[0-9a-fA-F]){12}\\}{0,1})$/","example":"5a96bc79-19a7-4544-973b-e2da0c9136f9"}}],"delete":{"summary":"Delete contact data field","deprecated":false,"description":"Deletes a contact data field within the account","operationId":"delete-contact-data-field","tags":["Contact data fields"],"parameters":[{"name":"name","in":"path","description":"The name of the contact data field you want to delete.","required":true,"example":"","schema":{"type":"string","maxLength":20,"pattern":"[a-zA-Z0-9_-]{1,20}"}}],"responses":{"200":{"description":"200","content":{"application/json":{"schema":{"type":"object","properties":{"dependencies":{"type":"array","description":"Any dependencies on the data field that will block deletion.","items":{"type":"string"}},"result":{"type":"boolean","description":"Indicates whether the data field was deleted or not.","default":true,"examples":[true]}}},"examples":{"Successful Result":{"summary":"Successfully deleted","value":{"dependencies":null,"result":true}},"Failed Result":{"summary":"Failed to delete","value":{"dependencies":["Used in program 12345"],"result":false}}}}}}}}}}}