@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api CRM Lists
@base https://api.hubapi.com
@version v3
@auth OAuth2 | ApiKey private-app in header
@endpoints 30
@hint download_for_search
@toc crm(30)

@endpoint GET /crm/lists/v3
@optional {includeFilters: bool=false, listIds: [str]}
@returns(200) {lists: [map]}

@endpoint POST /crm/lists/v3
@required {name: str, objectTypeId: str, processingType: str}
@optional {customProperties: map, filterBranch: any, listFolderId: int(int32), listPermissions: map{teamsWithEditAccess!: [int(int32)], usersWithEditAccess!: [int(int32)]}, membershipSettings: map{includeUnassigned: bool, membershipTeamId: int(int32)}}
@returns(200) {list: map{createdAt: str(date-time), createdById: str, deletedAt: str(date-time), filterBranch: any, filtersUpdatedAt: str(date-time), listId: str, listPermissions: map{teamsWithEditAccess: [int(int32)], usersWithEditAccess: [int(int32)]}, listVersion: int(int32), membershipSettings: map{includeUnassigned: bool, membershipTeamId: int(int32)}, name: str, objectTypeId: str, processingStatus: str, processingType: str, size: int(int64), updatedAt: str(date-time), updatedById: str}}

@endpoint GET /crm/lists/v3/folders
@optional {folderId: str=0}
@returns(200) {folder: map{childLists: [int(int32)], childNodes: [map], createdAt: str(date-time), id: str, name: str, parentFolderId: str, updatedAt: str(date-time), updatedContentsAt: str(date-time), userId: int(int32)}}

@endpoint POST /crm/lists/v3/folders
@required {name: str}
@optional {parentFolderId: str}
@returns(200) {folder: map{childLists: [int(int32)], childNodes: [map], createdAt: str(date-time), id: str, name: str, parentFolderId: str, updatedAt: str(date-time), updatedContentsAt: str(date-time), userId: int(int32)}}

@endpoint PUT /crm/lists/v3/folders/move-list
@required {listId: str, newFolderId: str}
@returns(204)

@endpoint DELETE /crm/lists/v3/folders/{folderId}
@required {folderId: str}
@returns(204)

@endpoint PUT /crm/lists/v3/folders/{folderId}/move/{newParentFolderId}
@required {folderId: str, newParentFolderId: str}
@returns(200) {folder: map{childLists: [int(int32)], childNodes: [map], createdAt: str(date-time), id: str, name: str, parentFolderId: str, updatedAt: str(date-time), updatedContentsAt: str(date-time), userId: int(int32)}}

@endpoint PUT /crm/lists/v3/folders/{folderId}/rename
@required {folderId: str}
@optional {newFolderName: str}
@returns(200) {folder: map{childLists: [int(int32)], childNodes: [map], createdAt: str(date-time), id: str, name: str, parentFolderId: str, updatedAt: str(date-time), updatedContentsAt: str(date-time), userId: int(int32)}}

@endpoint GET /crm/lists/v3/idmapping
@optional {legacyListId: str}
@returns(200) {legacyListId: str, listId: str}

@endpoint POST /crm/lists/v3/idmapping
@returns(200) {legacyListIdsToIdsMapping: [map], missingLegacyListIds: [str]}

@endpoint GET /crm/lists/v3/object-type-id/{objectTypeId}/name/{listName}
@required {listName: str, objectTypeId: str}
@optional {includeFilters: bool=false}
@returns(200) {list: map{createdAt: str(date-time), createdById: str, deletedAt: str(date-time), filterBranch: any, filtersUpdatedAt: str(date-time), listId: str, listPermissions: map{teamsWithEditAccess: [int(int32)], usersWithEditAccess: [int(int32)]}, listVersion: int(int32), membershipSettings: map{includeUnassigned: bool, membershipTeamId: int(int32)}, name: str, objectTypeId: str, processingStatus: str, processingType: str, size: int(int64), updatedAt: str(date-time), updatedById: str}}

@endpoint POST /crm/lists/v3/records/memberships/batch/read
@required {inputs: [map{objectTypeId!: str, recordId!: str}]}
@returns(200) {completedAt: str(date-time), links: map, requestedAt: str(date-time), results: [map], startedAt: str(date-time), status: str}
@returns(207) {completedAt: str(date-time), errors: [map], links: map, numErrors: int(int32), requestedAt: str(date-time), results: [map], startedAt: str(date-time), status: str}

@endpoint GET /crm/lists/v3/records/{objectTypeId}/{recordId}/memberships
@required {objectTypeId: str, recordId: str}
@returns(200) {paging: map{next: map{after: str, link: str}, prev: map{before: str, link: str}}, results: [map], total: int(int64)}

