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

# tenantApplicationById

> Returns one tenant-level OAuth machine application owned by the current tenant.



**query** `tenantApplicationById(id: ID!): TenantApplication!`

## Arguments

**`id`**: `ID!` (required)

Global id of the tenant application (`TenantApplication.id`).

## Returns

`TenantApplication!`

**`accessToken`**: `AccessToken!`

Issues an access token for this application. Omit both arguments to target the tenant API and include all granted scopes.

**Arguments:**

- `audience`: `String` — Authorized API audience to target. Defaults to the current tenant API audience when omitted.
- `scopeKeys`: `[String!]` — Granted tenant capability scopes to include. Omit to include every scope granted to the application.

---

**`apiSelectors`**: `[String!]!`

Selected access-catalog keys that authorize destination APIs.

---

**`audiences`**: `[String!]!`

OAuth audiences this application may request. The tenant API audience is always included.

---

**`clientId`**: `String!`

OAuth client id used with the client credentials grant.

---

**`createdAt`**: `DateTime!`

When the application was created.

---

**`createdBy`**: `UUID`

Id of the user or application that created the item. Null if not recorded.

---

**`description`**: `String`

Human-readable purpose or usage notes supplied by the tenant.

---

**`etag`**: `Etag`

Version tag for optimistic concurrency. Pass back the value you last read when you change the item.

---

**`id`**: `ID!`

Global id of the tenant application. `tenantApplicationById`, `updateTenantApplication` and `deleteTenantApplication` take it.

---

**`lastModifiedAt`**: `DateTime!`

When the application configuration was last changed.

---

**`lastUpdatedBy`**: `UUID`

Id of the user or application that last changed the item. Null if not recorded.

---

**`name`**: `String!`

Unique display name within the tenant.

---

**`resourceSelectors`**: `[String!]!`

Occtoo-owned resource grants. `sources` allows every source; `source:{id}` grants one source.

---

**`scopeKeys`**: `[String!]!`

Granted capability keys selected from scope nodes in the access catalog.

---

**`tags`**: `[String!]!`

Tenant-defined labels used to organize the application.

## Examples

```graphql Query
query TenantApplicationById($id: ID!) {
  tenantApplicationById(id: $id) {
    accessToken {
      expiresIn
      token
    }
    apiSelectors
    audiences
    clientId
    createdAt
    createdBy
  }
}
```

```json Variables
{
  "id": "id"
}
```

```json Response
{
  "data": {
    "tenantApplicationById": {
      "accessToken": {
        "expiresIn": 1,
        "token": "string"
      },
      "apiSelectors": [
        "string"
      ],
      "audiences": [
        "string"
      ],
      "clientId": "string",
      "createdAt": "value",
      "createdBy": "value"
    }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.