diff --git a/src/api/index.mdx b/src/api/index.mdx index cf5a7eaefc697..e0a3ca9cc87a5 100644 --- a/src/api/index.mdx +++ b/src/api/index.mdx @@ -15,4 +15,5 @@ The current version of the web API is known as **v0** and is considered to be in - [Permissions](/api/permissions/) - [Rate Limits](/api/ratelimits) - [Requests](/api/requests/) -- [Tutorial](/api/tutorial/) +- [Tutorial: Create and List Teams](/api/teams-tutorial/) +- [Tutorial: Create and Manage Projects](/api/projects-tutorial/) diff --git a/src/api/projects-tutorial.mdx b/src/api/projects-tutorial.mdx new file mode 100644 index 0000000000000..17785357dda32 --- /dev/null +++ b/src/api/projects-tutorial.mdx @@ -0,0 +1,42 @@ +--- +title: Create and Manage Projects with the Sentry API +sidebar_order: 8 +--- + +Intro text + +## Prerequisites + +- A Sentry account with an organization-level role of Admin or higher + +We recommend using a free [Sentry developer account](https://sentry.io/pricing/) for this tutorial. + +## Get an Sentry Authentication Token + +You must pass an authentication token along with your API calls to authenticate with Sentry. Auth tokens can be associated with a user or with an organization. We recommend using tokens associated with an organization when possible, because user tokens stop working once a user is removed from an organization. + +For this guide, we will generate an organization auth token by creating an internal integration. + +[Internal Integrations](/product/integrations/integration-platform/internal-integration/) can be used to create custom Sentry integrations for your organization. However, they can also be used as a tool to create and manage your organization auth tokens. + +1. Open [sentry.io](https://sentry.io/) + +1. Press "Settings" in the left menu to open the **Organization Settings** page. + +1. Press "Custom Integrations" in the left side panel to create a new internal integration and org-level auth token. + +1. Press the "Create New Integration" button. + +1. Make sure "Internal Integration" is selected in the modal and press "Next". + +1. Enter a name for your integration. + +1. Under "Permissions" select "Read & Write" in the "Organization" dropdown. + + Creating a new team requires an auth token with organization write permissions. Listing teams only requires read permissions. + +1. Press "Save Changes". + +1. Scroll down to the bottom of the page and copy the generated token under "Tokens". + + You'll need this token for all your future API calls. diff --git a/src/api/tutorial.mdx b/src/api/teams-tutorial.mdx similarity index 100% rename from src/api/tutorial.mdx rename to src/api/teams-tutorial.mdx diff --git a/src/gatsby/createPages/createApiReference.ts b/src/gatsby/createPages/createApiReference.ts index 5bc418e1de025..8a25b0302a595 100644 --- a/src/gatsby/createPages/createApiReference.ts +++ b/src/gatsby/createPages/createApiReference.ts @@ -12,7 +12,7 @@ export const createApiReference = async ({ const data = await getDataOrPanic( ` query { - allFile(filter: {absolutePath: {}, relativePath: {in: ["permissions.mdx", "auth.mdx", "index.mdx", "requests.mdx", "pagination.mdx", "ratelimits.mdx", "tutorial.mdx"]}, dir: {regex: "/api/"}}) { + allFile(filter: {absolutePath: {}, relativePath: {in: ["permissions.mdx", "auth.mdx", "index.mdx", "requests.mdx", "pagination.mdx", "ratelimits.mdx", "teams-tutorial.mdx", "projects-tutorial.mdx"]}, dir: {regex: "/api/"}}) { nodes { id childMarkdownRemark {