setupIntegration
Sets up a new integration and assigns it to a brand.
This mutation creates a new integration with the specified configuration and credentials, then assigns it to a brand within the company context. The integration will be configured with the provided authentication details and assigned roles to determine its permissions.
Authentication Requirements
- Header
X-Company-Id
must be provided - Header
Authorization
must be provided - Header
X-Brand-Id
is optional (if provided,brandId
argument becomes optional)
Integration Setup Process
- Creates a new integration with a unique ID
- Encrypts and stores authentication credentials (
api_key
,api_secret
,api_token
,oauth_token
) - Assigns specified roles to determine integration permissions
- Associates the integration with the specified brand
- Configures management settings (managed vs user-managed)
Credential Storage
All authentication credentials are automatically encrypted before storage:
api_key
: Main API key or primary connection credentialapi_secret
: API secret for authenticationapi_token
: Additional API tokenoauth_token
: Shopify OAuth token (for Shopify integrations)
Role Assignment
The integration must be assigned at least one role from the available role types. Roles determine the permissions and actions the integration can perform.
Management Types
- **Managed** (
managed: true
): Integration setup handled by Endless - **User-managed** (
managed: false
): Integration setup handled by the user
Behavior
Upon successful execution, returns the created integration with all configured settings. The integration will be ready for use according to its assigned roles and permissions.
Possible Errors
GraphQL::ExecutionError
- when required headers are missingValidationError
- when required arguments are missing or invalidAuthenticationError
- when authentication credentials are invalidPermissionError
- when user lacks permission to create integrations
**Permissions required:** Company and brand access
setupIntegration(
input: SetupIntegrationInput!
): Integration!
Arguments
setupIntegration.input
● SetupIntegrationInput!
non-null input
Parameters for SetupIntegration