@endpoint POST /crm/lists/v3/search
@required {additionalProperties: [str], offset: int(int32)}
@optional {count: int(int32), listIds: [str], objectTypeId: str, processingTypes: [str], query: str, sort: str}
@returns(200) {hasMore: bool, lists: [map], offset: int(int32), total: int(int32)}

@endpoint GET /crm/lists/v3/{listId}
@required {listId: str}
@optional {includeFilters: bool=false}
@returns(200) {list: map{createdAt: str(date-time), createdById: str, deletedAt: str(date-time), filterBranch: any, filtersUpdatedAt: str(date-time), listId: str, listPermissions: map{teamsWithEditAccess: [int(int32)], usersWithEditAccess: [int(int32)]}, listVersion: int(int32), membershipSettings: map{includeUnassigned: bool, membershipTeamId: int(int32)}, name: str, objectTypeId: str, processingStatus: str, processingType: str, size: int(int64), updatedAt: str(date-time), updatedById: str}}

@endpoint DELETE /crm/lists/v3/{listId}
@required {listId: str}
@returns(204)

@endpoint GET /crm/lists/v3/{listId}/memberships
@required {listId: str}
@optional {after: str, before: str, limit: int(int32)=100}
@returns(200) {paging: map{next: map{after: str, link: str}, prev: map{before: str, link: str}}, results: [map], total: int(int64)}

@endpoint DELETE /crm/lists/v3/{listId}/memberships
@required {listId: str}
@returns(204)

@endpoint PUT /crm/lists/v3/{listId}/memberships/add
@required {listId: str}
@returns(200) {recordIdsMissing: [str], recordIdsRemoved: [str], recordsIdsAdded: [str]}

@endpoint PUT /crm/lists/v3/{listId}/memberships/add-and-remove
@required {listId: str, recordIdsToAdd: [str], recordIdsToRemove: [str]}
@returns(200) {recordIdsMissing: [str], recordIdsRemoved: [str], recordsIdsAdded: [str]}

@endpoint PUT /crm/lists/v3/{listId}/memberships/add-from/{sourceListId}
@required {listId: str, sourceListId: str}
@returns(204)

@endpoint GET /crm/lists/v3/{listId}/memberships/join-order
@required {listId: str}
@optional {after: str, before: str, limit: int(int32)=100}
@returns(200) {paging: map{next: map{after: str, link: str}, prev: map{before: str, link: str}}, results: [map], total: int(int64)}

@endpoint PUT /crm/lists/v3/{listId}/memberships/remove
@required {listId: str}
@returns(200) {recordIdsMissing: [str], recordIdsRemoved: [str], recordsIdsAdded: [str]}

@endpoint PUT /crm/lists/v3/{listId}/restore
@required {listId: str}
@returns(204)

@endpoint GET /crm/lists/v3/{listId}/schedule-conversion
@required {listId: str}
@returns(200) {convertedAt: str(date-time), listId: str, requestedConversionTime: any}

@endpoint PUT /crm/lists/v3/{listId}/schedule-conversion
@required {listId: str}
@returns(200) {convertedAt: str(date-time), listId: str, requestedConversionTime: any}

@endpoint DELETE /crm/lists/v3/{listId}/schedule-conversion
@required {listId: str}
@returns(204)

@endpoint GET /crm/lists/v3/{listId}/size-and-edits-history/between
@required {listId: str}
@optional {endDate: str, startDate: str}
@returns(200) {editHistory: [str(date-time)], sizeHistory: [map]}

@endpoint PUT /crm/lists/v3/{listId}/update-list-filters
@required {listId: str, filterBranch: any}
@optional {enrollObjectsInWorkflows: bool=false}
@returns(200) {updatedList: map{createdAt: str(date-time), createdById: str, deletedAt: str(date-time), filterBranch: any, filtersUpdatedAt: str(date-time), listId: str, listPermissions: map{teamsWithEditAccess: [int(int32)], usersWithEditAccess: [int(int32)]}, listVersion: int(int32), membershipSettings: map{includeUnassigned: bool, membershipTeamId: int(int32)}, name: str, objectTypeId: str, processingStatus: str, processingType: str, size: int(int64), updatedAt: str(date-time), updatedById: str}}

@endpoint PUT /crm/lists/v3/{listId}/update-list-name
@required {listId: str}
@optional {includeFilters: bool=false, listName: str}
@returns(200) {updatedList: map{createdAt: str(date-time), createdById: str, deletedAt: str(date-time), filterBranch: any, filtersUpdatedAt: str(date-time), listId: str, listPermissions: map{teamsWithEditAccess: [int(int32)], usersWithEditAccess: [int(int32)]}, listVersion: int(int32), membershipSettings: map{includeUnassigned: bool, membershipTeamId: int(int32)}, name: str, objectTypeId: str, processingStatus: str, processingType: str, size: int(int64), updatedAt: str(date-time), updatedById: str}}

@end
