## Create a list `client.Rules.Lists.New(ctx, params) (*ListNewResponse, error)` **post** `/accounts/{account_id}/rules/lists` Creates a new list of the specified kind. ### Parameters - `params ListNewParams` - `AccountID param.Field[string]` Path param: The Account ID for this resource. - `Kind param.Field[ListNewParamsKind]` Body param: The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects). - `const ListNewParamsKindIP ListNewParamsKind = "ip"` - `const ListNewParamsKindRedirect ListNewParamsKind = "redirect"` - `const ListNewParamsKindHostname ListNewParamsKind = "hostname"` - `const ListNewParamsKindASN ListNewParamsKind = "asn"` - `Name param.Field[string]` Body param: An informative name for the list. Use this name in filter and rule expressions. - `Description param.Field[string]` Body param: An informative summary of the list. ### Returns - `type ListNewResponse struct{…}` - `ID string` The unique ID of the list. - `CreatedOn string` The RFC 3339 timestamp of when the list was created. - `Kind ListNewResponseKind` The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects). - `const ListNewResponseKindIP ListNewResponseKind = "ip"` - `const ListNewResponseKindRedirect ListNewResponseKind = "redirect"` - `const ListNewResponseKindHostname ListNewResponseKind = "hostname"` - `const ListNewResponseKindASN ListNewResponseKind = "asn"` - `ModifiedOn string` The RFC 3339 timestamp of when the list was last modified. - `Name string` An informative name for the list. Use this name in filter and rule expressions. - `NumItems float64` The number of items in the list. - `NumReferencingFilters float64` The number of [filters](/api/resources/filters/) referencing the list. - `Description string` An informative summary of the list. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/rules" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) list, err := client.Rules.Lists.New(context.TODO(), rules.ListNewParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Kind: cloudflare.F(rules.ListNewParamsKindIP), Name: cloudflare.F("list1"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", list.ID) } ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "id": "2c0fc9fa937b11eaa1b71c4d701ab86e", "created_on": "2020-01-01T08:00:00Z", "kind": "ip", "modified_on": "2020-01-10T14:00:00Z", "name": "list1", "num_items": 10, "num_referencing_filters": 2, "description": "This is a note" }, "success": true } ```