Publish teamsApp
Namespace: microsoft.graph
Important
APIs under the /beta
version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Publish an app to the Microsoft Teams app catalog.
Specifically, this API publishes the app to your organization's catalog (the tenant app catalog);
the created resource will have a distributionMethod property value of organization
.
The requiresReview property allows any user to submit an app for review by an administrator. Admins can approve or reject these apps via this API or the Microsoft Teams admin center.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permission Type | Permissions (from least to most privileged) |
---|---|
Delegated (work or school account) | AppCatalog.Submit, AppCatalog.ReadWrite.All, Directory.ReadWrite.All |
Delegated (personal Microsoft account) | Not supported |
Application | Not supported. |
HTTP request
POST /appCatalogs/teamsApps
To publish an app that requires a review:
POST /appCatalogs/teamsApps?requiresReview:{Boolean}
Query parameters
Property | Type | Description |
---|---|---|
requiresReview | Boolean | This optional query parameter triggers the app review process. Users with admin privileges can submit apps without triggering a review. If users want to request a review before publishing, they must set requiresReview to true . A user who has admin privileges can opt not to set requiresReview or set the value to false and the app will be considered approved and will publish instantly. |
Request headers
Header | Value |
---|---|
Authorization | Bearer {token}. Required. |
Content-Type | application/zip. Required. |
Request body
In the request body, include a Teams zip manifest payload. For details, see Create an app package.
Each app in the app catalog must have a unique manifest id
.
Response
If successful, this method returns a 200 OK
response code and a teamsApp object.
Examples
Example 1: Publish an app to the app catalog
Request
POST https://graph.microsoft.com/beta/appCatalogs/teamsApps
Content-type: application/zip
Content-length: 244
[Zip file containing a Teams app package]
For information about how to create a Microsoft Teams application zip file, see Create an app package.
Response
HTTP/1.1 201 Created
Content-Type: application/json
{
"id": "e3e29acb-8c79-412b-b746-e6c39ff4cd22",
"externalId": "b5561ec9-8cab-4aa3-8aa2-d8d7172e4311",
"name": "Test App",
"version": "1.0.0",
"distributionMethod": "organization"
}
Example 2: Upload a new application for review to an organization's app catalog
Request
POST https://graph.microsoft.com/beta/appCatalogs/teamsApps?requiresReview=true
Content-type: application/zip
Content-length: 244
Response
HTTP/1.1 201 Created
Location: https://graph.microsoft.com/beta/appCatalogs/teamsApps/e3e29acb-8c79-412b-b746-e6c39ff4cd22
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#appCatalogs/teamsApps/$entity",
"id": "e3e29acb-8c79-412b-b746-e6c39ff4cd22",
"externalId": "b5561ec9-8cab-4aa3-8aa2-d8d7172e4311",
"name": "Test App",
"version": "1.0.0",
"distributionMethod": "organization"
}
Example 3: Approve or reject an app pending review
Request
HTTP
PATCH https://graph.microsoft.com/beta/appCatalogs/teamsApps/a761ad07-22ef-4a53-9feb-2837c8ad4a84/appDefinitions/YTc2MWFkMDctMjJlZi00YTUzLTlmZWItMjgzN2M4YWQ0YTg0IyMxLjEuOCMjU3VibWl0dGVk
Content-type: application/json
If-Match: InFtSStsNVJHVWdzWUJRU2ZVWGp4RWc9PSI=
{
"publishingState":"published"
}
Response
HTTP/1.1 200 OK
Content-type: application/json
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#appCatalogs/teamsApps('a761ad07-22ef-4a53-9feb-2837c8ad4a84')/appDefinitions/$entity",
"id": "YTc2MWFkMDctMjJlZi00YTUzLTlmZWItMjgzN2M4YWQ0YTg0IyMxLjEuOCMjUHVibGlzaGVk",
"teamsAppId": "a761ad07-22ef-4a53-9feb-2837c8ad4a84",
"azureADAppId": null,
"displayName": "Ducks",
"version": "1.1.8",
"requiredResourceSpecificApplicationPermissions": [],
"publishingState": "published",
"shortdescription": "quaerat quasi magnam. slight change. 5",
"description": "Aliquid placeat animi debitis accusamus. Non perferendis ullam. Quis est consequuntur vitae provident. Sunt laudantium id aut. slight change 5",
"lastModifiedDateTime": null,
"createdBy": null
}