Ads and Commerce

Gateway Control Plane API Reference

Updated: Feb 2, 2025
Copy for LLM

APIs for Data Pipelines

Create a Gateway Data Pipeline

Create a gateway data pipeline in Signals Gateway and return the information of the created pipeline.

Schema

POST https://{signals_gateway_domain}/capig/graphql/

mutation createDataPipelineMutation( $tenantId: ID! $name: String! ) { tenantMutations(tenantId: $tenantId) { dataPipelineMutations { createPipeline(name: $name) { id name active dataSources { id type } dataDestinations { id type } dataFilter { filterStatus blockedEventTypes } pipelineDestinationFilters { id destinationId destinationFilterStatus destinationFilterBlockedEventTypes } } } } }
tenantId: ID!
name: String!

Input Fields

Field Description
tenantID
ID
Required
Unique identifier for the account
name
String
Required
Name of the gateway data pipeline

Returns

Pipeline
Field Description
pipeline
Pipeline
The created data pipeline object contains the ID, name, type, etc.

Error Codes

Code Description
401
Not authorized to view event metrics
500
Internal server error

Sample Request

Query
 mutation createDataPipelineMutation(
  $tenantId: ID!
  $name: String!
) {
  tenantMutations(tenantId: $tenantId) {
    dataPipelineMutations {
      createPipeline(name: $name) {
        id
        name
        active
        dataSources {
          id
          type
        }
        dataDestinations {
          id
          type
        }
  dataFilter {
          filterStatus
          blockedEventTypes
        }
  pipelineDestinationFilters {
           id
           destinationId
           destinationFilterStatus
           destinationFilterBlockedEventTypes
         }
      }
    }
  }
}

Variables

{
  "tenantId": "zilSRUW7",
  "name": "Pipeline C7P2ZR"
}

Sample Response

{
    "data": {
        "tenantMutations": {
            "dataPipelineMutations": {
                "createPipeline": {
                    "id": "sg_v1_pl_c280b69f-7a8f-486b-a5d0-1018d9bf41bc",
                    "name": "Pipeline C7P2ZR",
                    "active": true,
                    "dataSources": [],
                    "dataDestinations": []
                    "dataFilter": {
          "filterStatus": false,
          "blockedEventTypes": []
        },
        "pipelineDestinationFilters": []
                }
            }
        }
    }
}

Connect Meta Pixel

Create a Meta Conversions API data pipeline in Signals Gateway by connecting with a Meta pixel, and return the information of the created pipeline.

Schema

POST https://{signals_gateway_domain}/capig/graphql/

mutation CreatePipelineAndConnectMetaCAPIMutation( $tenantId: ID! $pipelineName: String $pixelId: ID! $businessId: String! $accessToken: String! $apiVersion: String $externalId: String! $createOB: Boolean ) { tenantMutations(tenantId: $tenantId) { dataPipelineMutations { createConversionApiGatewayPipeline(pipelineName: $pipelineName, pixelId: $pixelId, businessId: $businessId, accessToken: $accessToken, apiVersion: $apiVersion, externalId: $externalId, createOB: $createOB) { id name active dataSources { id type } dataDestinations { id type } } } } }
tenantId: ID!
name: String
pixelId: String
businessId: String
accessToken: String
apiVersion: String
externalId: String
createOB: Boolean

Input Fields

Field Description
tenantId
ID
Required
Unique identifier for the account.
pipelineName
String
Name of the data pipeline. Optional field. If not provided, the system will generate a default name.
pixelId
String
Required
The Pixel ID that needs to be integrated.
businessId
String
Required
The business ID of the account.
accessToken
String
Required
Access token from Meta Business Extension (MBE) setup or manually generated from Meta Events Manager.
apiVersion
String
Latest API Version for Graph API.
externalId
String
Required
This should be the same as external_business_id in setup object.
createOB
Boolean
Whether to create the events routing connection with Meta. Default and recommended to be true.

Returns

Pipeline
Field Description
pipeline
Pipeline
The created data pipeline object contains the ID, name, type, etc.

Error Codes

Code Description
401
Not authorized to view event metrics
500
Internal server error

Sample Request

