# Pattern Directory Items

<div class="section route">

<div class="primary">

## Schema

The schema defines all the fields that exist within a pattern directory item record. Any response from these endpoints can be expected to contain the fields below unless the \`\_filter\` query parameter is used or the schema field only appears in a specific context.

<table class="attributes">
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<tbody>
<tr id="schema-id">
<td><code>id</code></td>
<td>The pattern ID.
<p>JSON data type: integer</p>
<p>Context: <code>view</code>, <code>edit</code>, <code>embed</code></p></td>
</tr>
<tr id="schema-title">
<td><code>title</code></td>
<td>The pattern title, in human readable format.
<p>JSON data type: string</p>
<p>Context: <code>view</code>, <code>edit</code>, <code>embed</code></p></td>
</tr>
<tr id="schema-content">
<td><code>content</code></td>
<td>The pattern content.
<p>JSON data type: string</p>
<p>Context: <code>view</code>, <code>edit</code>, <code>embed</code></p></td>
</tr>
<tr id="schema-categories">
<td><code>categories</code></td>
<td>The pattern’s category slugs.
<p>JSON data type: array</p>
<p>Context: <code>view</code>, <code>edit</code>, <code>embed</code></p></td>
</tr>
<tr id="schema-keywords">
<td><code>keywords</code></td>
<td>The pattern’s keywords.
<p>JSON data type: array</p>
<p>Context: <code>view</code>, <code>edit</code>, <code>embed</code></p></td>
</tr>
<tr id="schema-description">
<td><code>description</code></td>
<td>A description of the pattern.
<p>JSON data type: string</p>
<p>Context: <code>view</code>, <code>edit</code>, <code>embed</code></p></td>
</tr>
<tr id="schema-viewport_width">
<td><code>viewport_width</code></td>
<td>The preferred width of the viewport when previewing a pattern, in pixels.
<p>JSON data type: integer</p>
<p>Context: <code>view</code>, <code>edit</code>, <code>embed</code></p></td>
</tr>
<tr id="schema-block_types">
<td><code>block_types</code></td>
<td>The block types which can use this pattern.
<p>JSON data type: array</p>
<p>Context: <code>view</code>, <code>embed</code></p></td>
</tr>
</tbody>
</table>

</div>

</div>

<div>

<div class="section route">

<div class="primary">

## List Pattern Directory Items

Query this endpoint to retrieve a collection of pattern directory items. The response you receive can be controlled and filtered using the URL query parameters below.

### Definition

`GET /wp/v2/pattern-directory/patterns`

### Example Request

`$ curl https://example.com/wp-json/wp/v2/pattern-directory/patterns`

</div>

<div class="secondary">

### Arguments

<table class="arguments">
<colgroup>
<col style="width: 50%" />
<col style="width: 50%" />
</colgroup>
<tbody>
<tr>
<td><code>context</code></td>
<td>Scope under which the request is made; determines fields present in response.
<p>Default: <code>view</code></p>
<p>One of: <code>view</code>, <code>embed</code>, <code>edit</code></p></td>
</tr>
<tr>
<td><code>page</code></td>
<td>Current page of the collection.
<p>Default: <code>1</code></p></td>
</tr>
<tr>
<td><code>per_page</code></td>
<td>Maximum number of items to be returned in result set.
<p>Default: <code>100</code></p></td>
</tr>
<tr>
<td><code>search</code></td>
<td>Limit results to those matching a string.</td>
</tr>
<tr>
<td><code>category</code></td>
<td>Limit results to those matching a category ID.</td>
</tr>
<tr>
<td><code>keyword</code></td>
<td>Limit results to those matching a keyword ID.</td>
</tr>
<tr>
<td><code>slug</code></td>
<td>Limit results to those matching a pattern (slug).</td>
</tr>
<tr>
<td><code>offset</code></td>
<td>Offset the result set by a specific number of items.</td>
</tr>
<tr>
<td><code>order</code></td>
<td>Order sort attribute ascending or descending.
<p>Default: <code>desc</code></p>
<p>One of: <code>asc</code>, <code>desc</code></p></td>
</tr>
<tr>
<td><code>orderby</code></td>
<td>Sort collection by post attribute.
<p>Default: <code>date</code></p>
<p>One of: <code>author</code>, <code>date</code>, <code>id</code>, <code>include</code>, <code>modified</code>, <code>parent</code>, <code>relevance</code>, <code>slug</code>, <code>include_slugs</code>, <code>title</code>, <code>favorite_count</code></p></td>
</tr>
</tbody>
</table>

</div>

</div>

</div>