> ## Documentation Index
> Fetch the complete documentation index at: https://developer.z-api.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Pin chats

> This method is responsible for pinning and unpinning your chats.

## Overview

This method is responsible for pinning and unpinning your chats.

***

## Attributes

### Header

<ParamField path="instanceId" type="string" required>
  Your instance ID. Available in the Z-API panel under **Instances**.
</ParamField>

<ParamField path="token" type="string" required>
  Your Z-API instance token.
</ParamField>

### Required

<ParamField body="phone" type="string" required>
  Phone number of the chat you want to modify
</ParamField>

<ParamField body="action" type="string" required>
  Action: `pin` or `unpin`
</ParamField>

***

## Request Body

```json theme={"theme":{"light":"github-light","dark":"poimandres"}}
{
  "phone": "5544999999999",
  "action": "pin"
}
```

***

## Response

### 200

```json theme={"theme":{"light":"github-light","dark":"poimandres"}}
{
  "value": true
}
```

### 405

In this case, make sure you are correctly sending the method specification, i.e., check if you sent POST or GET as specified at the beginning of this topic.

### 415

If you receive a 415 error, make sure to add the "Content-Type" of the object you are sending in the request headers, most commonly "application/json".
