Create an index

Create a new index for a list.

When a new index is created, all of the items currently in the list will be re-indexed. This means that sorting, searching, and filtering will be available for all items in the list immediately after creating the index.

POST https://api.jsonpad.io/lists/{listId}/indexes

Example

cURL
12345678910111213141516curl https://api.jsonpad.io/lists/fb286750-211c-42c8-ac73-ceeed8dce2e4/indexes \
  -H "Content-Type: application/json" \
  -H "x-api-token: <YOUR TOKEN>" \
  -d '{
        "name": "My New Index",
        "description": "This is a new index",
        "pathName": "my-new-index",
        "pointer": "/name",
        "valueType": "string",
        "alias": true,
        "sorting": true,
        "filtering": true,
        "searching": true,
        "defaultOrderDirection": "asc",
        "activated": true
      }'

Parameters

  • required
    listIdstringA list id or path name.

Request headers

  • required
    x-api-tokenstringYour API token.

Request body

{
name: "Sample Index"
description: ""
pathName: "sample-index"
pointer: "/name"
valueType: "string"
alias: false
sorting: false
filtering: false
searching: false
defaultOrderDirection: "asc"
activated: true
}
  • optional
    namestringThe name of the index.
  • optional
    descriptionstringA description of the index.
  • required
    pathNamestringThe path name of the index. This is used in URL query parameters to sort and filter items.
  • required
    pointerstringA JSON pointer to the field in the item data that the index points to.
  • optional
    valueType'string' | 'number' | 'date'

    The type of value that the index points to.

  • optional
    aliasbooleanWhether the index is an alias index. Each list can only have one alias index.
  • optional
    sortingbooleanWhether the index can be used for sorting items.
  • optional
    filteringbooleanWhether the index can be used for filtering items.
  • optional
    searchingbooleanWhether the index can be used for searching for items.
  • optional
    defaultOrderDirection'asc' | 'desc'When sorting items using this index, this is the default order direction.
  • optional
    activatedbooleanWhether the index is activated. Inactive indexes are not accessible or usable via the API.

Response body

201 Created
{
id: "afb60079-b249-4745-ba47-8176962da535"
createdAt: "2026-09-05T11:30:16.824Z"
updatedAt: "2026-09-05T11:30:16.824Z"
name: "Sample Index"
description: ""
pathName: "sample-index"
pointer: "/name"
valueType: "string"
alias: false
sorting: false
filtering: false
searching: false
defaultOrderDirection: "asc"
activated: true
}

Response headers

  • locationhttps://api.jsonpad.io/lists/160233af-fad1-4a6a-949f-c777ccb78095/indexes/a31ec6d1-f67e-4a5b-a00e-234f1b193097The URL of the newly created index.
  • last-modified2026-09-05T11:30:16.824ZThe date this index was last modified.
2024-11-14