|
| 1 | +--- |
| 2 | +title: 'How to use the Management API with API Clients' |
| 3 | +metaTitle: 'How to use the Management API with API Clients' |
| 4 | +description: 'Learn how to use the Management API with API Clients' |
| 5 | +sidebar_label: 'Management API in API Clients' |
| 6 | +completion_time: '5 min' |
| 7 | +community_section: true |
| 8 | +--- |
| 9 | + |
| 10 | +## Postman |
| 11 | + |
| 12 | +Postman is a popular API client with testing, collaboration, and automation features for working with REST APIs. |
| 13 | + |
| 14 | +### Prerequisites |
| 15 | + |
| 16 | +Before you begin, make sure you have: |
| 17 | +- A [Prisma Console account](https://console.prisma.io) |
| 18 | +- [Postman installed](https://www.postman.com/downloads/) |
| 19 | + |
| 20 | +### 1. Create an OAuth2 Application |
| 21 | + |
| 22 | +First, you'll need to register an OAuth2 application in Prisma Console: |
| 23 | + |
| 24 | +1. Navigate to [Prisma Console](https://console.prisma.io) and log in |
| 25 | +2. Click the **🧩 Integrations** tab in the left sidebar |
| 26 | +3. Under the "Published Applications" section, click **New Application** |
| 27 | +4. Fill in your application details: |
| 28 | + - **Name**: Postman API Client |
| 29 | + - **Description**: Brief description of your application *(Optional)* |
| 30 | + - **Redirect URI**: `https://oauth.pstmn.io/v1/callback` |
| 31 | +5. Click **Continue** |
| 32 | +6. **Important**: Copy your Client ID and Client Secret immediately and store them securely |
| 33 | + |
| 34 | +:::note |
| 35 | +The redirect URI `https://oauth.pstmn.io/v1/callback` is Postman's default callback URL when using the "Authorize using browser" option. |
| 36 | +::: |
| 37 | + |
| 38 | +### 2. Configure OAuth 2.0 in Postman |
| 39 | + |
| 40 | +Now you'll set up authentication in Postman: |
| 41 | + |
| 42 | +1. Open Postman and create a new HTTP request |
| 43 | +2. Set the request method to **POST** |
| 44 | +3. Set the URL to `https://api.prisma.io/v1/projects` |
| 45 | +4. Navigate to the **Authorization** tab |
| 46 | +5. Set **Auth Type** to **OAuth 2.0** |
| 47 | +6. Under **Configure New Token**, enter the following values: |
| 48 | + |
| 49 | +| Parameter | Value | |
| 50 | +| --- | --- | |
| 51 | +| Token Name | Management API Token | |
| 52 | +| Grant Type | Authorization Code | |
| 53 | +| Callback URL | `https://oauth.pstmn.io/v1/callback` | |
| 54 | +| Authorize in Browser | `true` *(checked)* | |
| 55 | +| Auth URL | `https://auth.prisma.io/authorize` | |
| 56 | +| Access Token URL | `https://auth.prisma.io/token` | |
| 57 | +| Client ID | `your-client-id` | |
| 58 | +| Client Secret | `your-client-secret` | |
| 59 | +| Scope | `workspace:admin` | |
| 60 | + |
| 61 | +7. Click **Get New Access Token** |
| 62 | +8. A browser window will open and have you complete the authorization flow |
| 63 | +9. Return to Postman and click **Use Token** to attach it to your request |
| 64 | +10. Verify that your new token appears under **Current Token** at the top of the Authorization tab |
| 65 | + |
| 66 | +### 3. Make your first request |
| 67 | + |
| 68 | +With authentication configured, you can now create a project: |
| 69 | + |
| 70 | +1. In the request body, select **raw** and **JSON** format |
| 71 | +2. Add the following JSON payload: |
| 72 | +```json |
| 73 | +{ |
| 74 | + "name": "My Postman Database", |
| 75 | + "region": "us-east-1" |
| 76 | +} |
| 77 | +``` |
| 78 | + |
| 79 | +3. Click **Send** |
| 80 | + |
| 81 | +You should receive a successful response confirming your project creation. |
| 82 | + |
| 83 | +## Insomnia |
| 84 | + |
| 85 | +Insomnia is an open-source API client with a clean interface for testing and debugging HTTP requests. |
| 86 | + |
| 87 | +### Prerequisites |
| 88 | + |
| 89 | +Before you begin, make sure you have: |
| 90 | +- A [Prisma Console account](https://console.prisma.io) |
| 91 | +- [Insomnia installed](https://insomnia.rest/download/) |
| 92 | + |
| 93 | +### 1. Create an OAuth2 Application |
| 94 | + |
| 95 | +First, you'll need to register an OAuth2 application in Prisma Console: |
| 96 | + |
| 97 | +1. Navigate to [Prisma Console](https://console.prisma.io) and log in |
| 98 | +2. Click the **🧩 Integrations** tab in the left sidebar |
| 99 | +3. Under the "Published Applications" section, click **New Application** |
| 100 | +4. Fill in your application details: |
| 101 | + - **Name**: Insomnia API Client |
| 102 | + - **Description**: Brief description of your application *(Optional)* |
| 103 | + - **Redirect URI**: `https://app.insomnia.rest/oauth/redirect` |
| 104 | +5. Click **Continue** |
| 105 | +6. **Important**: Copy your Client ID and Client Secret immediately and store them securely |
| 106 | + |
| 107 | +:::note |
| 108 | +Insomnia uses `https://app.insomnia.rest/oauth/redirect` as the default OAuth callback URL for local authentication flows. |
| 109 | +::: |
| 110 | + |
| 111 | +### 2. Configure OAuth 2.0 in Insomnia |
| 112 | + |
| 113 | +Now you'll set up authentication in Insomnia: |
| 114 | + |
| 115 | +1. Open Insomnia and create a new HTTP request |
| 116 | +2. Set the request method to **POST** |
| 117 | +3. Set the URL to `https://api.prisma.io/v1/projects` |
| 118 | +4. Navigate to the **Auth** tab |
| 119 | +5. Set the authentication type to **OAuth 2.0** |
| 120 | +6. Under **Configuration**, enter the following values: |
| 121 | + |
| 122 | +| Parameter | Value | |
| 123 | +| --- | --- | |
| 124 | +| Grant Type | Authorization Code | |
| 125 | +| Authorization URL | `https://auth.prisma.io/authorize` | |
| 126 | +| Access Token URL | `https://auth.prisma.io/token` | |
| 127 | +| Client ID | `your-client-id` | |
| 128 | +| Client Secret | `your-client-secret` | |
| 129 | +| Redirect URL | `https://app.insomnia.rest/oauth/redirect` | |
| 130 | +| Scope *(Under Advanced Options)* | `workspace:admin` | |
| 131 | + |
| 132 | +7. Click **Fetch Tokens** |
| 133 | +8. A browser window will open and have you complete the authorization flow |
| 134 | +9. Return to Insomnia and verify that the access token has been retrieved |
| 135 | +10. The token will be automatically attached to your requests |
| 136 | + |
| 137 | +### 3. Make your first request |
| 138 | + |
| 139 | +With authentication configured, you can now create a project: |
| 140 | + |
| 141 | +1. Navigate to the **Body** tab and select **JSON** format |
| 142 | +2. Add the following JSON payload: |
| 143 | +```json |
| 144 | +{ |
| 145 | + "name": "My Insomnia Database", |
| 146 | + "region": "us-east-1" |
| 147 | +} |
| 148 | +``` |
| 149 | + |
| 150 | +3. Click **Send** |
| 151 | + |
| 152 | +You should receive a successful response confirming your project creation. |
| 153 | + |
| 154 | +## Yaak |
| 155 | + |
| 156 | +Yaak is a lightweight, native API client focused on speed and a minimal interface. |
| 157 | + |
| 158 | +### Prerequisites |
| 159 | + |
| 160 | +Before you begin, make sure you have: |
| 161 | +- A [Prisma Console account](https://console.prisma.io) |
| 162 | +- [Yaak installed](https://yaak.app) |
| 163 | + |
| 164 | +### 1. Create a service token |
| 165 | + |
| 166 | +First, you'll need to generate a service token from Prisma Console: |
| 167 | + |
| 168 | +1. Navigate to [Prisma Console](https://console.prisma.io) and log in |
| 169 | +2. Select your workspace |
| 170 | +3. Go to **Settings → Service Tokens** |
| 171 | +4. Click **New Service Token** |
| 172 | +5. **Important**: Copy the generated token immediately and store it securely |
| 173 | + |
| 174 | +### 2. Configure authentication in Yaak |
| 175 | + |
| 176 | +Now you'll set up authentication in Yaak: |
| 177 | + |
| 178 | +1. Open Yaak and create a new HTTP request |
| 179 | +2. Set the request method to **POST** |
| 180 | +3. Set the URL to `https://api.prisma.io/v1/projects` |
| 181 | +4. Navigate to the **Headers** tab |
| 182 | +5. Add the following headers: |
| 183 | + |
| 184 | +| Header Name | Value | |
| 185 | +| --- | --- | |
| 186 | +| Authorization | `Bearer your-service-token` | |
| 187 | +| Content-Type | `application/json` | |
| 188 | + |
| 189 | +:::note |
| 190 | +Replace `your-service-token` with the service token you generated in step 1. You can use Yaak's secure variable feature by clicking the **secure** option when entering the token value. |
| 191 | +::: |
| 192 | + |
| 193 | +### 3. Make your first request |
| 194 | + |
| 195 | +With authentication configured, you can now create a project: |
| 196 | + |
| 197 | +1. Navigate to the **Body** tab and select **JSON** format |
| 198 | +2. Add the following JSON payload: |
| 199 | +```json |
| 200 | +{ |
| 201 | + "name": "My Yaak Database", |
| 202 | + "region": "us-east-1" |
| 203 | +} |
| 204 | +``` |
| 205 | + |
| 206 | +3. Click **Send** |
| 207 | + |
| 208 | +You should receive a successful response confirming your project creation. |
0 commit comments