Conversions API Gateway for Multiple Accounts Control Plane API: Reference

Pixel Management

Create Pixel Connection

Onboards a new Meta Pixel to the Conversions API Gateway.

Schema

POST https://{capig_domain}/capig/graphql/ 
_________________________________________________________________________________________________________________
      
mutation AddNewPixelModalMutation(
    $tenantId: ID!
    $input: PixelConnectionCreationInput!
) {
    tenantMutations(tenantId: $tenantId) {
          signalMutations {
              setupPixelSignalConfig(input: $input) {
              id
              domains
              connectionId
              connectionStatus {
                  id
                  accessTokenAvailable
                  active
                  connected
                  accessKey
                  eventBridgeActive
                  publishingEnabled
                  apiErrorCode
                  pixelID
                  pixelName
                  lastPublished
                  totalEventsPublished
                  lastReceived
                  totalEventsReceived
                  }
              }
          }
     }
}
_________________________________________________________________________________________________________    
tenantId: ID!
_________________________________________________________________________________________________________
input PixelConnectionCreationInput {
  businessId: String!
  pixelId: String!
  accessToken: String!
  apiVersion: String
  externalId: String!
  name: String
}      
     

Fields

FieldDescription

tenantId
ID

Required

Unique identifier of the account

PixelConnectionCreationInput

FieldDescription

businessId
String

Required

The business id of the account

pixelId
String

Required

The Pixel id that needs to be integrated

accessToken
String

Required

Access token from MBE setup or manually generated from Events Manager

apiVersion
String

Optional

Latest API Version for Graph API

externalId
String

Required

This should be the same as external_business_id in setup object

name
String

Optional

Name of the Pixel


Returns

FieldDescription

signalConfig
SignalConfig

Pixel Configurations


Error Codes

CodeDescription

400

Invalid input provided

401

User is not authorized to set up Pixel configuration

500

Internal server error


Sample Request

Mutation

mutation AddNewPixelModalMutation(
   $tenantId: ID!
   $input: PixelConnectionCreationInput!
) {
   tenantMutations(tenantId: $tenantId) {
          signalMutations {
              setupPixelSignalConfig(input: $input) {
              id
              domains
              connectionId
              connectionStatus {
                  id
                  accessTokenAvailable
                  active
                  eventBridgeActive
                  publishingEnabled
                  apiErrorCode
                  pixelID
                  pixelName
                  lastPublished
                  totalEventsPublished
                  lastReceived
                  totalEventsReceived
                  }
              }
          }
   }
}
     

Variables

{
   "tenantId": "IaoreXfj",
   "input": {
       "pixelId": "18904456377094531",
       "businessId": "2840127409433732",
       "accessToken": "<accessToken>",
       "apiVersion": "v14.0",
       "externalId": "633612748410ba6e902"
   }
}
     

Sample Response

{
   "data": {
       "tenantMutations": {
           "signalMutations": {
               "setupPixelSignalConfig": {
                   "id": "SignalConfig:18904456377094531",
                   "domains": [],
                   "connectionId": "18904456377094531",
                   "connectionStatus": {
                       "id": "ConnectionStatus:18904456377094531",
                       "accessTokenAvailable": true,
                       "active": true,
                       "eventBridgeActive": true,
                       "publishingEnabled": true,
                       "apiErrorCode": null,
                       "pixelID": "18904456377094531",
                       "pixelName": null,
                       "lastPublished": 0.0,
                       "totalEventsPublished": 0.0,
                       "lastReceived": 0.0,
                       "totalEventsReceived": 0.0
                   }
               }
           }
       }
   }
}
     

Delete Pixel Connection

Deletes an existing Pixel from the Gateway.

Schema

POST https://{capig_domain}/capig/graphql/ 
_________________________________________________________________________________________________________________
      
mutation DeleteDataSourceModalMutation(
  $id: ID!
  $tenantId: ID!
) {
  tenantMutations(tenantId: $tenantId) {
    signalMutations {
      deleteDataSource(id: $id)
    }
  }
}
_________________________________________________________________________________________________________    
id: ID!
_____________________________________________________________________________________________________________
      
tenantId: ID!   
     

Fields

FieldDescription

id
ID

Required

The Pixel ID

tenantId
ID

Required
Unique identifier of the account


Returns

FieldDescription

Boolean

Indicates whether the Pixel has been successfully deleted


Error Codes

CodeDescription

401

User is not authorized to remove Pixel configuration.

404

Pixel not found.

500

Internal server error


Sample Request

Mutation

mutation DeleteDataSourceModalMutation(
 $id: ID!
 $tenantId: ID!
) {
 tenantMutations(tenantId: $tenantId) {
   signalMutations {
     deleteDataSource(id: $id)
   }
 }
}
     

Variables

{
   "id":"18904456377094531",
   "tenantId":"IaoreXfj"
}
     

