> For the complete documentation index, see [llms.txt](https://www.docpartner.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.docpartner.dev/en/api/mail-partner/credits.md).

# Credits

This request is used to retrieve your available email credit.

## URL

<mark style="color:red;">`GET`</mark> `https://api.mailpartner.fr/v1/me`

#### **Required Parameters**

<table><thead><tr><th width="142">Name</th><th>Value</th></tr></thead><tbody><tr><td><code>apiKey</code></td><td><a href="https://my.mailpartner.fr/dashboard/api">Your API key</a></td></tr></tbody></table>

#### Optional Parameters

<table><thead><tr><th width="142">Name</th><th>Value</th></tr></thead><tbody><tr><td><code>_format</code></td><td><code>json</code> or <code>xml</code></td></tr></tbody></table>

#### Requests

{% tabs %}
{% tab title="PHP" %}

```php
<?php
 
        // Prepare data for GET request
        $data = 'apiKey=YOUR_API_KEY';
 
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL,'https://api.mailpartner.fr/v1/me?'.$data);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_TIMEOUT, 10);
 
 
        $result = curl_exec($curl);
        curl_close($curl);
 
        // Process your response here
        echo $result;
?>
```

{% endtab %}

{% tab title="VB.net" %}

```vbnet
Imports System.IO
Imports System.Net
 
Module Module1
 
  Sub Main()
 
    Dim base_url As String = "https://api.mailpartner.fr/v1/"
    Dim apiKey As String = "YOUR_APIKEY"
 
    #check credits
    Dim url As String
    url = base_url & "me" & "?apiKey=" & apiKey
 
    Dim credits As String
    credits = apiRequest("GET", url, Nothing)
 
  End Sub
 
  Function apiRequest(method As String, url As String, parameters As String) As String
 
    Dim request As HttpWebRequest
    request = WebRequest.Create(url)
    request.Method = method
    request.Timeout = 10000   # timeout in ms
    request.ContentType = "application/json; charset=utf-8"
    request.ContentLength = 0
 
    #set POST data
    If Not String.IsNullOrEmpty(parameters) Then
      request.ContentLength = parameters.Length
      Using reqStream As StreamWriter = New StreamWriter(request.GetRequestStream())
        reqStream.Write(parameters)
      End Using
    End If
 
    #get response
    Dim returnValue As String = Nothing
    Using response As HttpWebResponse = request.GetResponse()
      If response.StatusCode = HttpStatusCode.OK Then
        Using resStream = response.GetResponseStream()
          If resStream IsNot Nothing Then
            Using reader As New StreamReader(resStream)
              returnValue = reader.ReadToEnd()
            End Using
          End If
        End Using
      End If
    End Using
    apiRequest = returnValue
 
  End Function
 
End Module
```

{% endtab %}

{% tab title="Python" %}

```python
# std
import logging
import json
from collections import OrderedDict
 
# 3p
import requests
 
API_KEY = "MY API KEY"
URL = "https://api.mailpartner.fr/v1"
 
class MailPartner():
    def get_balance(self):
		url = URL + "/me?apiKey=" + API_KEY
		r = requests.get(url)
		r_json = r.json()
		if r_json.get("success") == True:
			print(r_json)
			status = True
		else:
			print(r_json)
			status = False
		return status
```

{% endtab %}

{% tab title="cURL" %}

```
curl -H "Content-Type: application/json" -X GET  https://api.mailpartner.fr/v1/me?apiKey=xxx
```

{% endtab %}
{% endtabs %}

#### **Response**

{% tabs %}
{% tab title="json" %}
{% code fullWidth="true" %}

```json
{
    "success": true,
    "code": 200,
    "user": {
        "username": "exemple@email.com"
    },
    "credits": {
        "creditMail": 269082,
        "currency": "EUR",
        "balance": "10225.119"
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="xml" %}

```xml
<?xml version='1.0' encoding='UTF-8'?>
<result>
    <entry>true</entry>
    <entry>200</entry>
    <entry>
        <username>exemple@email.com</username>
    </entry>
    <entry>
        <entry>269070</entry>
        <entry>
            <![CDATA[EUR]]>
        </entry>
        <entry>
            <![CDATA[10224.688]]>
        </entry>
    </entry>
</result>
```

{% endtab %}
{% endtabs %}

#### **Error Codes**

| Response Code | Message               |
| ------------- | --------------------- |
| 10            | Invalid API key       |
| 200           | Everything went fine! |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.docpartner.dev/en/api/mail-partner/credits.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
