Creates a Gateway for multiple accounts, which can be managed by a partner or advertiser depending on the input.
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 canEditTenantSettingsInUI } } } } _________________________________________________________________________________________________________ input CreateTenantInput { name: String! canPartnerManage: Boolean! adminEmail: String eventEnrichment: Boolean! }
CreateTenantInput
Field | Description |
---|---|
| Required Name of the account |
| Required |
| Optional |
| Required |
CreateTenantResult
Field | Description |
---|---|
| Newly created tenant |
Code | Description |
---|---|
400 | Invalid input provided |
401 | Not authorized to create account |
500 | Internal server error |
Mutation
mutation CreateTenantMutation( $input: CreateTenantInput! ) { tenantMutations { createTenant(input: $input) { tenant { id name status canPartnerManage } } } }
Variables
{ "input": { "name": "TestAdvertiserViaAPI", "canPartnerManage": true, "eventEnrichment": true } }
{ "data": { "tenantMutations": { "createTenant": { "tenant": { "id": "hU2koC34", "name": "TestAdvertiserViaAPI", "status": 0, "canPartnerManage": true } } } } }
Deletes an advertiser account.
POST https://{capig_domain}/hub/graphql/ _________________________________________________________________________________________________________________ mutation DeleteTenant($tenantId: String!) { tenantMutations { deleteTenant(tenantId: $tenantId) } } _________________________________________________________________________________________________________ tenantId: String!
Field | Description |
---|---|
| Required Unique identifier of the account to be deleted. |
Boolean | Indicates whether tenant was successfully deleted. |
Code | Description |
---|---|
400 | Invalid input provided |
401 | Not authorized to delete account |
500 | Internal server error |
Mutation
mutation DeleteTenant($tenantId: String!) { tenantMutations { deleteTenant(tenantId: $tenantId) } }
Variables
{ "tenantId": "Tse53QtW" }
{ "data": { "tenantMutations": { "deleteTenant": true } } }
Updates the account with a new name, status and permission for the partner to manage the account.
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 |
---|---|
| Required Unique identifier of the account |
| Optional Name of the account |
| Optional Account Status (Refer Tenant Object) |
| 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
mutation TenantEditNameModalMutation( $input: UpdateTenantInput! ) { tenantMutations { updateTenant(input: $input) { tenant { id name status canPartnerManage } } } }
Variables
{ "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 } } } } }
Gets the advertiser account corresponding to a unique identifier input.
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 |
---|---|
| 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
query TenantAccountUsersViewQuery( $tenantId: String! ) { tenant(tenantId: $tenantId) { id name users { id email roles { name displayName } } } }
Variables
{ "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" } ] } ] } } }
Gets the account usage in terms of active and inactive Pixels corresponding to a unique identifier for the account. Additionally, it returns the traffic usage stats for a duration
POST https://{capig_domain}/hub/graphql/ _________________________________________________________________________________________________________________ query TenantUsageQuery( $tenantId: String! ) { tenantUsage(tenantId: $tenantId) { totalActivePixels totalInactivePixels totalPixels tenantUsageByTraffic { totalEventsReceived totalPixelsWithTraffic publishError durationInHours, lastUpdatedAt } } } _________________________________________________________________________________________________________ tenantId: String!
Field | Description |
---|---|
| Required Unique identifier of the account |
Field | Description |
---|---|
| TenantUsage |
Code | Description |
---|---|
401 | Not authorized to view account usage |
500 | Internal server error |
Query
query { tenantUsage(tenantId: "IaoreXfj"){ totalActivePixels totalInactivePixels totalPixels } }
{ "data": { "tenantUsage": { "totalActivePixels": 3, "totalInactivePixels": 1, "totalPixels": 4 } } }