Sample Response

{
   "data": {
       "tenantMutations": {
           "signalMutations": {
               "deleteDataSource": true
           }
       }
   }
}
     

Activate/Deactivate Gateway from Receiving Pixel Events

Changes Gateway’s Pixel event receiving status.

Schema

POST https://{capig_domain}/capig/graphql/ 
_________________________________________________________________________________________________________________
      
mutation updateSignalConfigStatusMutation(
    $id: ID!, $tenantId: ID!, $input: SignalConfigStatusInput!) {
  tenantMutations(tenantId: $tenantId) {
    signalMutations {
      updateSignalConfigEventsStatus(id: $id, input: $input) {
        success
        connectionStatus {
            id
            accessTokenAvailable
            active
            connected
            accessKey
            eventBridgeActive
            publishingEnabled
            apiErrorCode
            pixelID
            pixelName
            lastPublished
            totalEventsPublished
            lastReceived
            totalEventsReceived
        }
      }
    }
  }
}
_________________________________________________________________________________________________________    
id: ID!
_____________________________________________________________________________________________________________
      
tenantId: ID!
________________________________________________________________________________________________________
input SignalConfigStatusInput {
  status: Int!
}            
     

Fields

FieldDescription

id
ID

Required

Pixel ID which needs to be configured

tenantId
ID

Required
Unique identifier of the account


SignalConfigStatusInput

FieldDescription

status
Int

Required


ValueDescription

0

Deactivate

1

Activate


Returns

UpdateSignalConfigStatusPayload

FieldDescription

success
Boolean

Indicates whether the operation on Pixel was successful

connectionStatus
ConnectionStatus

Pixel connection configuration


Error Codes

CodeDescription

401

Not authorized to perform action on the Pixel

500

Internal server error


Sample Request

Mutation

mutation updateSignalConfigStatusMutation(
   $id: ID!, $tenantId: ID!, $input: SignalConfigStatusInput!) {
 tenantMutations(tenantId: $tenantId) {
   signalMutations {
     updateSignalConfigEventsStatus(id: $id, input: $input) {
       success
       connectionStatus {
         id
         connected
         active
         eventBridgeActive
         publishingEnabled
       }
     }
   }
 }
}
     

Variables

{
   "id": "18904456377094531",
   "tenantId": "IaoreXfj",
   "input": {
       "status": 1
       }
}
     

Sample Response

{
   "data": {
       "tenantMutations": {
           "signalMutations": {
               "updateSignalConfigEventsStatus": {
                   "success": true,
                   "connectionStatus": {
                       "id": "ConnectionStatus:18904456377094531",
                       "connected": true,
                       "active": true,
                       "eventBridgeActive": true,
                       "publishingEnabled": true
                   }
               }
           }
       }
   }
}
     

Activate/Deactivate Pixel Event Publishing Status

Changes Pixel’s event publishing status. If deactivated, Gateway will discard received events and not publish them to Meta.

Schema

POST https://{capig_domain}/capig/graphql/ 
_________________________________________________________________________________________________________________
      
mutation updateSignalConfigCapiPublishMutation(
$id: ID!, $tenantId: ID!, $input: SignalConfigStatusInput!) {
 tenantMutations(tenantId: $tenantId) {
   signalMutations {
     updateSignalConfigCapiPublish(id: $id, input: $input) {
       success
       connectionStatus {
           id
           accessTokenAvailable
           active
           connected
           accessKey
           eventBridgeActive
           publishingEnabled
           apiErrorCode
           pixelID
           pixelName
           lastPublished
           totalEventsPublished
           lastReceived
           totalEventsReceived
       }
     }
   }
 }
}
_________________________________________________________________________________________________________    
id: ID!
_____________________________________________________________________________________________________________
      
tenantId: ID!
________________________________________________________________________________________________________
input SignalConfigStatusInput {
  status: Int!
}            
     

Fields

FieldDescription

id
ID

Required

Pixel ID which needs to be configured

tenantId
ID

Required
Unique identifier of the account


SignalConfigStatusInput

FieldDescription

status
Int

Required


ValueDescription

0

Deactivate

1

Activate


Returns

UpdateSignalConfigStatusPayload

FieldDescription

success
Boolean

Indicates whether the operation on Pixel was successful

connectionStatus
ConnectionStatus

Pixel connection configuration


Error Codes

CodeDescription

401

Not authorized to perform action on the Pixel

500

Internal server error


Sample Request

Mutation

mutation updateSignalConfigCapiPublishMutation(
$id: ID!, $tenantId: ID!, $input: SignalConfigStatusInput!) {
 tenantMutations(tenantId: $tenantId) {
   signalMutations {
     updateSignalConfigCapiPublish(id: $id, input: $input) {
       success
       connectionStatus {
         id
         active
         eventBridgeActive
         publishingEnabled
       }
     }
   }
 }
}
     

