Skip to main content

setupIntegration

Sets up a new integration and assigns it to a company.

This mutation creates a new integration with the specified configuration and credentials, then assigns it to a company. 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

Integration Setup Process​

  1. Creates a new integration with a unique ID
  2. Encrypts and stores authentication credentials (api_key, api_secret, api_token, oauth_token)
  3. Assigns specified roles to determine integration permissions
  4. Associates the integration with the company
  5. 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 credential
  • api_secret: API secret for authentication
  • api_token: Additional API token
  • oauth_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 missing
  • ValidationError - when required arguments are missing or invalid
  • AuthenticationError - when authentication credentials are invalid
  • PermissionError - when user lacks permission to create integrations

**Permissions required:** Company access

setupIntegration(
input: SetupIntegrationInput!
): Integration!

Arguments​

setupIntegration.input ● SetupIntegrationInput! non-null input common​

Parameters for SetupIntegration

Type​

Integration object integrations​