> ## 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.

# createTenantApplication

> Creates a tenant-level OAuth machine application and returns its client secret.
The secret is shown only in this response and must be stored securely by the caller.



**mutation** `createTenantApplication(input: CreateTenantApplicationInput!): CreateTenantApplicationPayload!`

## Arguments

**`input`**: `CreateTenantApplicationInput!` (required)

Application name, tags, and access-catalog selections.

## Returns

`CreateTenantApplicationPayload!`

**`errors`**: `[CreateTenantApplicationError!]`

---

**`tenantApplicationCredentials`**: `TenantApplicationCredentials`

## Examples

```graphql Mutation
mutation CreateTenantApplication($input: CreateTenantApplicationInput!) {
  createTenantApplication(input: $input) {
    errors {
      __typename
      ... on GraphQlError {
        code
        details {
          __typename
        }
        message
      }
    }
    tenantApplicationCredentials {
      application {
        accessToken {
          __typename
        }
        apiSelectors
        audiences
        clientId
        createdAt
        createdBy
      }
      clientSecret
    }
  }
}
```

```json Variables
{
  "input": {
    "apiSelectors": [
      "string"
    ],
    "name": "string",
    "resourceSelectors": [
      "string"
    ],
    "scopeKeys": [
      "string"
    ],
    "tags": [
      "string"
    ]
  }
}
```

```json Response
{
  "data": {
    "createTenantApplication": {
      "errors": [
        {
          "__typename": "GraphQlError",
          "code": "string",
          "details": [
            {
              "__typename": "KeyValuePairOfStringAndString"
            }
          ],
          "message": "string"
        }
      ],
      "tenantApplicationCredentials": {
        "application": {
          "accessToken": {
            "__typename": "AccessToken"
          },
          "apiSelectors": [
            "string"
          ],
          "audiences": [
            "string"
          ],
          "clientId": "string",
          "createdAt": "value",
          "createdBy": "value"
        },
        "clientSecret": "string"
      }
    }
  }
}
```


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