# Retrieves Multitenant Mobile App Identifiers for a specific environment.

`GET /api/configuration/multitenant-mobile-app-identifier/environment/{environmentId}`

- **Success:** `200 OK`
- **Products:** Gladstone Admin Areas (`ADMIN`)
- **Features:** not restricted by feature

HTML version: [Retrieves Multitenant Mobile App Identifiers for a specific environment.](https://support.gladstonesoftware.cloud/reference/configuration/retrieves-multitenant-mobile-app-identifiers-for-a-specific-environment)

## Overview

Lists the multi-tenant mobile app identifiers linked to one environment. An **app bundle identifier** is the store-level identity of a white-label Gladstone mobile app — the value a published iOS or Android build reports about itself — and an environment is linked to the specific app *versions* it is allowed to serve. Use this to work out which app builds a given tenant environment supports.

The response is scoped to the link, not to the identifier: for each identifier you get only the versions that have been linked to **this** environment, never the identifier's full version history. An identifier with ten released versions of which two are linked to this environment reports two. For the unfiltered catalogue, use [Retrieves all multitenant mobile app identifiers](retrieves-all-multitenant-mobile-app-identifiers.md) instead — that endpoint also returns the OneSignal app id and each version's app secret, both of which are deliberately absent here.

Versions are omitted from the response unless you ask for them. `includeVersions` defaults to false, and when it is false `versions` comes back as an empty array rather than being left out — so an empty `versions` means either "you did not ask" or "none linked", and you cannot tell which without setting the flag.

The environment is identified by the path, not by your token, so this endpoint will report on an environment other than your own if you pass its id. An id with no matching environment is a `404`; an environment that exists but has no linked identifiers is a `200` with an empty array.

## Endpoint

`GET {base_url}/api/configuration/multitenant-mobile-app-identifier/environment/{environmentId}`

`{base_url}` is the environment URL issued to your integration. See [Authenticating with Gladstone APIs](../../guides/authenticating-with-gladstone-apis.md).

## Path parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `environmentId` | integer (int32) | Yes | The tenant environment whose linked app identifiers you want. Taken from the path rather than from your token, so it must be supplied explicitly and is not defaulted to your own environment. An id that matches no environment returns `404` with the body `The environment could not be found with the environment ID {environmentId}`; the check happens before any identifier lookup, so nothing else in your request is validated first. |

## Query parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `includeVersions` | boolean | No | Whether to populate the `versions` array on each identifier. **Defaults to `false`**, in which case `versions` is returned as an empty array rather than omitted — so leaving this out looks identical to an identifier with no linked versions. Set it to `true` whenever you need version detail. It is also a precondition for `versionSort`: supplying `versionSort` with this false or absent is rejected with `400` rather than ignored. |
| `versionSort` | string | No | Orders each identifier's `versions` array by `appVersion`. Accepts only `asc` or `desc`, compared case-insensitively; any other value is a `400`. Omit it and versions come back in no defined order. **Requires `includeVersions=true`** — sending it otherwise is a `400`, not a silent no-op. Sorting is by parsed version number, so `1.10.0` correctly sorts above `1.9.0`, but the two directions do not use the same comparison: `asc` orders on the parsed version alone and puts values that are not valid dotted-numeric versions first, while `desc` falls back to plain character comparison whenever either value fails to parse. If your version strings include a suffix such as `1.2.3-beta`, neither direction will order them the way you expect. |
| `appBundleIdSort` | string | No | Orders the identifiers themselves by `appBundleId`. Accepts only `asc` or `desc`, compared case-insensitively; any other value is a `400`. Omit it and the order is undefined. Unlike `versionSort`, this works independently of `includeVersions`. Sorting is a plain string comparison of the bundle id, not a version comparison. |

## Sample request

```bash title="cURL"
curl -X GET '{base_url}/api/configuration/multitenant-mobile-app-identifier/environment/{environmentId}' \
  -H 'Authorization: Bearer {accessToken}' \
  -H 'X-Use-SSO: true'
```

## Response fields

| Field | Type | Description |
|-------|------|-------------|
| `[].id` | integer (int32) | The identifier's own id, which the identifier and version management endpoints take in the path. It identifies the app bundle across all environments, not the link between this environment and that bundle — the link itself has no id exposed here. Each identifier appears at most once in the response, however many of its versions are linked. |
| `[].appBundleId` | string | The app bundle identifier as published to the app stores, for example a reverse-domain string. Required and at most 255 characters, and unique across the platform — the write endpoints reject a duplicate — so this is the safe field to match on rather than `id`. This is the value a mobile client reports about itself, which is how a build is tied back to its environment. |
| `[].versions` | array of object | The app versions of this identifier that are linked to the requested environment. **Always present and never null**, but empty unless you passed `includeVersions=true` — an empty array does not mean "no versions linked". Contains only the versions linked to this environment, not every version of the identifier. Order is undefined unless you pass `versionSort`. |
| `[].versions[].id` | integer (int32) | The version record's id, as taken by the version management endpoints in the path. Note it is the id of the version itself, not of the link between the version and this environment. |
| `[].versions[].appVersion` | string | The app version string as recorded when the version was created, required and at most 50 characters. Nothing validates its shape at write time, so it is only as consistent as whoever entered it; `versionSort` can only order it numerically when it parses as a dotted-numeric version. The version's app secret is **not** returned by this endpoint — use [Retrieves all multitenant mobile app identifiers](retrieves-all-multitenant-mobile-app-identifiers.md) if you need it. |

## Sample response

```json title="200 OK"
[
  {
    "id": 12345,
    "appBundleId": "string",
    "versions": [
      {
        "id": 12345,
        "appVersion": "string"
      }
    ]
  }
]
```

## Errors

| Status | Meaning | When |
|--------|---------|------|
| `200` | OK | Success. An environment with no linked identifiers returns `200` with an empty JSON array `[]`. |
| `400` | Bad request | `versionSort` is neither `asc` nor `desc`. Body: `versionSort must be 'asc' or 'desc'.` |
| `400` | Bad request | `appBundleIdSort` is neither `asc` nor `desc`. Body: `appBundleIdSort must be 'asc' or 'desc'.` |
| `400` | Bad request | `versionSort` was supplied without `includeVersions=true`. Body: `versionSort can only be used when includeVersions is true.` The parameter is rejected rather than ignored, so remove it or set the flag. |
| `404` | Not found | No environment exists with the supplied `environmentId`. Body: `The environment could not be found with the environment ID {environmentId}`. Note this is a genuine `404` for a missing environment — an environment that exists but has nothing linked returns `200` with `[]` instead. |
| `500` | Internal server error | An unexpected server-side failure reading the environment, its links or the identifiers. The response has no body. |
