{"openapi":"3.0.3","info":{"title":"Folders API","description":"Manages the folder hierarchy used to organise assets within Dotdigital Personalization. Folders help teams structure smartblocks, slots, layouts, and other resources across websites and projects. This API provides operations to list all folders, create new folders, retrieve a specific folder, and update folder properties.","version":"1.0.1"},"servers":[{"url":"https://{region}-api-freshrelevance.dotdigital.com/api","variables":{"region":{"description":"The region id your account belongs to","enum":["r1","r2","r3"],"default":"r1"}}}],"security":[{"apiTokenAuth":[]}],"paths":{"/{website_id}/folders":{"get":{"tags":["Account folders"],"summary":"Get all folders","description":"All content folders in JSON format.","operationId":"folders_list_all","parameters":[{"name":"website_id","in":"path","description":"Website ID for the account you are posting data to.","required":true,"schema":{"type":"string"},"example":"abc123"},{"name":"format","in":"query","description":"Get data in JSON format.","required":true,"schema":{"type":"string","enum":["json"]},"example":"json"},{"name":"page","in":"query","description":"Which page of results you wish to return; First page is indexed as 1.","schema":{"type":"integer","default":1},"example":1},{"name":"limit","in":"query","description":"Get this number of records to return in results array (pagination).","schema":{"minimum":1,"type":"integer","default":25},"example":50},{"name":"load_content","in":"query","description":"Include `content` in the results","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Folders for the account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inline_response_200"},"examples":{"Folders list":{"summary":"Folder list with content count","value":{"links":{"next":"https://api.freshrelevance.com/api/ab55bjkl/folders/?format=json&limit=3&load_content=true&page=2"},"count":3,"total":35,"page":1,"results":[{"folder_id":"nfyemphhg6rr","name":"Folders","version":1,"dt":"2020-06-19T08:25:39.096000Z","active":true,"deleted":false,"other_content":false,"content":{"slots":4,"smartblocks":17,"slot_types":{"w":4},"smartblock_types":{"coupon":1,"popover":3,"product":13}}},{"folder_id":"88mo4h3dqhbu","parent_id":"neymmphhg6rr","name":"Email Smartblocks","version":3,"dt":"2020-09-03T13:03:47.219000Z","active":true,"deleted":false,"other_content":false,"content":{"slots":0,"smartblocks":0,"slot_types":{},"smartblock_types":{}}},{"folder_id":"gf6pvvwsgjhp","parent_id":"neymmphhg6rr","name":"Web Smartblocks","version":2,"dt":"2020-09-03T13:11:10.850000Z","active":true,"deleted":false,"other_content":false,"content":{"slots":0,"smartblocks":1,"slot_types":{},"smartblock_types":{"product":1}}}],"headers":{"folder_id":"Folder ID","parent_id":"Parent ID","name":"Name","version":"Version","dt":"Date Last Updated","active":"Active","deleted":"Deleted"}}}}}}},"403":{"$ref":"#/components/responses/ForbiddenResponse"}}},"post":{"tags":["Account folders"],"summary":"Create folder","description":"Create a new folder.","operationId":"folders_create","parameters":[{"name":"website_id","in":"path","description":"Website ID for the account you are posting data to.","required":true,"schema":{"type":"string"},"example":"abc123"},{"name":"format","in":"query","description":"Get data in JSON format.","required":true,"schema":{"type":"string","enum":["json"]},"example":"json"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/folderRequest"}}}},"responses":{"200":{"description":"Details of the created folder","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inline_response_200_1"}}}},"400":{"$ref":"#/components/responses/ErrorResponse"},"403":{"$ref":"#/components/responses/ForbiddenResponse"}}}},"/{website_id}/folders/{folder_id}":{"get":{"tags":["Edit folder"],"summary":"Get folder","description":"Get a content folders details in JSON format.","operationId":"folders_get","parameters":[{"name":"website_id","in":"path","description":"Website ID for the account you are posting data to.","required":true,"schema":{"type":"string"},"example":"abc123"},{"name":"folder_id","in":"path","description":"The folder id to operate on","required":true,"schema":{"type":"string"}},{"name":"format","in":"query","description":"Get data in JSON format.","required":true,"schema":{"type":"string","enum":["json"]},"example":"json"},{"name":"load_content","in":"query","description":"Include `content` in the results","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Folder details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/folderDetails"},"examples":{"Folder details":{"summary":"Folder details","value":{"folder_id":"nfyemphhg6rr","name":"Folders","version":1,"dt":"2020-06-19T08:25:39.096000Z","active":true,"deleted":false}}}}}},"403":{"$ref":"#/components/responses/ForbiddenResponse"}}},"post":{"tags":["Edit folder"],"summary":"Update folder","description":"Updates the name of a folder.","operationId":"folders_update","parameters":[{"name":"website_id","in":"path","description":"Website ID for the account you are posting data to.","required":true,"schema":{"type":"string"},"example":"abc123"},{"name":"folder_id","in":"path","description":"The folder id to operate on","required":true,"schema":{"type":"string"}},{"name":"format","in":"query","description":"Get data in JSON format.","required":true,"schema":{"type":"string","enum":["json"]},"example":"json"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/folderRequest"}}}},"responses":{"200":{"description":"Details of the updated folder","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inline_response_200_1"}}}},"400":{"$ref":"#/components/responses/ErrorResponse"},"403":{"$ref":"#/components/responses/ForbiddenResponse"}}},"delete":{"tags":["Edit folder"],"summary":"Delete folder","description":"Deletes the specified folder.","operationId":"folders_delete","parameters":[{"name":"website_id","in":"path","description":"Website ID for the account you are posting data to.","required":true,"schema":{"type":"string"},"example":"abc123"},{"name":"folder_id","in":"path","description":"The folder id to operate on","required":true,"schema":{"type":"string"}},{"name":"format","in":"query","description":"Get data in JSON format.","required":true,"schema":{"type":"string","enum":["json"]},"example":"json"}],"responses":{"200":{"description":"Folder details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/inline_response_200_2"}}}},"400":{"$ref":"#/components/responses/ErrorResponse"},"403":{"$ref":"#/components/responses/ForbiddenResponse"}}}}},"components":{"schemas":{"folderRequest":{"required":["name"],"type":"object","properties":{"parent_id":{"type":"string","description":"The parent folder id this folder belongs to, if any","nullable":true},"name":{"maxLength":256,"minLength":1,"type":"string","description":"Unique name for the folder","example":"Banners"}},"description":"Folder details"},"folderDetails":{"allOf":[{"$ref":"#/components/schemas/folderRequest"},{"required":["active","deleted","dt","folder_id","name","parent_id","version"],"type":"object","properties":{"folder_id":{"type":"string","description":"The unique folder id","nullable":true},"parent_id":{"type":"string","description":"The parent folder id this folder belongs to, if any","nullable":true},"name":{"maxLength":256,"minLength":1,"type":"string","description":"Unique name for the folder","example":"Banners"},"version":{"minimum":1,"type":"integer","description":"The version number of the content"},"dt":{"type":"string","description":"Last modified date time in ISO-8601 format","format":"date-time"},"active":{"type":"boolean","description":"Indicates whether the folder is active and will be shown in the UI","default":true},"deleted":{"type":"boolean","description":"Indicates whether the folder is deleted","default":true}},"description":"Folder details"}]},"PaginatedData":{"required":["count","links","page","total"],"type":"object","properties":{"page":{"minimum":1,"type":"integer","description":"The index for the page of data returned.","example":1},"count":{"minimum":0,"type":"integer","description":"Number of records in the page.","example":12},"total":{"minimum":0,"type":"integer","description":"Total number of records in the set.","example":12},"links":{"$ref":"#/components/schemas/PaginatedData_links"}},"description":"Data page and pagination links"},"SuccessfulResponse":{"required":["error","ok"],"type":"object","properties":{"ok":{"type":"boolean","description":"Indicates the call suceeded","enum":[true]},"error":{"type":"object","description":"Fields with issues and their errors","nullable":true,"example":null}},"description":"Call succeeded"},"inline_response_200":{"allOf":[{"$ref":"#/components/schemas/PaginatedData"},{"required":["results"],"properties":{"results":{"minItems":0,"type":"array","description":"The folders","items":{"allOf":[{"required":["parent_id"]},{"$ref":"#/components/schemas/folderDetails"}]}}},"description":"The folders for the account."}]},"inline_response_200_1":{"allOf":[{"$ref":"#/components/schemas/SuccessfulResponse"},{"required":["results"],"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/folderDetails"}}}}]},"inline_response_200_2":{"required":["ok"],"type":"object","properties":{"ok":{"type":"boolean","description":"Indicates call status","enum":[true]}}},"PaginatedData_links":{"type":"object","properties":{"next":{"type":"string","description":"URL of the next page.","format":"url","nullable":true},"previous":{"type":"string","description":"URL of the previous page.","format":"url","nullable":true}},"description":"Page navigation links"}},"responses":{"ForbiddenResponse":{"description":"Unauthorized / forbidden","content":{"application/json":{"schema":{"required":["detail"],"type":"object","properties":{"detail":{"type":"string","description":"Indicates why the call failed","example":"Authentication credentials were not provided."}}}}}},"ErrorResponse":{"description":"An error occurred","content":{"application/json":{"schema":{"required":["error","ok"],"type":"object","properties":{"ok":{"type":"boolean","description":"Indicates the call failed","enum":[false]},"error":{"oneOf":[{"type":"string","description":"The reason the call errored","example":"Validation error. No folder bd8eciompb7y, unable to delete"},{"type":"object","additionalProperties":{"minItems":1,"type":"array","items":{"type":"string","example":"This field may not be null."}},"description":"Fields with issues and their errors"}]}}}}}}},"parameters":{"WebsiteId":{"name":"website_id","in":"path","description":"Website ID for the account you are posting data to.","required":true,"schema":{"type":"string"},"example":"abc123"},"FormatJson":{"name":"format","in":"query","description":"Get data in JSON format.","required":true,"schema":{"type":"string","enum":["json"]},"example":"json"},"Page":{"name":"page","in":"query","description":"Which page of results you wish to return; First page is indexed as 1.","schema":{"type":"integer","default":1},"example":1},"Limit":{"name":"limit","in":"query","description":"Get this number of records to return in results array (pagination).","schema":{"minimum":1,"type":"integer","default":25},"example":50}},"securitySchemes":{"apiTokenAuth":{"type":"apiKey","name":"x-api-key","in":"header"}}},"x-samples-languages":["curl","csharp","java","javascript","node","python","php","ruby"]}