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

# contextualDestinationConnect

> Connect Klaviyo, Attentive or Postscript to Contextual with its secret, as the Redo app does, and start sending the store's enabled events to it. Returns the destination as published; read `contextualDestinationHealth` for its event delivery. Reuses the store's destination of that type when its status is `DISCONNECTED` or `ERROR`. BAD_USER_INPUT (400) for an empty key; ACTION_REJECTED (422) when the store's Contextual isn't set up yet: set up its tracking subdomain with `contextualTrackingDomainCreate` first; CONFLICT (409) when that destination is already connected: delete it first.

**Required scopes:** [`marketing_settings_write`](https://developers.redo.com/docs/api-reference/v3/reference/scopes#scope-marketing_settings_write)

**Store must have one of:** `CONTEXTUAL`

## Arguments

**input** `[ContextualDestinationConnectInput!](/docs/api-reference/v3/reference/marketing/contextual-destination-connect-input)` *required*

The destination and its secret.

**fields**

**apiKey** `String!` *required*

Write-only: never returned. The destination's secret: the Klaviyo private API key, the Attentive API key or the Postscript shop token.

**type** `[ContextualDestinationConnectType!](/docs/api-reference/v3/reference/marketing/contextual-destination-connect-type)` *required*

The destination to connect.

## Returns

**contextualDestinationConnect** `[ContextualDestinationConnectResult!](/docs/api-reference/v3/reference/marketing/contextual-destination-connect-result)` *required*

A destination as Contextual published it on connect.

**fields**

**externalId** `String!` *required*

Contextual's id for this destination.

**name** `String!` *required*

Display name of the destination.

**status** `[ContextualDestinationStatus!](/docs/api-reference/v3/reference/marketing/contextual-destination-status)` *required*

Connection status Contextual returned on publish.

**type** `[ContextualDestinationConnectType!](/docs/api-reference/v3/reference/marketing/contextual-destination-connect-type)` *required*

The destination platform.

## Example

```graphql theme={null}
mutation {
  contextualDestinationConnect(input: { ... }) {
    externalId
    name
    status
    type
  }
}
```


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