# List your students’ applications in this organization

- Endpoint: `GET /v1/{organizationId}/application`
- Production: `https://api.main-team.org/v1/{organizationId}/application`
- Sandbox: `https://apisnd.main-team.org/v1/{organizationId}/application`
- Operation: `listApplications` (Applications)
- Authentication: `Authorization: Bearer <token>`, a short-lived token you sign with your API key and secret
- Permission: `application/read:$org:$ID`

## Description

Lists the applications of your students in this organization, with `exam`, `payment` and the student (`user`) resolved into records. Inside `exam`, `session`, `category` and `language` stay ids. Applications for closed and past exams are included.

A page at a time: `limit` is 20 by default and at most 100. No order is guaranteed, so to take a complete snapshot walk every page and remove duplicates by `_id`.

Your students are the ones your account registered. A student appears here only while they are activated for this organization (their `activatedPlatformsThisSeason` lists its slug or `common`) and once they have signed in to it. An application of a student no longer activated here is left out of this list, though `listStudentApplications` and `getApplication` still return it.

Match a row to your records by `user.mainId`, the id you registered the student with; `user._id` is the organization’s own id for them.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `organizationId` | path | yes | string | The organization’s `_id`: 24 hexadecimal digits, as `listOrganizations` (`GET /v1/organization`) lists it. |
| `page` | query | no | number | Page number. Defaults to 1. |
| `limit` | query | no | number | Items per page. Defaults to 20, max 100. |

## Response

`200` Success: `message` is "Applications fetched successfully.".

```json
{
  "success": true,
  "message": "Applications fetched successfully.",
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 57,
    "totalPages": 3
  },
  "data": [
    {
      "_id": "6650a1b2c3d4e5f6a7b8c9e5",
      "exam": {
        "_id": "6650a1b2c3d4e5f6a7b8c9e1",
        "session": "6650a1b2c3d4e5f6a7b8c9e2",
        "category": "6650a1b2c3d4e5f6a7b8c9e3",
        "language": "6650a1b2c3d4e5f6a7b8c9e4",
        "grades": [
          "6650a1b2c3d4e5f6a7b8c9d4"
        ],
        "countries": [],
        "examType": "standard",
        "examTime": 75,
        "duration": 15,
        "questionCount": 30,
        "price": 25,
        "preventApplication": false,
        "createdAt": "2026-09-01T09:30:00.000Z",
        "updatedAt": "2026-09-02T14:05:00.000Z"
      },
      "user": {
        "_id": "6650a1b2c3d4e5f6a7b8c9e9",
        "mainId": "6650a1b2c3d4e5f6a7b8c9d0",
        "firstName": "Jane",
        "lastName": "Doe"
      },
      "payment": {
        "_id": "6650a1b2c3d4e5f6a7b8c9e6",
        "status": "pending",
        "amount": 25,
        "application": "6650a1b2c3d4e5f6a7b8c9e5",
        "exam": "6650a1b2c3d4e5f6a7b8c9e1",
        "for": "6650a1b2c3d4e5f6a7b8c9e9",
        "createdAt": "2026-09-01T09:30:00.000Z",
        "updatedAt": "2026-09-02T14:05:00.000Z"
      },
      "partners": [
        {
          "user": "6650a1b2c3d4e5f6a7b8c9d6",
          "accepted": true
        }
      ],
      "participated": false,
      "examStart": "2026-11-14T10:04:12.000Z",
      "examSubmitted": false,
      "submitDate": "2026-11-14T11:12:40.000Z",
      "simulationStarted": false,
      "simulationStart": "2026-11-07T10:00:00.000Z",
      "simulationSubmitted": false,
      "removeAfter": "2026-09-02T14:05:00.000Z",
      "uuid": "a3f-09c-7e1",
      "createdAt": "2026-09-01T09:30:00.000Z",
      "updatedAt": "2026-09-02T14:05:00.000Z"
    }
  ]
}
```

## Errors

| Status | Code | When |
| --- | --- | --- |
| 401 | [`unauthorized`](https://hub.main-team.org/api/errors#unauthorized) | The token is missing or malformed, is not signed with your account’s `apiSecret`, breaks the `iat` and `exp` rules, has expired or been revoked, or its account is not active. All of these answer the same. |
| 403 | [`forbidden`](https://hub.main-team.org/api/errors#forbidden) | The token is valid, but no role on your account allows `application/read` on the organization in the path, or a role denies it. |
| 404 | [`not_found`](https://hub.main-team.org/api/errors#not_found) | `organizationId` is not the `_id` of an organization. |
| 429 | [`too_many_requests`](https://hub.main-team.org/api/errors#too_many_requests) | Your account has made more than 100 requests to this operation in the current 60-second window. Wait the seconds in `Retry-After` before sending again. |
| 500 | [`internal_error`](https://hub.main-team.org/api/errors#internal_error) | Something failed on our side. Retry later, and quote `request_id` if it goes on. |

## Code samples

### curl

```bash
# $TOKEN: a short-lived token you minted with your API key and secret
curl -sS 'https://api.main-team.org/v1/<organizationId>/application?page=1&limit=20' \
  -H "Authorization: Bearer $TOKEN"
```

### Node.js

```js
const token = process.env.TOKEN; // a short-lived token you minted with your API key and secret

const res = await fetch('https://api.main-team.org/v1/<organizationId>/application?page=1&limit=20', {
  headers: {
    Authorization: `Bearer ${token}`,
  },
});
const body = await res.json();
if (!res.ok) throw new Error(`${res.status} ${body.error.code}: ${body.error.message}`);
console.log(body.data, body.pagination);
```

### PHP

```php
<?php
$token = getenv('TOKEN'); // a short-lived token you minted with your API key and secret

$ch = curl_init('https://api.main-team.org/v1/<organizationId>/application?page=1&limit=20');
curl_setopt_array($ch, [
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . $token,
    ],
    CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
if ($response === false) {
    throw new RuntimeException(curl_error($ch));
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$body = json_decode($response, true);
if ($status >= 400) {
    $error = $body['error'];
    throw new RuntimeException("$status {$error['code']}: {$error['message']}");
}
print_r($body['data']);
print_r($body['pagination']);
```
