> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mangopay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List all Users

> List User objects and key details

This endpoint returns key information for each user created by the platform.

### Query parameters

<ParamField query="page" type="integer">
  Start value: `1`

  **Default value:** `1`

  Indicates the index of the page for the pagination.
</ParamField>

<ParamField query="per_page" type="integer">
  Min. value: `1`; max. value: `100`

  **Default value:** `10`

  Indicates the number of items returned for each page of the pagination.
</ParamField>

<ParamField query="Sort" type="string">
  **Possible values:** `CreationDate:ASC`, `CreationDate:DESC`

  **Default value:** `CreationDate:ASC`

  Indicates the direction in which to sort the list.
</ParamField>

### Responses

<AccordionGroup>
  <Accordion title="200" defaultOpen>
    <ResponseField name="Array (Users)" type="array">
      The list of users created by the platform.

      <Expandable title="properties">
        <ResponseField name="Object (User)" type="object">
          The key information on the user created by the platform.

          <Expandable title="properties">
            <ResponseField name="Id" type="string">
              Max length: 128 characters (see [data formats](/api-reference/overview/data-formats) for details)

              The unique identifier of the object.
            </ResponseField>

            <ResponseField name="Tag" type="string">
              Max. length: 255 characters

              Custom data that you can add to this object.
            </ResponseField>

            <ResponseField name="CreationDate" type="Unix timestamp">
              The date and time at which the object was created.
            </ResponseField>

            <ResponseField name="PersonType" type="string">
              **Returned values:** NATURAL, LEGAL

              The type of the user:

              * `NATURAL` – Natural users are individuals (natural persons).
              * `LEGAL` – Legal users are legal entities (legal persons) like companies, non-profits, and sole proprietors.

              The `PersonType` is defined by the endpoint used to create the user and can’t be modified.
            </ResponseField>

            <ResponseField name="Email" type="string">
              Format: A valid email address

              The email address of the user.
            </ResponseField>

            <ResponseField name="KYCLevel" type="string">
              **Default value:** `LIGHT`

              **Returned values:** `LIGHT`, `REGULAR`

              The verification status of the user set by Mangopay:

              * `LIGHT` – Unverified, assigned by default to all users.
              * `REGULAR` – Verified, meaning the user has successfully completed the verification process and had the necessary documents validated by Mangopay. Only users whose `UserCategory` is `OWNER` can submit verification documents for validation. Only users whose `KYCLevel` is `REGULAR` can request payouts.
            </ResponseField>

            <ResponseField name="TermsAndConditionsAccepted" type="boolean">
              Whether the user has accepted Mangopay's terms and conditions (as defined by your contract, see the [T\&Cs guide](/guides/users/terms) for details).

              Must be `true` if `UserCategory` is `OWNER`.
            </ResponseField>

            <ResponseField name="TermsAndConditionsAcceptedDate" type="Unix timestamp">
              The date and time at which the `TermsAndConditionsAccepted` value was set to `true`.

              Returned `null` if `UserCategory` is `PAYER`.
            </ResponseField>

            <ResponseField name="UserCategory" type="string">
              **Possible values:** `PAYER`, `OWNER`, `PLATFORM`

              The [category](/guides/users/categories) of the user:

              * `PAYER` – User who can only make pay-ins to their wallets and transfers to other wallets (as well as refunds for pay-ins and transfers).
              * `OWNER` – User who can also receive transfers to their wallets. Owners are able to request [KYC verification](/guides/users/verification), which if successful gives them the `KYCLevel` of `REGULAR` and the ability to request payouts.
              * `PLATFORM` – Single specific user that represents the platform. The `PLATFORM` value is only assigned by Mangopay and may be used as part of the validated workflow implemented by the platform.
            </ResponseField>

            <ResponseField name="UserStatus" type="string">
              **Returned values:** ACTIVE, CLOSED

              Internal use only. This field can only be used and updated by Mangopay teams.
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Accordion>
</AccordionGroup>

<ResponseExample>
  ```json 200 theme={null}
  [ 
     {
         "Id": "158026537",
         "Tag": "Created using MANGOPAY API Collection Postman",
         "CreationDate": 1670863988,
         "PersonType": "LEGAL",
         "Email": "richard.moulin@email.com",
         "KYCLevel": "LIGHT",
         "TermsAndConditionsAccepted": false,
         "TermsAndConditionsAcceptedDate": null,
         "UserCategory": "PAYER",
         "UserStatus": "ACTIVE"
     },
     {
         "Id": "158025445",
         "Tag": "Created using MANGOPAY API Collection Postman",
         "CreationDate": 1670862022,
         "PersonType": "NATURAL",
         "Email": "email@test.com",
         "KYCLevel": "LIGHT",
         "TermsAndConditionsAccepted": true,
         "TermsAndConditionsAcceptedDate": 1670862022,
         "UserCategory": "OWNER",
         "UserStatus": "ACTIVE"
     },
     {
         "Id": "158026721",
         "Tag": "Created using MANGOPAY API Collection Postman",
         "CreationDate": 1670864174,
         "PersonType": "LEGAL",
         "Email": "cortney_douglas@yahoo.com",
         "KYCLevel": "REGULAR",
         "TermsAndConditionsAccepted": true,
         "TermsAndConditionsAcceptedDate": 1670864174,
         "UserCategory": "OWNER",
         "UserStatus": "ACTIVE"
     }
  ]  

  ```
