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

# Service window status

> Reports whether the WhatsApp 24-hour customer-service window is currently OPEN for a contact on the number bound to the API key.

- **Meta Cloud API numbers** — `windowType: "META_24H"`. `open` is true when the contact's last inbound message arrived within the last 24 hours; `expiresAt` is `lastInboundAt` + 24h. While the window is open, free-form messages are allowed; once it closes, sends fail with `META_OUTSIDE_24H_WINDOW` and you must use an approved template.
- **Web (unofficial) numbers** — no Meta restriction: `windowType: "NONE"` and `open` is always true; `lastInboundAt`/`expiresAt` are still returned informatively.

Check it before sending free-form content to decide between free-form and template messages.

**Requires a number-scoped key.**



## OpenAPI

````yaml openapi.json GET /v1/service-window
openapi: 3.1.0
info:
  title: Pilot Status API
  version: 1.0.0
  license:
    name: Pilot Status Terms of Service
    url: https://pilotstatus.com.br/terms
  description: >-
    Public REST API for Pilot Status. Authenticate with the `x-api-key: ps_...`
    header (or `x-api-key-id`). Base URL: https://pilotstatus.com.br
servers:
  - url: https://pilotstatus.com.br
security:
  - apiKey: []
  - apiKeyId: []
paths:
  /v1/service-window:
    get:
      tags:
        - Messages
      summary: Service window status
      description: >-
        Reports whether the WhatsApp 24-hour customer-service window is
        currently OPEN for a contact on the number bound to the API key.


        - **Meta Cloud API numbers** — `windowType: "META_24H"`. `open` is true
        when the contact's last inbound message arrived within the last 24
        hours; `expiresAt` is `lastInboundAt` + 24h. While the window is open,
        free-form messages are allowed; once it closes, sends fail with
        `META_OUTSIDE_24H_WINDOW` and you must use an approved template.

        - **Web (unofficial) numbers** — no Meta restriction: `windowType:
        "NONE"` and `open` is always true; `lastInboundAt`/`expiresAt` are still
        returned informatively.


        Check it before sending free-form content to decide between free-form
        and template messages.


        **Requires a number-scoped key.**
      operationId: get_service_window
      parameters:
        - name: destinationNumber
          in: query
          required: true
          description: >-
            Contact phone number in E.164 format, with or without the leading +
            (digits also accepted).
          schema:
            type: string
          example: '+5511988887777'
      responses:
        '200':
          description: Service window status
          content:
            application/json:
              schema:
                type: object
                properties:
                  open:
                    type: boolean
                    description: >-
                      Whether free-form messages can be sent right now. Always
                      true for web (unofficial) numbers.
                    example: true
                  windowType:
                    type: string
                    enum:
                      - META_24H
                      - NONE
                    description: >-
                      META_24H for Meta Cloud API numbers (24-hour window
                      enforced); NONE for web (unofficial) numbers.
                    example: META_24H
                  lastInboundAt:
                    type:
                      - string
                      - 'null'
                    description: >-
                      UTC ISO timestamp of the contact's most recent inbound
                      message, or null when none is known.
                    example: '2026-07-18T10:00:00.000Z'
                  expiresAt:
                    type:
                      - string
                      - 'null'
                    description: >-
                      UTC ISO timestamp when the window closes (lastInboundAt +
                      24h), or null. Informative on web numbers.
                    example: '2026-07-19T10:00:00.000Z'
        '400':
          description: Invalid or missing destinationNumber
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: >-
                  destinationNumber is required and must be a valid phone
                  (E.164, with or without +)
                code: INVALID_DESTINATION
        '401':
          description: Missing or invalid `x-api-key` / `x-api-key-id` header
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Unauthorized
        '403':
          description: Tenant-scoped key used on a number-scoped endpoint
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Tenant-scoped keys cannot call number endpoints
                code: TENANT_SCOPE_NOT_ALLOWED
        '404':
          description: WhatsApp number not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: WhatsApp number not found
                code: NUMBER_NOT_FOUND
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type: string
              example:
                error: Too many requests
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: Your ps_ API key
    apiKeyId:
      type: apiKey
      in: header
      name: x-api-key-id
      description: API key id (alternative to x-api-key)

````