# List content items

Returns a filtered list of content items. The list will include the content item specified by the contentItemId parameter and any content items below it in the hierarchy. If the content item has no children, it will just return the content item itself. The results can be filtered further by using the `search` parameter to filter the content items by name or other indexed fields, or the `id` parameter to fetch content items (up to 50) with matching ids. The `search` and `id` are mutually exclusive.

Endpoint: GET /api/v1/content-items
Version: v1
Security: Bearer

## Security:

  - `Bearer` (unknown)
    http Bearer

## Query parameters:

  - `environmentId` (string)
    The environment identifier. Defaults to "main". Currently only "main" is supported.

  - `search` (string)
    An optional search string used to filter content items by name or other indexed fields. Mutually exclusive with `id`.

  - `contentItemId` (string, required)
    The identifier of the content item used to filter query results. If the content item has no children, the results will include just the content item itself. Otherwise, the results will include the content items and any others below it in the content hierarchy.

  - `language` (string)
    The language of the content items

  - `pageSize` (integer)
    The maximum number of items to return in a single page.

  - `id` (array)
    An optional list of known content item identifiers, e.g. `id=id1&id=id2&id=id3`. Limited to 50 ids per request (extras truncated). Mutually exclusive with `search`.

## Header parameters:

  - `x-sc-continuation` (string)
    An optional opaque token returned from a previous call used to fetch the next page of results.

## Response 200:

  - `200` (unknown)
    Successful operation. Returns an empty result set if no content items match the query.

## Response 200 fields (application/json):

  - `count` (integer)
    Total number of matching content items.
    Example: 10

  - `next` (string)
    Continuation token.
    Example: token-from-previous-response

  - `results` (array)
    List of content item search results.

  - `results.name` (string)
    The name of the item.
    Example: Home

  - `results.displayName` (string)
    The display name of the item.
    Example: Home Page

  - `results.itemId` (string)
    The unique identifier of the item.
    Example: 37265ed7-85cf-4876-9c09-b6590fc6cf3a

  - `results.path` (string)
    The full path of the item in the content tree.
    Example: /sitecore/content/Home

  - `results.version` (integer)
    The version number of the item.
    Example: 1

  - `results.language` (string)
    The language of the item.
    Example: en

  - `results.templateId` (string)
    The template identifier of the item.
    Example: 97265ed7-85cf-4876-9c09-b6590fc6cf3a

  - `results.baseContentModels` (array)
    The collection of base content model names associated with the item.
    Example: ["ContentModelA","ContentModelB"]

  - `results.created` (string)
    The date and time the item was created.
    Example: 2024-01-15T10:30:00Z

  - `results.createdBy` (string)
    The name of the user who created the item.
    Example: sitecore\admin

  - `results.updated` (string)
    The date and time the item was last updated.
    Example: 2024-02-20T14:45:00Z

  - `results.updatedBy` (string)
    The name of the user who last updated the item.
    Example: sitecore\admin

## Response 400:

  - `400` (unknown)
    Invalid input format, or both 'search' and 'id' supplied together

## Response 400 fields (application/json):

  - `type` (string)
    The type of the error response entity.

  - `title` (string)
    The title of the error response entity.

  - `status` (integer)
    The response status code.

  - `detail` (string)
    A detailed explanation, specific to this occurrence of the problem.

  - `instance` (string)
    If available, a URI reference that identifies the specific occurrence of the problem.

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `type` (string)
    The type of the error response entity.

  - `title` (string)
    The title of the error response entity.

  - `status` (integer)
    The response status code.

  - `detail` (string)
    A detailed explanation, specific to this occurrence of the problem.

  - `instance` (string)
    If available, a URI reference that identifies the specific occurrence of the problem.

## Response 404:

  - `404` (unknown)
    The underlying search response was malformed or unavailable.

## Response 404 fields (application/json):

  - `type` (string)
    The type of the error response entity.

  - `title` (string)
    The title of the error response entity.

  - `status` (integer)
    The response status code.

  - `detail` (string)
    A detailed explanation, specific to this occurrence of the problem.

  - `instance` (string)
    If available, a URI reference that identifies the specific occurrence of the problem.