</ResponseExample>

<RequestExample>
  ```json REST theme={null}
  // GET has no body parameters
  ```

  ```php PHP theme={null}
  <?php 

  require_once 'vendor/autoload.php';

  use MangoPay\MangoPayApi;
  use MangoPay\Libraries\ResponseException as MGPResponseException;
  use MangoPay\Libraries\Exception as MGPException;

  $api = new MangoPayApi();

  $api->Config->ClientId = 'your-client-id';
  $api->Config->ClientPassword = 'your-api-key';
  $api->Config->TemporaryFolder = 'tmp/';

  try {
      $response = $api->Users->GetAll();

      print_r($response);
  } catch(MGPResponseException $e) {
      print_r($e);
  } catch(MGPException $e) {
      print_r($e);
  }  
  ```

  ```javascript NodeJS   theme={null}
  const mangopayInstance = require('mangopay4-nodejs-sdk')
  const mangopay = new mangopayInstance({
    clientId: 'your-mangopay-client-id',
    clientApiKey: 'your-mangopay-api-key',
  })

  const listUsers = async () => {
    return await mangopay.Users.getAll()
      .then((response) => {
        console.info(response)
        return response
      })
      .catch((err) => {
        console.log(err)
        return false
      })
  }

  listUsers()  
  ```

  ```ruby Ruby   theme={null}
  require 'mangopay'

  MangoPay.configure do |client|
      client.preproduction = true
      client.client_id = 'your-client-id'
      client.client_apiKey = 'your-api-key'
      client.log_file = File.join(Dir.pwd, 'mangopay.log')
  end

  def listAllUsers()
      begin
          response = MangoPay::User.fetch()
          puts response
          return response
      rescue MangoPay::ResponseError => error
          puts "Failed to fetch Users #{error.message}"
          puts "Error details: #{error.details}"
          return false
      end
  end


  listAllUsers()  
  ```

  ```java Java   theme={null}
  import com.mangopay.MangoPayApi;
  import com.mangopay.core.Address;
  import com.mangopay.core.Pagination;
  import com.mangopay.core.Sorting;
  import com.mangopay.core.enumerations.SortDirection;
  import com.mangopay.entities.User;

  import java.lang.reflect.Field;
  import java.util.List;

  public class ListAllUsers {
      public static void main(String[] args) throws Exception {
          MangoPayApi mangopay = new MangoPayApi();
          mangopay.getConfig().setClientId("your-client-id");
          mangopay.getConfig().setClientPassword("your-api-key");
          
          Pagination pagination = new Pagination(1, 100);
          Sorting sort = new Sorting();
          sort.addField("CreationDate", SortDirection.desc);

          List<User> users = mangopay.getUserApi().getAll(pagination, sort);

          for (User user : users) {
              user = mangopay.getUserApi().get(user.getId());
              System.out.println("\nid: " + user.getId());
              printObjectFields(user);
          }
      }

      private static void printObjectFields(Object obj) {
          Class<?> objClass = obj.getClass();
          Field[] fields = objClass.getDeclaredFields();
          for (Field field : fields) {
              field.setAccessible(true);
              try {
                  Object value = field.get(obj);
                  if (value instanceof Address) {
                      System.out.println(field.getName() + ": ");
                      printObjectFields(value); 
                  } else {
                      System.out.println(field.getName() + ": " + value);
                  }
              } catch (IllegalAccessException e) {
                  e.printStackTrace();
              }
          }
      }
  }  
  ```

  ```python Python   theme={null}
  from pprint import pprint
  import mangopay

  mangopay.client_id = 'your-client-id'
  mangopay.apikey = 'your-api-key'

  from mangopay.api import APIRequest
  handler = APIRequest(sandbox=True)

  from mangopay.resources import User

  users = User.all(page=1, per_page=50) 

  for user in users:
      pprint(vars(user))  
  ```

  ```csharp .NET  theme={null}
  using MangoPay.SDK;
  using MangoPay.SDK.Entities;
  using Newtonsoft.Json;

  class Program
  {
      static async Task Main(string[] args)
      {
          MangoPayApi api = new MangoPayApi();

          api.Config.ClientId = "your-client-id";
          api.Config.ClientPassword = "your-api-key";

          var sort = new Sort();
          sort.AddField("CreationDate", SortDirection.desc);

          var users = await api.Users.GetAllAsync(new Pagination(1, 20), sort);

          string prettyPrint = JsonConvert.SerializeObject(users, Formatting.Indented);
          Console.WriteLine(prettyPrint);
      }
  }
  ```
</RequestExample>
