diff --git a/website/docs/docs/dbt-cloud-apis/admin-api-use-cases-and-examples.md b/website/docs/docs/dbt-cloud-apis/admin-api-use-cases-and-examples.md new file mode 100644 index 00000000000..8d467810d06 --- /dev/null +++ b/website/docs/docs/dbt-cloud-apis/admin-api-use-cases-and-examples.md @@ -0,0 +1,69 @@ +--- +title: "Use cases and examples for the Admin API" +sidebar_label: "Uses and examples" +--- + +With the Admin API, you can administer your dbt Cloud account by accessing its endpoints. Use this API to replicate resources across projects, accounts, and environments, or standardize project creation. + +You can use this API in a variety of ways to get answers to your business questions. Answer these questions with the Admin API: + +* [How can I create Slack notifications for jobs?](#manage-slack-notifications) +* [How do I rotate account-scoped PATs?](#rotate-account-scoped-pat) +* [How do I invite a user to the account?](#invite-a-user-to-the-account) + +## Finding your account ID + + +## Managing Slack notifications + +You can use the Admin API to create Slack notifications for job successes, failures, or cancelations. + +1. Find the Slack channel ID at the bottom of the About page for a Slack channel. + + +2. From Terminal, run the following command: + +```bash +curl --request POST \ + --url https://cloud.getdbt.com/api/v2/accounts//notifications/ \ + --header 'Accept: application/json' \ + --header 'Authorization: Bearer ' \ + --header 'Content-Type: application/json' \ + --data '{ + "account_id": , + "user_id": , + "type": 2, + "external_email": "string", + "slack_channel_id": "string", + "slack_channel_name": "string", + "on_cancel": [ + 0 + ], + "on_failure": [ + , + + ], + "on_success": [ + , + + ], + "on_warning": [ + , + + ], + "state": 1 +}' + curl -X POST \ +``` + +## Rotating account-scoped PATs + +You can use the Admin API to rotate account-scoped PATs. + +## Inviting a user to the account + +You can use the Admin API to invite a user to the account. + +## Related docs + +- [dbt Cloud Admin API](/docs/dbt-cloud-apis/admin-cloud-api) diff --git a/website/docs/docs/dbt-cloud-apis/discovery-use-cases-and-examples.md b/website/docs/docs/dbt-cloud-apis/discovery-use-cases-and-examples.md index 1d83413b22d..b97fa03cce6 100644 --- a/website/docs/docs/dbt-cloud-apis/discovery-use-cases-and-examples.md +++ b/website/docs/docs/dbt-cloud-apis/discovery-use-cases-and-examples.md @@ -5,7 +5,7 @@ sidebar_label: "Uses and examples" With the Discovery API, you can query the metadata in to learn more about your dbt deployments and the data it generates to analyze them and make improvements. -You can use the API in a variety of ways to get answers to your business questions. Below describes some of the uses of the API and is meant to give you an idea of the questions this API can help you answer. +You can use the API to get answers to a variety of your business questions. Answer these questions with the Discovery API: | Use case | Outcome |
Example questions
| | --- | --- | --- | diff --git a/website/sidebars.js b/website/sidebars.js index 5ed16e3943e..ac0ebe1b1fd 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -753,6 +753,7 @@ const sidebarSettings = { link: { type: "doc", id: "docs/dbt-cloud-apis/admin-cloud-api" }, items: [ "docs/dbt-cloud-apis/admin-cloud-api", + "docs/dbt-cloud-apis/admin-api-use-cases-and-examples", { type: "link", label: "API v2",