Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 18 additions & 49 deletions specs/account-management.openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ servers:
tags:
- name: Accounts
x-page-title: Accounts
description: |
The Account ID is required when working with Account Management endpoints.

To find your Account ID, you can either:
- Use the endpoint below to list your accounts, or
- Find it in the UI under [Account Settings](https://mailtrap.io/settings/account)

- name: Account Accesses
x-page-title: Access Control
Expand Down Expand Up @@ -170,7 +164,7 @@ paths:
- 1000
'401':
$ref: '#/components/responses/UNAUTHENTICATED'
'/api/accounts/{account_id}/account_accesses':
'/api/account_accesses':
get:
operationId: getAllUsersInAccount
summary: List User & Invite account accesses
Expand All @@ -186,7 +180,7 @@ paths:
- lang: shell
label: 'cURL'
source: |
curl -X GET https://mailtrap.io/api/accounts/{account_id}/account_accesses \
curl -X GET https://mailtrap.io/api/account_accesses \
-H 'Authorization: Bearer YOUR_API_TOKEN'
- lang: javascript
label: Node.js
Expand Down Expand Up @@ -299,9 +293,7 @@ paths:
$ref: '#/components/responses/UNAUTHENTICATED'
'403':
$ref: '#/components/responses/PERMISSION_DENIED'
parameters:
- $ref: '#/components/parameters/account_id'
'/api/accounts/{account_id}/account_accesses/{account_access_id}':
'/api/account_accesses/{account_access_id}':
delete:
operationId: deleteAccountAccessById
summary: Remove account access
Expand All @@ -317,7 +309,7 @@ paths:
- lang: shell
label: 'cURL'
source: |
curl -X DELETE https://mailtrap.io/api/accounts/{account_id}/account_accesses/{account_access_id} \
curl -X DELETE https://mailtrap.io/api/account_accesses/{account_access_id} \
-H 'Authorization: Bearer YOUR_API_TOKEN'
- lang: javascript
label: Node.js
Expand Down Expand Up @@ -399,7 +391,6 @@ paths:
'404':
$ref: '#/components/responses/NOT_FOUND'
parameters:
- $ref: '#/components/parameters/account_id'
- schema:
type: integer
format: int64
Expand All @@ -409,7 +400,7 @@ paths:
in: path
description: Unique account access ID
required: true
'/api/accounts/{account_id}/account_accesses/{account_access_id}/permissions/bulk':
'/api/account_accesses/{account_access_id}/permissions/bulk':
put:
operationId: updateUserPermissions
summary: Manage user or token permissions
Expand All @@ -423,7 +414,7 @@ paths:
- lang: shell
label: 'cURL'
source: |
curl -X PUT https://mailtrap.io/api/accounts/{account_id}/account_accesses/{account_access_id}/permissions/bulk \
curl -X PUT https://mailtrap.io/api/account_accesses/{account_access_id}/permissions/bulk \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
Expand Down Expand Up @@ -587,7 +578,6 @@ paths:
'404':
$ref: '#/components/responses/NOT_FOUND'
parameters:
- $ref: '#/components/parameters/account_id'
- schema:
type: integer
format: int64
Expand All @@ -597,7 +587,7 @@ paths:
in: path
required: true
description: Unique account access ID
'/api/accounts/{account_id}/permissions/resources':
'/api/permissions/resources':
get:
operationId: getResources
summary: Get resources
Expand All @@ -608,7 +598,7 @@ paths:
- lang: shell
label: 'cURL'
source: |
curl -X GET https://mailtrap.io/api/accounts/{account_id}/permissions/resources \
curl -X GET https://mailtrap.io/api/permissions/resources \
-H 'Authorization: Bearer YOUR_API_TOKEN'
- lang: javascript
label: Node.js
Expand Down Expand Up @@ -716,9 +706,7 @@ paths:
$ref: '#/components/responses/UNAUTHENTICATED'
'403':
$ref: '#/components/responses/PERMISSION_DENIED'
parameters:
- $ref: '#/components/parameters/account_id'
'/api/accounts/{account_id}/api_tokens':
'/api/api_tokens':
get:
operationId: listApiTokens
summary: List API tokens
Expand All @@ -729,10 +717,8 @@ paths:
- lang: shell
label: cURL
source: |
curl -X GET https://mailtrap.io/api/accounts/{account_id}/api_tokens \
curl -X GET https://mailtrap.io/api/api_tokens \
-H 'Authorization: Bearer YOUR_API_TOKEN'
parameters:
- $ref: '#/components/parameters/account_id'
responses:
'200':
description: List of API tokens
Expand All @@ -754,7 +740,7 @@ paths:
- lang: shell
label: cURL
source: |
curl -X POST https://mailtrap.io/api/accounts/{account_id}/api_tokens \
curl -X POST https://mailtrap.io/api/api_tokens \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
Expand All @@ -763,8 +749,6 @@ paths:
{"resource_type": "account", "resource_id": 3229, "access_level": 100}
]
}'
parameters:
- $ref: '#/components/parameters/account_id'
requestBody:
required: true
content:
Expand All @@ -784,7 +768,7 @@ paths:
$ref: '#/components/responses/PERMISSION_DENIED'
'422':
$ref: '#/components/responses/UNPROCESSABLE_ENTITY'
'/api/accounts/{account_id}/api_tokens/{id}':
'/api/api_tokens/{id}':
get:
operationId: getApiToken
summary: Get API token
Expand All @@ -795,10 +779,9 @@ paths:
- lang: shell
label: cURL
source: |
curl -X GET https://mailtrap.io/api/accounts/{account_id}/api_tokens/{id} \
curl -X GET https://mailtrap.io/api/api_tokens/{id} \
-H 'Authorization: Bearer YOUR_API_TOKEN'
parameters:
- $ref: '#/components/parameters/account_id'
- $ref: '#/components/parameters/api_token_id'
responses:
'200':
Expand All @@ -821,10 +804,9 @@ paths:
- lang: shell
label: cURL
source: |
curl -X DELETE https://mailtrap.io/api/accounts/{account_id}/api_tokens/{id} \
curl -X DELETE https://mailtrap.io/api/api_tokens/{id} \
-H 'Authorization: Bearer YOUR_API_TOKEN'
parameters:
- $ref: '#/components/parameters/account_id'
- $ref: '#/components/parameters/api_token_id'
responses:
'204':
Expand All @@ -835,7 +817,7 @@ paths:
$ref: '#/components/responses/PERMISSION_DENIED'
'404':
$ref: '#/components/responses/NOT_FOUND'
'/api/accounts/{account_id}/api_tokens/{id}/reset':
'/api/api_tokens/{id}/reset':
post:
operationId: resetApiToken
summary: Reset API token
Expand All @@ -850,10 +832,9 @@ paths:
- lang: shell
label: cURL
source: |
curl -X POST https://mailtrap.io/api/accounts/{account_id}/api_tokens/{id}/reset \
curl -X POST https://mailtrap.io/api/api_tokens/{id}/reset \
-H 'Authorization: Bearer YOUR_API_TOKEN'
parameters:
- $ref: '#/components/parameters/account_id'
- $ref: '#/components/parameters/api_token_id'
responses:
'200':
Expand All @@ -870,7 +851,7 @@ paths:
$ref: '#/components/responses/NOT_FOUND'
'422':
$ref: '#/components/responses/UNPROCESSABLE_ENTITY'
'/api/accounts/{account_id}/billing/usage':
'/api/billing/usage':
get:
operationId: getAccountBillingUsage
summary: Get current billing cycle usage
Expand All @@ -881,7 +862,7 @@ paths:
- lang: shell
label: 'cURL'
source: |
curl -X GET https://mailtrap.io/api/accounts/{account_id}/billing/usage \
curl -X GET https://mailtrap.io/api/billing/usage \
-H 'Authorization: Bearer YOUR_API_TOKEN'
- lang: javascript
label: Node.js
Expand Down Expand Up @@ -1029,8 +1010,6 @@ paths:
$ref: '#/components/responses/UNAUTHENTICATED'
'403':
$ref: '#/components/responses/PERMISSION_DENIED'
parameters:
- $ref: '#/components/parameters/account_id'
'/api/organizations/{organization_id}/sub_accounts':
get:
operationId: getOrganizationSubAccounts
Expand Down Expand Up @@ -1488,16 +1467,6 @@ components:
format: int64
minimum: 1
example: 1001
account_id:
description: Unique account ID
name: account_id
in: path
required: true
schema:
type: integer
format: int64
minimum: 1
example: 3229
api_token_id:
description: API token ID
name: id
Expand Down
Loading
Loading