> ## 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.

# Creating an instance

> Creates an instance linked to your partner integrator account

## Overview

Method used to create an instance linked to your account.

<Info>
  You don't necessarily need to subscribe now; you have 2 days for trial use. After 2 days without subscription, the instance is automatically deleted.
</Info>

<Warning>
  To use Partner endpoints, provide the Partner Token in the **Authorization** field using the following format: `Bearer <Partner-Token>`

  It is not necessary to send the **Client-Token** in these requests.
</Warning>

***

## Attributes

### Header

### Required

<ParamField body="name" type="string" required>
  Instance name
</ParamField>

### Optional

<ParamField body="sessionName" type="string">
  Session name on connected devices
</ParamField>

<ParamField body="deliveryCallbackUrl" type="string">
  Webhook URL for sent messages
</ParamField>

<ParamField body="receivedCallbackUrl" type="string">
  Webhook URL for received messages
</ParamField>

<ParamField body="receivedAndDeliveryCallbackUrl" type="string">
  Webhook URL for received and sent messages
</ParamField>

<ParamField body="presenceChatCallbackUrl" type="string">
  Webhook URL for chat presence status
</ParamField>

<ParamField body="disconnectedCallbackUrl" type="string">
  Webhook URL for disconnection
</ParamField>

<ParamField body="connectedCallbackUrl" type="string">
  Webhook URL for connection
</ParamField>

<ParamField body="messageStatusCallbackUrl" type="string">
  Webhook URL for message status
</ParamField>

<ParamField body="callRejectAuto" type="boolean">
  Automatically reject calls
</ParamField>

<ParamField body="callRejectMessage" type="string">
  Message when rejecting a call
</ParamField>

<ParamField body="autoReadMessage" type="boolean">
  Automatic message reading
</ParamField>

<ParamField body="autoReadStatus" type="boolean">
  Automatic status reading
</ParamField>

<ParamField body="isDevice" type="boolean">
  Mobile instance (true) or web (false)
</ParamField>

<ParamField body="businessDevice" type="boolean">
  WhatsApp Business version
</ParamField>

<ParamField body="disableEnqueueWhenDisconnected" type="boolean">
  Enable/disable queue when disconnected
</ParamField>

### Optional - only for creating mobile instances

<ParamField body="profileName" type="string">
  WhatsApp profile name
</ParamField>

<ParamField body="profilePictureUrl" type="string">
  URL for the WhatsApp profile photo
</ParamField>

***

## Request Body

```json theme={"theme":{"light":"github-light","dark":"poimandres"}}
{
  "name": "My instance"
}
```

***

## Response

### 200

```json theme={"theme":{"light":"github-light","dark":"poimandres"}}
{
  "id": "instanceId",
  "token": "instanceToken",
  "due": 1648565999675
}
```

### 405

Make sure you are correctly sending the method specification, that is, verify that 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" header to your request, which in most cases is "application/json".
