---
title: REST API MGID for Advertising Agencies
description: "  Accept: application/json Authorization: Bearer {token} Transfered parameters: Returned answer: All sums tranfered in advertising agency currency. Possible errors: If transferred current token is inv"
---

[Skip to content](https://help.mgid.com/api-ra#main-content)

English

Show submenu for translations

![MGID\_Logo\_Help\_Center\_W\_R\_Swoosh.svg\]](https://help.mgid.com/hubfs/MGID_Logo_Help_Center_W_R_Swoosh.svg)

- [Advertisers](https://www.mgid.com/advertisers)
- [Publishers](https://www.mgid.com/publishers)
- [Contact Us](https://www.mgid.com/about#tabs-contactus)

Open main navigation

Close main navigation

- [Advertisers](https://www.mgid.com/advertisers)
- [Publishers](https://www.mgid.com/publishers)
- [Contact Us](https://www.mgid.com/about#tabs-contactus)
- English
  
  Show submenu for translations
- Contact us

 Contact us

 Welcome to MGID! How can we help you?

- There are no suggestions because the search field is empty.

1. [Help Center Home](https://help.mgid.com/?hsLang=en)
2. [API](https://help.mgid.com/api?hsLang=en)

# REST API MGID for Advertising Agencies

#### ***\* Please note that all API requests must be performed via HTTPS.***

### **Table of contents**

1. <https://help.mgid.com/api-ra#toc2>[Getting advertising agency clients list with financial stats](https://help.mgid.com/api-ra#toc3)
2. [Getting one client financial stats](https://help.mgid.com/api-ra#toc4)
3. [Getting financial stats of advertising agency](https://help.mgid.com/api-ra#toc5)
4. [Getting data of advertising agency clients expences for a period](https://help.mgid.com/api-ra#toc6)
5. [Clients balance replenishments from advertising agency wallet](https://help.mgid.com/api-ra#toc7)

 

### **Getting advertising agency clients list  with financial stats**

| **Method** | GET |
| --- | --- |
| **URL** | api.mgid.com/v1/agencies/{accountId}/clients |
| **Headers** | Accept: application/json Authorization: Bearer {token} |

Transfered parameters:

| **Parameter** | **Value** |
| --- | --- |
| accountId | Identifier of user (advertising agency) account |

Returned answer:

```
{   clients:{       "id":_identifier_of_client's_account_,         "email":_client's_email_,      "wallet":{         "balance":_state_of_MG_wallet_,         "credit":_overdraft_amount_,         "income":_total_replenish_sum_      }   }}
```

All sums tranfered in advertising agency currency.

**Possible errors:**

If transferred current token is invalid, returned error is "invalid token".

 

### **Getting one client financial stats**

| **Method** | GET |
| --- | --- |
| **URL** | api.mgid.com/v1/agencies/{accountId}/clients/{client\_id} |
| **Headers** | Accept: application/json Authorization: Bearer {token} |

Transfered parameters:

| **Parameter** | **Value** |
| --- | --- |
| accountId | Identifier of user (advertising agency) account |
| client\_id | Advertising agency client id |

Returned answer:

```
{    "id":_identifier_of_client's_account_,   "wallet":{      "balance":_state_of_MG_wallet_,      "credit":_overdraft_amount_,      "income":_total_replenish_sum_   }}
```

All sums tranfered in advertising agency currency

**Possible errors:**

If transferred current token is invalid, returned error is "invalid token";

If client id is incorrect returned answer is "Invalid client id".

 

### **Getting financial stats of advertising agency**

| **Method** | GET |
| --- | --- |
| **URL** | api.mgid.com/v1/agencies/{accountId} |
| **Headers** | Accept: application/json Authorization: Bearer {token} |

Transfered parameters:

| **Parameter** | **Value** |
| --- | --- |
| accountId | Identifier of user (advertising agency) account |

Returned answer:

```
{    "id":_identifier_of_user(advertising_agency)_account_,   "balance":{      "personal_account":_balance_on_main_wallet_,      "bonus_account":_balance_on_bonus_wallet_,      "clients_balance":_sum_of_cuurent_clients_balances_   }}
```

All sums tranfered in advertising agency currency.

**Possible errors:**

If transferred current token is invalid, returned error is "invalid token".

 

### **Getting data of advertising agency clients expences for a period**

| **Method** | GET |
| --- | --- |
| **URL** | api.mgid.com/v1/agencies/{accountId}/clients-spent-reports |
| **Headers** | Accept: application/json Authorization: Bearer {token} |

Transfered parameters:

| **Parameter** | **Value** |
| --- | --- |
| accountId | Identifier of user (advertising agency) account |
| dateStart | Period start date in format  YYYY-MM-DD |
| dateEnd | Period end date in format YYYY-MM-DD |
| clientsIds | Clients ids separated by commas, not nesessary parameter |

Returned answer:

```
{   dateStart:Period start date in format YYYY-MM-DD,   dateEnd:Period end date in format  YYYY-MM-DD,   clients-spent-reports:[      {         "id":_identifier_of_client's_account_,         "spent":_sum_of_expences_by_directions_(goodhits +news + banners)      },   ]}
```

All sums transfered in advertising agency currency.

If parameter clientsIds is empty, return expenses for all advertising agency clients.

**Possible errors:**

If the transferred current token is invalid, returned error is "invalid token";

If client id is incorrect returned answer is "Invalid client id";

Possible format errors of parameters: dates should be in the format of YYYY-MM-DD, clientsIds should be separated by commas.

 

### **Clients balance replenishments from advertising agency wallet**

| **Method** | POST |
| --- | --- |
| **URL** | api.mgid.com/v1/agencies/{accountId}/clients/{client\_id}/money-transfers?account\_type={account\_type}&transfer\_amount={transfer\_amount} |
| **Headers** | Accept: application/json Authorization: Bearer {token} |

Transfered parameters:

| **Parameter** | **Value** |
| --- | --- |
| accountId | Identifier of user (advertising agency) account |
| client\_id | Advertising agency client id |
| account\_type | Account used for filling up should be one of values: personal or bonus |
| transfer\_amount | Amount in advertising agency currency should be numeric |

Returned answer:

```
{    "idAuth":"_identifier_of_user's_account__",       "clientId":"_client_id_",      "status":"success",     "bonus\personal_account":"_accout_balance_",   bonus or personal based on incoming parameters,      "wallet":{       "balance":"_client's_account_balance_",   }}
```

All sums transfered in advertising agency currency.

**Possible errors:**

1\) If money on the specified account is not enough, the amount entered in the transferred data is larger than the specified purse, return the error "The amount of money in the account is less than what you are trying to transfer."

2\) If the transferred current token is invalid, returned error is "invalid token"

3\) If the client id is not in the system or curator is not this advertising agency, return error "Invalid client id"

4\) If the account, client, and the amount of remittances are empty, return the error "Account (client, amount) is not specified "

- [Advertisers](https://help.mgid.com/advertisers?hsLang=en#main-content)

    - [Get started with MGID Ads](https://help.mgid.com/advertisers?hsLang=en#get-started-with-mgid-ads)
    - [Campaign Setup & Management](https://help.mgid.com/advertisers?hsLang=en#campaign-setup-management)
    - [CPA Tune](https://help.mgid.com/advertisers?hsLang=en#cpa-tune)
    - [Conversion tracking: general](https://help.mgid.com/advertisers?hsLang=en#conversion-tracking-general)
    - [Tracking with MGID Pixel](https://help.mgid.com/advertisers?hsLang=en#tracking-with-mgid-pixel)
    - [Postback & Trackers](https://help.mgid.com/advertisers?hsLang=en#postback-trackers)
    - [Affiliate Networks Integration](https://help.mgid.com/advertisers?hsLang=en#affiliate-networks-integration)
    - [Webhook tracking method & Integrations](https://help.mgid.com/advertisers?hsLang=en#webhook-tracking-method-integrations)
    - [Native integrations](https://help.mgid.com/advertisers?hsLang=en#native-integrations)
    - [Ad Creatives Management](https://help.mgid.com/advertisers?hsLang=en#ad-creatives-management)
    - [Campaign Optimization & Performance](https://help.mgid.com/advertisers?hsLang=en#campaign-optimization-performance)
    - [FAQ](https://help.mgid.com/advertisers?hsLang=en#faq)
    - [MGID Video Guides](https://help.mgid.com/advertisers?hsLang=en#mgid-video-guides)
- [Publishers](https://help.mgid.com/publishers?hsLang=en#main-content)

    - [General](https://help.mgid.com/publishers?hsLang=en#general)
    - [Prohibited content and practices](https://help.mgid.com/publishers?hsLang=en#prohibited-content-and-practices)
    - [Types of integration](https://help.mgid.com/publishers?hsLang=en#types-of-integration)
    - [Compliance](https://help.mgid.com/publishers?hsLang=en#compliance)
    - [Payment](https://help.mgid.com/publishers?hsLang=en#payment)
    - [FAQ](https://help.mgid.com/publishers?hsLang=en#faq)
- [Ad Quality Policies and Creative Guidelines](https://help.mgid.com/ad-quality-policies-and-creative-guidelines?hsLang=en#main-content)

    - [Ad Approval & Compliance Guidelines](https://help.mgid.com/ad-quality-policies-and-creative-guidelines?hsLang=en#ad-approval-compliance-guidelines)
    - [Creative AI Hub](https://help.mgid.com/ad-quality-policies-and-creative-guidelines?hsLang=en#creative-ai-hub)
    - [Creative Hub](https://help.mgid.com/ad-quality-policies-and-creative-guidelines?hsLang=en#creative-hub)
    - [Compliance & Security](https://help.mgid.com/ad-quality-policies-and-creative-guidelines?hsLang=en#compliance-security)
- [Advertisers Super Client Account](https://help.mgid.com/advertisers-super-client-account?hsLang=en#main-content)

    - [Clients](https://help.mgid.com/advertisers-super-client-account?hsLang=en#clients)
- [Fraud Prevention](https://help.mgid.com/fraud-prevention?hsLang=en#main-content)

    - [Fraud Prevention](https://help.mgid.com/fraud-prevention?hsLang=en#fraud-prevention)
- [API](https://help.mgid.com/api?hsLang=en)
- [DSP](https://help.mgid.com/dsp?hsLang=en)
- [SSP](https://help.mgid.com/ssp?hsLang=en)

- [Advertisers](https://www.mgid.com/advertisers)
- [Publishers](https://www.mgid.com/publishers)
- [Contact Us](https://www.mgid.com/about#tabs-contactus)

[![Chill listening crop-3](https://help.mgid.com/hubfs/MGID_Logo_Icon_HC.svg "Chill listening crop-3")](https://www.mgid.com)

Native performance through innovation

<https://facebook.com/mgidglobal/> <https://twitter.com/mgid/> <https://www.linkedin.com/company/mgid-inc->

Copyright © 2026, MGID Inc.