Query
mutation CreatePipelineAndConnectMetaCAPIMutation(
  $tenantId: ID!
  $pipelineName: String
  $pixelId: ID!
  $businessId: String!
  $accessToken: String!
  $apiVersion: String
  $externalId: String!
  $createOB: Boolean
) {
  tenantMutations(tenantId: $tenantId) {
    dataPipelineMutations {
      createConversionApiGatewayPipeline(pipelineName: $pipelineName, pixelId: $pixelId, businessId: $businessId, accessToken: $accessToken, apiVersion: $apiVersion, externalId: $externalId, createOB: $createOB) {
        id
        name
        active
        dataSources {
          id
          type
        }
        dataDestinations {
          id
          type
        }
 dataFilter {
          filterStatus
          blockedEventTypes
        }
  pipelineDestinationFilters {
           id
           destinationId
           destinationFilterStatus
           destinationFilterBlockedEventTypes
        }
      }
    }
  }
}

Variables

{
  "tenantId": "IaoreXfj",
  "pipelineName": "Conversions API Gateway (258139843760841)",
  "pixelId": "258139843760841",
  "businessId": "858087751506464",
  "accessToken": "EAA2N8HVqMR4BO0KniGrDM7sngbW3OBKBgol1YbfvCDwp9S0UZALO1JgbB8yv3ZBJfYvjjUNpGn1WOVZANfQMZC5mkLZAyfmhu78Kd0GTxgpBs5raaqItv6DyBBddBUUMfkZBVeLC0EkDuZBnlsVxZA8aygZAvdp1MHV3V9Y0aYEEjfjyQDYkPezEtwZCgvgKzoE2bAtKf98FimAxakZA9sf",
  "apiVersion": "v17.0",
  "externalId": "157f0f83-7d3e-4380-b704-4ff67f03a3de",
  "createOB": true
}

Sample Response

{
    "data": {
        "tenantMutations": {
            "dataPipelineMutations": {
                "createConversionApiGatewayPipeline": {
                    "id": "sg_v1_pl_ad286034-eeec-469b-a036-72d88e87b8cc",
                    "name": "Conversions API Gateway (258139843760841)",
                    "active": true,
                    "dataSources": [
                        {
                            "id": "258139843760841",
                            "type": "META_PIXEL"
                        }
                    ],
                    "dataDestinations": [
                        {
                            "id": "sg_v1_dd_cc40dd55-070b-4deb-8f6a-63876c1ab0d7",
                            "type": "META_CONVERSIONS_API"
                        }
                    ],
"dataFilter": {
          "filterStatus": false,
          "blockedEventTypes": []
        },
        "pipelineDestinationFilters": []
                }
            }
        }
    }
}

Get Data Pipeline

The query to get the data pipeline with associated data sources, data destination and data filters corresponding to a unique identifier input.

Schema

POST https://{signals_gateway_domain}/capig/graphql/

query DataPipelineQuery( $tenantId: ID! $id: ID! ) { tenantQueries(tenantId: $tenantId) { pipeline(id: $id) { id name active type dataSources { id name type active } dataDestinations { id name type active associatedPipelines { id name type } metaCAPIConfig { dataSetId } } dataFilter { blockedEventTypes } pipelineDestinationFilters { id destinationId destinationFilterBlockedEventTypes } } } }
tenantId: ID!
id: ID!

Input Fields

Field Description
tenantId
ID
Required
Unique identifier for the account
id
ID
Required
Unique identifier for the data pipeline

Returns

Field Description
Pipeline
Pipeline
The data pipeline details fetched by the query

Error Codes

Code Description
401
Not authorized to view the data routing
500
Internal server error

Sample Request

Query
query DataPipelineDetailsQuery(
  $tenantId: ID!
  $id: ID!
) {
  tenantQueries(tenantId: $tenantId) {
    pipeline(id: $id) {
      id
      name
      active
      type
      dataSources {
        id
        name
        type
        active
      }
      dataDestinations {
        id
        name
        type
        active
        associatedPipelines {
          id
          name
          type
        }
        metaCAPIConfig {
          dataSetId
        }
      }
      dataFilter {
        blockedEventTypes
      }
      pipelineDestinationFilters {
        id
        destinationId
        destinationFilterBlockedEventTypes
      }
    }
  }
}

Variables

{
  "tenantId": "IaoreXfj",
  "id": "sg_v1_pl_1a8c443d-9ace-440e-9eb7-147322344723"
}


Sample Response

