POST https://{capig_domain}/hub/graphql/
mutation CreateTenantMutation(
$input: CreateTenantInput!
) {
tenantMutations {
createTenant(input: $input) {
tenant {
id
name
status
canPartnerManage
users {
id
email
roles {
name
displayName
}
tenants {
id
name
status
canPartnerManage
availableRoles {
name
displayName
}
}
isSelf
canBeDeleted
defaultTenantId
}
availableRoles {
name
displayName
}
tenantUsage {
totalActivePixels
totalInactivePixels
totalPixels
tenantUsageByTraffic {
totalEventsReceived
totalPixelsWithTraffic
publishError
durationInHours,
lastUpdatedAt
}
}
canEditTenantSettingsInUI
canViewTenantInUI
canEditTenantUsersInUI
}
}
}
}
input CreateTenantInput {
name: String!
canPartnerManage: Boolean!
adminEmail: String
eventEnrichment: Boolean!
}
CreateTenantInput| Field | Description |
|---|---|
nameString | Required Name of the account |
canPartnerManageBoolean | Required Boolean indicating whether a partner can manage this account |
adminEmailString | Optional Email address of the admin (This is required if canPartnerManage is false) |
eventEnrichmentBoolean | Required Enhance events with advanced matching data |
CreateTenantResult| Field | Description |
|---|---|
Newly created tenant |
| Code | Description |
|---|---|
400 | Invalid input provided |
401 | Not authorized to create account |
500 | Internal server error |
mutation CreateTenantMutation(
$input: CreateTenantInput!
) {
tenantMutations {
createTenant(input: $input) {
tenant {
id
name
status
canPartnerManage
}
}
}
}
{
"input": {
"name": "TestAdvertiserViaAPI",
"canPartnerManage": true,
"eventEnrichment": true
}
}
{
"data": {
"tenantMutations": {
"createTenant": {
"tenant": {
"id": "hU2koC34",
"name": "TestAdvertiserViaAPI",
"status": 0,
"canPartnerManage": true
"canEditTenantSettingsInUI": false
"canViewTenantInUI": false
"canEditTenantUsersInUI": false
}
}
}
}
}
POST https://{capig_domain}/hub/graphql/
query TenantAccountUsersViewQuery(
$tenantId: String!
) {
tenant(tenantId: $tenantId) {
id
name
status
canPartnerManage
users {
id
email
roles {
name
displayName
}
tenants {
id
name
status
canPartnerManage
availableRoles {
name
displayName
}
}
isSelf
canBeDeleted
defaultTenantId
}
availableRoles {
name
displayName
}
tenantUsage {
totalActivePixels
totalInactivePixels
totalPixels
tenantUsageByTraffic {
totalEventsReceived
totalPixelsWithTraffic
publishError
durationInHours,
lastUpdatedAt
}
}
canEditTenantSettingsInUI
canViewTenantInUI
canEditTenantSettingsInUI
}
}
tenantId: String!
| Field | Description |
|---|---|
tenantIdString | Required Unique identifier of the account to be fetched |
| Field | Description |
|---|---|
Account details are fetched |
| Code | Description |
|---|---|
401 | Not authorized to view account |
500 | Internal server error |
query TenantAccountUsersViewQuery(
$tenantId: String!
) {
tenant(tenantId: $tenantId) {
id
name
users {
id
email
roles {
name
displayName
}
}
}
}
{
"tenantId":"wW58k7FQ"
}
{
"data": {
"tenant": {
"id": "wW58k7FQ",
"name": "Test Account",
"users": [
{
"id": "992bc489-a799-4374-8933-0109eed60e3d",
"email": "tempuser@test.com",
"roles": [
{
"name": "advertiser-manage-wW58k7FQ",
"displayName": "manage"
}
]
}
]
}
}
}
POST https://{capig_domain}/hub/graphql/
mutation TenantEditNameModalMutation(
$input: UpdateTenantInput!
) {
tenantMutations {
updateTenant(input: $input) {
tenant {
id
name
status
canPartnerManage
users {
id
email
roles {
name
displayName
}
tenants {
id
name
status
canPartnerManage
availableRoles {
name
displayName
}
}
isSelf
canBeDeleted
defaultTenantId
}
availableRoles {
name
displayName
}
tenantUsage {
totalActivePixels
totalInactivePixels
totalPixels
tenantUsageByTraffic {
totalEventsReceived
totalPixelsWithTraffic
publishError
durationInHours,
lastUpdatedAt
}
}
canEditTenantSettingsInUI
canViewTenantInUI
canEditTenantSettingsInUI
}
}
}
}
input UpdateTenantInput {
tenantId: String!
name: String
status: Int
canPartnerManage: Boolean
}
UpdateTenantInput| Field | Description |
|---|---|
tenantIdString | Required Unique identifier of the account |
nameString | Optional Name of the account |
statusInt | Optional Account Status (Refer Tenant Object) |
canPartnerManageBoolean | Optional Indicates whether the partner manage this account |
TenantMutationResponse| Field | Description |
|---|---|
Updated tenant |
| Code | Description |
|---|---|
400 | Invalid input provided |
401 | Not authorized to update tenant |
500 | Internal server error |
mutation TenantEditNameModalMutation(
$input: UpdateTenantInput!
) {
tenantMutations {
updateTenant(input: $input) {
tenant {
id
name
status
canPartnerManage
}
}
}
}
{
"input":{
"tenantId":"IaoreXfj",
"name":"Test Account Name Update",
"status":0,
"canPartnerManage":true
}
}
{
"data": {
"tenantMutations": {
"updateTenant": {
"tenant": {
"id": "IaoreXfj",
"name": "Test Account Name Update",
"status": 0,
"canPartnerManage": true
}
}
}
}
}
POST https://{capig_domain}/hub/graphql/
mutation DeleteTenant($tenantId: String!) {
tenantMutations {
deleteTenant(tenantId: $tenantId)
}
}
tenantId: String!
| Field | Description |
|---|---|
tenantIdString | Required Unique identifier of the account to be deleted. |
Boolean | Indicates whether the tenant was successfully deleted. |
| Code | Description |
|---|---|
400 | Invalid input provided |
401 | Not authorized to delete account |
500 | Internal server error |
mutation DeleteTenant($tenantId: String!) {
tenantMutations {
deleteTenant(tenantId: $tenantId)
}
}
{
"tenantId": "Tse53QtW"
}
{
"data": {
"tenantMutations": {
"deleteTenant": true
}
}
}
POST https://{capig_domain}/hub/graphql/
query TenantUsageQuery(
$tenantId: String!
) {
tenantUsage(tenantId: $tenantId) {
totalActivePipeline
totalInactivePixels
totalPixels
totalPipelines
tenantUsageByTraffic {
totalEventsReceived
totalPixelsWithTraffic
}
}
}
tenantId: String!
| Field | Description |
|---|---|
tenantIdString | Required Unique identifier of the account |
| Field | Description |
|---|---|
TenantUsageTenantUsage | TenantUsage |
| Code | Description |
|---|---|
401 | Not authorized to view account usage |
500 | Internal server error |
query {
tenantUsage(tenantId: "IaoreXfj"){
totalActivePixels
totalInactivePixels
totalPixels
}
}
{
"data": {
"tenantUsage": {
"totalActivePixels": 3,
"totalPixels": 4
}
}
}