> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wachat.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Instance State

> Check whether a WhatsApp instance is connected. Send the unique API instance name in the query parameter. When the instance is connected, the normalized response includes the display name, API instance name, detected WhatsApp number, and profile information when available.

Check whether a WhatsApp instance is connected.

When the instance is already connected, the response also includes the detected WhatsApp number and profile fields when they are available.

Use the unique API instance name in the `instanceName` query parameter. In the normalized response, `instance.instanceName` is the display name shown in Wachat, while `instance.apiInstanceName` is the unique name you should keep using for API calls.

```json theme={null}
{
  "success": true,
  "data": {
    "instance": {
      "instanceName": "jakarta_store",
      "state": "open"
    }
  },
  "instance": {
    "instanceName": "jakarta_store",
    "apiInstanceName": "t1_mqc3zame_jakarta_store",
    "internalName": "t1_mqc3zame_jakarta_store",
    "state": "open",
    "profileName": "jakarta_store",
    "profilePictureUrl": "https://pps.whatsapp.net/...",
    "profilePicUrl": "https://pps.whatsapp.net/...",
    "number": "628123456789",
    "owner": "628123456789@s.whatsapp.net",
    "integration": "WHATSAPP-BAILEYS"
  }
}
```

<Note>
  If WhatsApp returns the internal API instance name as the profile name, Wachat normalizes it back to the display name so your UI can show a clean name such as `jakarta_store`.
</Note>

<Note>
  `profilePictureUrl` may be `null` if WhatsApp does not return a public profile photo for the connected account. For browser image rendering, use the Profile Picture endpoint instead of loading the WhatsApp URL directly.
</Note>


## OpenAPI

````yaml GET /instance/state
openapi: 3.0.3
info:
  title: Wachat Enterprise API
  description: >
    Welcome to the official Wachat API reference. Wachat provides
    developer-friendly, ultra-reliable infrastructure to scale your WhatsApp
    communications programmatically.


    Easily deploy automated messaging pipelines, orchestrate interactive
    customer engagement patterns, verify phone numbers instantly, and control
    containerized WhatsApp instances via a secure, production-grade REST
    architecture.
  version: 1.0.0
servers:
  - url: https://app.wachat.net/api/v1
    description: Live Production Gateway
security:
  - bearerAuth: []
paths:
  /instance/state:
    get:
      tags:
        - Session Lifecycle Infrastructure
      summary: Get Instance State
      description: >-
        Check whether a WhatsApp instance is connected. Send the unique API
        instance name in the query parameter. When the instance is connected,
        the normalized response includes the display name, API instance name,
        detected WhatsApp number, and profile information when available.
      parameters:
        - in: query
          name: instanceName
          required: true
          schema:
            type: string
          description: >-
            Unique API instance name returned by Wachat. Use apiInstanceName
            from the create or state response.
          example: t1_mq9r2jov_jakarta_store
      responses:
        '200':
          description: Instance state returned successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    description: >-
                      Raw state payload returned by Wachat. This may contain the
                      internal API instance name.
                    properties:
                      instance:
                        type: object
                        properties:
                          instanceName:
                            type: string
                            example: t1_mq9r2jov_jakarta_store
                          state:
                            type: string
                            example: open
                  instance:
                    type: object
                    description: >-
                      Normalized instance state and profile data for UI and API
                      usage.
                    properties:
                      instanceName:
                        type: string
                        description: >-
                          Display name shown in Wachat. This is safe to show in
                          your UI.
                        example: jakarta_store
                      apiInstanceName:
                        type: string
                        description: Unique API instance name to use in future API calls.
                        example: t1_mq9r2jov_jakarta_store
                      internalName:
                        type: string
                        description: Internal API instance name.
                        example: t1_mq9r2jov_jakarta_store
                      state:
                        type: string
                        example: open
                      profileName:
                        type: string
                        nullable: true
                        description: >-
                          Connected WhatsApp profile name. If WhatsApp returns
                          the internal API name, Wachat normalizes this to the
                          display name.
                        example: jakarta_store
                      profilePictureUrl:
                        type: string
                        nullable: true
                        description: >-
                          WhatsApp profile picture URL when returned by
                          WhatsApp.
                        example: https://pps.whatsapp.net/v/t61.24694-24/example.jpg
                      profilePicUrl:
                        type: string
                        nullable: true
                        description: Alias of profilePictureUrl.
                        example: https://pps.whatsapp.net/v/t61.24694-24/example.jpg
                      number:
                        type: string
                        nullable: true
                        example: '628123456789'
                      owner:
                        type: string
                        nullable: true
                        example: 628123456789@s.whatsapp.net
                      integration:
                        type: string
                        nullable: true
                        example: WHATSAPP-BAILEYS
        '400':
          description: Missing instanceName query parameter.
        '401':
          description: Missing or invalid API key.
        '403':
          description: Subscription restriction prevented state lookup.
        '404':
          description: Instance not found for this API key.
        '500':
          description: Internal server error.
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Authenticate your integration payloads by injecting your premium secure
        Wachat Account API Private Secret Key inside standard Authorization
        Bearer header vectors.

````