{
    "data": {
        "tenantQueries": {
            "pipeline": {
                "id": "sg_v1_pl_1a8c443d-9ace-440e-9eb7-147322344723",
                "name": "Pipeline V2E9XB",
                "active": true,
                "type": "GATEWAY_PIPELINE",
                "dataSources": [
                    {
                        "id": "1347507641242739748",
                        "name": "Gateway-party App SDK Q2EX6D",
                        "type": "ADVERTISER_HOSTED_SDK",
                        "active": true
                    },
                    {
                        "id": "8855778841440572825",
                        "name": "Gateway-party Pixel MZUY4L",
                        "type": "ADVERTISER_HOSTED_PIXEL",
                        "active": true
                    }
                ],
                "dataDestinations": [],
                "dataFilter": {
                    "blockedEventTypes": [
                        "AchievementUnlocked"
                    ]
                },
                "pipelineDestinationFilters": []
            }
        }
    }
}

Update Data Pipeline

The mutation to update a data pipeline in the Signals Gateway.

Schema

POST https://{signals_gateway_domain}/capig/graphql/

mutation updateDataPipelineMutation( $tenantId: ID! $input: PipelineInput! ) { tenantMutations(tenantId: $tenantId) { dataPipelineMutations { updatePipeline(input: $input) { id active name } } } }
tenantId: ID!
input PipelineInput { id: ID! name: String active: Boolean }

Input Fields

Field Description
tenantId
ID
Required
Unique identifier for the account
Required
The fields from the data pipeline to update

Field Description
id
ID
Required
Unique identifier for the data pipeline
name
String
Updated name of the data pipeline
active
Boolean
The status of the data pipeline indicates if the pipeline is active or not

Returns

Field Description
Pipeline
Pipeline
The data pipeline object

Error Codes

Code Description
401
Not authorized to view the data routing
500
Internal server error

Sample Request

Mutation
mutation updateDataPipelineMutation(
  $tenantId: ID!
  $input: PipelineInput!
) {
  tenantMutations(tenantId: $tenantId) {
    dataPipelineMutations {
      updatePipeline(input: $input) {
        id
        active
        name
      }
    }
  }
}

Variables

{
  "tenantId": "IaoreXfj",
  "input": {
    "id": "sg_v1_pl_ad286034-eeec-469b-a036-72d88e87b8cc",
    "active": false
  }
}

Sample Response

{
    "data": {
        "tenantMutations": {
            "dataPipelineMutations": {
                "updatePipeline": {
                    "id": "sg_v1_pl_ad286034-eeec-469b-a036-72d88e87b8cc",
                    "active": false,
                    "name": "Conversions API Gateway (258139843760841)"
                }
            }
        }
    }
}

Delete Data Pipeline

The mutation to delete an existing data pipeline in the Signals Gateway. The request can work for both gateway data pipelines and Meta Conversions API data pipelines.

Schema

POST https://{signals_gateway_domain}/capig/graphql/

mutation useDeleteDataPipelineMutation( $tenantId: ID! $id: ID! ) { tenantMutations(tenantId: $tenantId) { dataPipelineMutations { deletePipeline(id: $id) } } }
tenantId: ID!
id: ID!

Input Fields

Field Description
tenantId
ID
Required
Unique identifier for the account
id
ID
Required
Unique identifier for the data pipeline

Returns

id
ID
Unique identifier for the deleted data pipeline

Error Codes

Code Description
401
Not authorized to view the data routing
500
Internal server error

Sample Request

Query
mutation useDeleteDataPipelineMutation(
  $tenantId: ID!
  $id: ID!
) {
  tenantMutations(tenantId: $tenantId) {
    dataPipelineMutations {
      deletePipeline(id: $id)
    }
  }
}

Variables

{
  "tenantId": "IaoreXfj",
  "id": "sg_v1_pl_0fd7ac39-42b7-416f-ab6a-39d923eaa4d8"
}

Sample Response

{
    "data": {
        "tenantMutations": {
            "dataPipelineMutations": {
                "deletePipeline": "sg_v1_pl_0fd7ac39-42b7-416f-ab6a-39d923eaa4d8"
            }
        }
    }
}

Update Data Pipeline Filter

The mutation to update a data pipeline filter to block selected event types in the Signals Gateway.

Schema

POST https://{signals_gateway_domain}/capig/graphql/

mutation AddNewFilterModal_updatePipelineFilterMutation( $tenantId: ID! $input: PipelineFilterInput! ) { tenantMutations(tenantId: $tenantId) { dataPipelineMutations { updatePipelineFilter(input: $input) { filterStatus blockedEventTypes } } } }
tenantId: ID!
input PipelineFilterInput { pipelineId: ID! filterStatus: Boolean blockedEventTypes: [String] }

