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

# Get Meta access token

> Retrieve, already decrypted, the Meta access token stored on an Official API connection — and find out what type it is.

Returns the **Meta access token** that D-API stores for the connection, already
**decrypted**, along with the token's classification. The `id` accepts the
connection id or the session id (`cloud-<uuid>`).

## Token types (`kind`)

| `kind` | What it is | `expiresAt` |
| - | - | - |
| `permanent` | Does not expire — System User / business integration token. This is what Embedded Signup issues. | `null` |
| `long_lived` | \~60-day token (long-lived token exchange). | ISO-8601 date |
| `short_lived` | \~1h token, coming straight from the `code` exchange. | ISO-8601 date |
| `unknown` | Meta's `/debug_token` did not respond — the token is returned anyway, without classification. | `null` |

Besides `kind`, `data` contains `label` (summary in Portuguese, ready to display),
`expiresInDays`, `isValid`, `scopes`, `type` (Meta's own label: `USER`,
`SYSTEM_USER`…), `wabaId`, `phoneNumberId` and `businessId`.

## Example

```bash theme={null}
curl https://api.d-api.cloud/api/v1/connections/cloud-api/<CONNECTION_ID>/access-token \
  -H "Authorization: <YOUR_SECRET_API_KEY>"
```

```json theme={null}
{
  "success": true,
  "data": {
    "accessToken": "EAAG…",
    "wabaId": "102290129340398",
    "phoneNumberId": "106540352242922",
    "businessId": "1049837394389",
    "kind": "permanent",
    "label": "Permanente (System User) — não expira",
    "expiresAt": null,
    "expiresInDays": null,
    "isValid": true,
    "type": "SYSTEM_USER",
    "scopes": ["whatsapp_business_management", "whatsapp_business_messaging"]
  }
}
```

> [!WARNING]
>
> The `accessToken` is a **secret**: with it you can send messages and manage the
> WABA. Only call this route from your backend, with the secret API key, and do not log the
> token. Every read is audited.

> [!NOTE]
>
> To **replace** the stored token (rotation), use
> [Update connection](https://docs.d-api.cloud/en/api-reference/cloud-api/atualizar-conexao.md) with the
> `accessToken` field.


## OpenAPI

````yaml api-reference/openapi.en.json GET /api/v1/connections/cloud-api/{id}/access-token
openapi: 3.1.0
info:
  title: D-API - Complete WhatsApp Infrastructure
  description: >-
    A scalable, robust solution for automation managers, SaaS products and end
    users who need a reliable WhatsApp integration. It offers multiple
    simultaneous instances, real-time webhooks, an intuitive dashboard and a
    documented REST API with 99.9% uptime and latency under 30ms.
  version: 1.2.1
  contact:
    name: Suporte D-API
    email: suporte@d-api.cloud
    url: https://d-api.cloud
servers:
  - url: https://api.d-api.cloud
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Home
    description: Base endpoints
  - name: Sessions
    description: Endpoints for managing sessions
  - name: Messages
    description: Endpoints for sending messages
  - name: Cloud API
    description: >-
      WhatsApp Official API (Meta Cloud API): manual connection, template
      management (list/create/delete) and template sending.
  - name: IVR Calls
    description: 'Voice call dispatch (IVR): single or bulk, with audio or an IVR flow.'
  - name: SMS
    description: 'SMS sending: single or bulk.'
  - name: Commands
    description: >-
      Look up asynchronous commands (async: true) by the commandId returned when
      enqueued.
paths:
  /api/v1/connections/cloud-api/{id}/access-token:
    get:
      tags:
        - Cloud API
      summary: Get the decrypted Meta access token
      description: >-
        Returns the Meta access token stored for a cloud_api connection,
        DECRYPTED, along with the token type. The `id` accepts the connection id
        or the session id (`cloud-<uuid>`).


        `data.accessToken` is the raw Graph token — treat it as a secret (it
        sends messages and manages the WABA). `data.kind` is `permanent` (never
        expires, e.g. System User), `long_lived` (~60-day token from Embedded
        Signup), `short_lived` (~1h token from the code exchange) or `unknown`
        (Meta's /debug_token could not be queried). `data.expiresAt` (ISO-8601,
        null when permanent), `data.expiresInDays`, `data.isValid`,
        `data.scopes`, `data.type` (Meta's own USER/SYSTEM_USER label) and
        `data.label` (summary in pt-BR) describe the token. To rotate it, use
        PATCH /connections/cloud-api/:id.
      operationId: getApiV1ConnectionsCloud-apiByIdAccess-token
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data: {}
                  error:
                    type: string
                  code:
                    type: string
                required:
                  - success
            multipart/form-data:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data: {}
                  error:
                    type: string
                  code:
                    type: string
                required:
                  - success
            text/plain:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data: {}
                  error:
                    type: string
                  code:
                    type: string
                required:
                  - success
          description: Successful response
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'API Key for authentication. Format: <API_KEY>'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.