Create a list

post/lists
Internal-Use Only

Creates a new list definition.

When you create a new list, you define the properties of a new tabular data set, but the list initially has no contents. List contents are loaded and managed by using other endpoints that are available with the List Data API.

A list's properties describe the structure, functionality, and state of a list. A list's contents, which are the list's data, is a sub-resource of the list.

The structure of a list represents the data that you will import as the list contents. The list data description is represented by column information objects. The column objects map information about the source data (for example, column name, data type, and position) to the list's structure.

When you create the list's structure, you need to identify at least one column as a key. This column is used to construct a lookup key for the record, which is used to retrieve the record from the contents data store. You can create complex lookup keys by identifying more than one column as a key.

You must add lists to a folder. A list inherits the permissions of the folder of which it is a member. The default folder '/SAS Content/Products/List Data' provides public permissions. You can move lists to different folders and manage authorizations for a folder by using SAS Environment Manager.

A list can be immutable, which means a client has only a single opportunity to load contents. Once an immutable list has contents, you cannot update the list. You can only delete it.

The state of a list can be either deployed or developing. You cannot delete a deployed list.

A list can have an expiry that is associated only with the list's rows. This expiry value is a UNIX timestamp, which enables consumers of list data to choose whether to ignore expired list items. No action is taken by the service once the expiry is reached.

The 'defaultExpiry' property is the time, in seconds, after which newly added rows are considered expired. When rows are added, an expiry property is also added, which is equal to the current UNIX Epoch time plus the default expiry value. Enforcement of the expiry is left to the consumer, and no action is taken by the service when the expiration time is reached.

You can define a list that supports storing multiple records by using the same key value. This means that when a client retrieves a value by using a lookup key, more than one record could be returned. You need to identify this type of list when you create a new list. Once created, you cannot convert this list type to a standard list type.

Request Samples

1

Response Samples

1{
2 "id": "3659ea38-2618-4474-aeac-0bf6cfd3c322",
3 "version": 1,
4 "creationTimeStamp": "2022-03-01T20:18:32Z",
5 "modifiedTimeStamp": "2022-03-01T20:18:32Z",
6 "createdBy": "appUser1",
7 "modifiedBy": "appUser1",
8 "name": "list-a",
9 "description": "The A-list users",
10 "state": "developing",
11 "columns": [
12 {
13 "name": "userId",
14 "dataType": "string",
15 "position": 1,
16 "isKey": true,
17 "keyPosition": 1
18 },
19 {
20 "name": "firstName",
21 "dataType": "string",
22 "position": 2,
23 "isKey": false,
24 "keyPosition": 0
25 },
26 {
27 "name": "lastName",
28 "dataType": "string",
29 "position": 3,
30 "isKey": false,
31 "keyPosition": 0
32 },
33 {
34 "name": "salary",
35 "dataType": "number",
36 "position": 4,
37 "isKey": false,
38 "keyPosition": 0,
39 "dataMask": {
40 "name": "MaskStart",
41 "regex": ".(....$)|.",
42 "replace": "*$1",
43 "example": "****1234"
44 }
45 }
46 ],
47 "label": "corporate marketing",
48 "links": [
49 {
50 "href": "...",
51 "method": "...",
52 "rel": "...",
53 "uri": "..."
54 }
55 ]
56}

Query Parameters

NameTypeRequiredDescription
parentFolderUri
string
false

The URI for the parent folder to which a list is added. For more information about folders, see Folders.

Request Body

This schema defines the list properties.

NameTypeRequiredDescription
name
string
true

The name of the list. The list name is not case-sensitive, must be unique within the system, and cannot be updated once it is created.

Example:
"list-a"
state
string
true

An indicator for whether the list can be used by deployed artifacts. A list can be either deployed or developing. Only lists in developing can be deleted.

Default:
developing
Example:
"developing"
description
string or null
false

A textual description of the list.

Default:
isImmutable
boolean
false

An indicator for whether the list's contents can be altered after it is imported.

Default:
false
columns
array [Column Information]
true

Columns are a collection of 'ColumnInfo' objects that define the structure of the list's content. 'ColumnInfo' objects map properties such as name, position, and data type to the imported source data (for example, a CSV file). Columns also mark which values are used to construct lookup keys. Key properties are flagged as such and are assigned a position for where their values are placed in the lookup key.

The number of columns in the data source's header must match the number of columns (that is, the number of 'ColumnInfo' objects) that are defined for a list. The value for the 'ColumnInfo' position's object must be a sequential set of positions such as 1..N, where N is the number of columns in the header. For example, if the input data has a 3-column header, there must be a 'ColumnInfo' object for each position 1, 2, and 3.

>= 1 items
defaultExpiry
number
false

The value that sets the expiration of newly added rows.

Example:
10000
label
string or null
false

A short textual label, which is appropriate for client UIs.

Responses

StatusMeaningDescription
201CreatedA list was created.HeadersSchema
400Bad RequestThe request was invalid.Schema
403ForbiddenThe user did not have the necessary permissions.Schema
415Unsupported Media TypeThe requested media type is not supported.Schema
500Internal Server ErrorThe request could not be fulfilled because of an unexpected server error.Schema