Input Fields

Field Description
tenantId
ID
Required
Unique identifier for the account
Required
The fields from the data pipeline to update

Field Description
pipelineId
ID
Required
Unique identifier for the data pipeline.
filterStatus
Boolean
The status of the data pipeline filter indicates if the filter is active or not.
blockedEventTypes
[String]
A list of event types which will be dropped from the data pipeline.

Returns

Field Description
DataFilter
DataFilter
The data pipeline object

Error Codes

Code Description
401
Not authorized to view the data routing
500
Internal server error

Sample Request

Query
mutation AddNewFilterModal_updatePipelineFilterMutation(
  $tenantId: ID!
  $input: PipelineFilterInput!
) {
  tenantMutations(tenantId: $tenantId) {
    dataPipelineMutations {
      updatePipelineFilter(input: $input) {
        filterStatus
        blockedEventTypes
      }
    }
  }
}

Variables

{
  "tenantId": "IaoreXfj",
  "input": {
    "pipelineId": "sg_v1_pl_1a8c443d-9ace-440e-9eb7-147322344723",
    "blockedEventTypes": [
      "AchievementUnlocked"
    ]
  }
}


Sample Response

{
    "data": {
        "tenantMutations": {
            "dataPipelineMutations": {
                "updatePipelineFilter": {
                    "filterStatus": false,
                    "blockedEventTypes": [
                        "AchievementUnlocked"
                    ]
                }
            }
        }
    }
}

Update Data Pipeline Destination Filter

The mutation to update a data destination which belongs to a specific data pipeline filter to block selected event types.

Schema

POST https://{signals_gateway_domain}/capig/graphql/

mutation AddNewPipelineDestinationFilterModal_updatePipelineDestinationFilterMutation( $tenantId: ID! $input: PipelineDestinationFilterInput! ) { tenantMutations(tenantId: $tenantId) { dataPipelineMutations { updatePipelineDestinationFilter(input: $input) { id destinationId destinationFilterStatus destinationFilterBlockedEventTypes } } } }
tenantId: ID!
input PipelineDestinationFilterInput { pipelineId: ID! destinationId: ID! destinationFilterBlockedEventTypes: [String] }

Input Fields

Field Description
tenantId
ID
Required
Unique identifier for the account
Required
The input data to filter the blocked event types

Field Description
pipelineId
ID
Required
Unique identifier for the data pipeline.
filterStatus
Boolean
The status of the data pipeline filter indicates if the filter is active or not.
blockedEventTypes
[String]
A list of event types that will be dropped from the data pipeline.

Returns

Field Description
PipelineDestinationFilter
PipelineDestinationFilter
The data pipeline destination filter object contains a list of blocked event types

Error Codes

Code Description
401
Not authorized to view the data routing
500
Internal server error

Sample Request

Query
mutation AddNewPipelineDestinationFilterModal_updatePipelineDestinationFilterMutation(
  $tenantId: ID!
  $input: PipelineDestinationFilterInput!
) {
  tenantMutations(tenantId: $tenantId) {
    dataPipelineMutations {
      updatePipelineDestinationFilter(input: $input) {
        id
        destinationId
        destinationFilterStatus
        destinationFilterBlockedEventTypes
      }
    }
  }
}

Variables

{
  "tenantId": "IaoreXfj",
  "input": {
    "pipelineId": "sg_v1_pl_48e22997-24c6-4f69-9da7-ae82657f1fdd",
    "destinationId": "sg_v1_dd_553fbb56-5348-4553-8215-0ced4a835ff3",
    "destinationFilterBlockedEventTypes": [
      "AddToCart"
    ]
  }
}


Sample Response

{
    "data": {
        "tenantMutations": {
            "dataPipelineMutations": {
                "updatePipelineDestinationFilter": {
                    "id": "pipelineDestinationFilter:sg_v1_pl_48e22997-24c6-4f69-9da7-ae82657f1fdd:sg_v1_dd_553fbb56-5348-4553-8215-0ced4a835ff3",
                    "destinationId": "sg_v1_dd_553fbb56-5348-4553-8215-0ced4a835ff3",
                    "destinationFilterStatus": true,
                    "destinationFilterBlockedEventTypes": [
                        "AddToCart"
                    ]
                }
            }
        }
    }
}