Variables

{
   "id": "18904456377094531",
   "tenantId": "IaoreXfj",
   "input": {
       "status": 0
       }
}
     

Sample Response

{
   "data": {
       "tenantMutations": {
           "signalMutations": {
               "updateSignalConfigCapiPublish": {
                   "success": true,
                   "connectionStatus": {
                       "id": "ConnectionStatus:18904456377094531",
                       "active": false,
                       "eventBridgeActive": true,
                       "publishingEnabled": false
                   }
               }
           }
       }
   }
}
     

Activate/Deactivate Pixel Event Publishing Status by Event Name

Changes Pixel’s event publishing status by event name and Pixel ID. If deactivated, Gateway will discard these events and not publish them to Meta.

Schema

POST https://{capig_domain}/capig/graphql/ 
_________________________________________________________________________________________________________________
      
mutation EventFilterStatusMutation($tenantId: ID!, $input: UpdateEventFilterInput!) {
 tenantMutations(tenantId: $tenantId) {
   updateEventFilter(input: $input) {
     updatedFilter {
       id
       eventName
       pixelId
       filterState
     }
   }
 }
}
_________________________________________________________________________________________________________    
tenantId: ID!
_____________________________________________________________________________________________________________
      
input UpdateEventFilterInput {
  eventName: String!
  pixelIds: [String!]
  filterState: EventFilterState!
}            
     

Fields

FieldDescription

tenantId
ID

Required
Unique identifier of the account


UpdateEventFilterInput

FieldDescription

eventName
String

Required

Name of the event to be filtered

pixelIds
String

Optional

List of Pixel IDs where the filter needs to be applied. If null is provided, all the Pixels for the account will be updated

filterState
EventFilterState

Required

State of the filter


Returns

UpdateEventFilterResult

FieldDescription

updatedFilter
EventFilter

Updated Event Filter


Error Codes

CodeDescription

401

Not authorized to update event filters

500

Internal server error


Sample Request

Mutation

mutation EventFilterStatusMutation($tenantId: ID!, $input: UpdateEventFilterInput!) {
tenantMutations(tenantId: $tenantId) {
  updateEventFilter(input: $input) {
    updatedFilter {
      eventName
      pixelId
      filterState
    }
  }
}
}
     

Variables

{
"tenantId": "IaoreXfj",
"input": {
  "eventName": "AddToCart",
  "pixelIds": ["18904456377094531"],
  "filterState": "PUBLISH"
}
}
     

Sample Response

{
   "data": {
       "tenantMutations": {
           "updateEventFilter": {
               "updatedFilter": {
                   "eventName": "AddToCart",
                   "pixelId": "18904456377094531",
                   "filterState": "PUBLISH"
               }
           }
       }
   }
}
     

Block/Unblock Websites Permitted to Receive and Publish Events

Blocks receiving of events from specific websites.

Schema

POST https://{capig_domain}/capig/graphql/ 
_________________________________________________________________________________________________________________
      
mutation useComitDomainFilterChangeMutation($tenantId: ID!, $input: UpdateDomainFilterInput!) {
  tenantMutations(tenantId: $tenantId) {
    updateDomainFilter(input: $input) {
      updatedFilter {
        id
        domain
        pixelId
        filterState
      }
    }
  }
}
_________________________________________________________________________________________________________    
tenantId: ID!
_____________________________________________________________________________________________________________
      
input UpdateDomainFilterInput {
  domain: String!
  pixelIds: [String!]
  filterState: DomainFilterState!
}            
     

Fields

FieldDescription

tenantId
ID

Required
Unique identifier of the account


UpdateDomainFilterInput

FieldDescription

domain
String

Required

Name of the domain to be filtered


Format should be: example.com

pixelIds
String

Optional

List of Pixel IDs where the filter needs to be applied

filterState
DomainFilterState

Required

State of the filter


Returns

UpdateDomainFilterResult

FieldDescription

updatedFilter
DomainFilter

Domain filter object


Error Codes

CodeDescription

401

Not authorized to update domain filters

500

Internal server error


Sample Request

Mutation

mutation useComitDomainFilterChangeMutation($tenantId: ID!, $input: UpdateDomainFilterInput!) {
 tenantMutations(tenantId: $tenantId) {
   updateDomainFilter(input: $input) {
     updatedFilter {
       id
       domain
       pixelId
       filterState
     }
   }
 }
}
     

Variables

{
 "tenantId": "IaoreXfj",
 "input": {
   "domain": "example.com",
   "filterState": "DROP"
 }
}
     

Sample Response

"data": {
       "tenantMutations": {
           "updateDomainFilter": {
               "updatedFilter": {
                   "id": "DomainFilter:example.com:global",
                   "domain": "example.com",
                   "pixelId": null,
                   "filterState": "DROP"
               }
           }
       }
   }