diff --git a/specs/account-management.openapi.yml b/specs/account-management.openapi.yml index 3cbb376..9c3ba26 100644 --- a/specs/account-management.openapi.yml +++ b/specs/account-management.openapi.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -399,7 +391,6 @@ paths: '404': $ref: '#/components/responses/NOT_FOUND' parameters: - - $ref: '#/components/parameters/account_id' - schema: type: integer format: int64 @@ -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 @@ -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 '{ @@ -587,7 +578,6 @@ paths: '404': $ref: '#/components/responses/NOT_FOUND' parameters: - - $ref: '#/components/parameters/account_id' - schema: type: integer format: int64 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 '{ @@ -763,8 +749,6 @@ paths: {"resource_type": "account", "resource_id": 3229, "access_level": 100} ] }' - parameters: - - $ref: '#/components/parameters/account_id' requestBody: required: true content: @@ -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 @@ -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': @@ -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': @@ -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 @@ -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': @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/specs/contacts.openapi.yml b/specs/contacts.openapi.yml index f0c9e85..4057a74 100644 --- a/specs/contacts.openapi.yml +++ b/specs/contacts.openapi.yml @@ -57,7 +57,7 @@ tags: x-page-description: Track contact interactions description: Manage contact events paths: - '/api/accounts/{account_id}/contacts': + '/api/contacts': post: operationId: createContact summary: Create a new Contact @@ -68,7 +68,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X POST https://mailtrap.io/api/accounts/{account_id}/contacts \ + curl -X POST https://mailtrap.io/api/contacts \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{ @@ -269,9 +269,7 @@ paths: $ref: '#/components/responses/LIMIT_EXCEEDED' '500': $ref: '#/components/responses/INTERNAL_ERROR' - parameters: - - $ref: '#/components/parameters/account_id' - '/api/accounts/{account_id}/contacts/{contact_identifier}': + '/api/contacts/{contact_identifier}': get: description: Get contact using UUID or email (URL encoded) operationId: getContact @@ -282,7 +280,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/contacts/{contact_identifier} \ + curl -X GET https://mailtrap.io/api/contacts/{contact_identifier} \ -H 'Authorization: Bearer YOUR_API_TOKEN' - lang: javascript label: Node.js @@ -417,7 +415,7 @@ paths: schema: $ref: '#/components/schemas/Contact_2' example: - $ref: '#/paths/~1api~1accounts~1%7Baccount_id%7D~1contacts/post/responses/201/content/application~1json/example' + $ref: '#/paths/~1api~1contacts/post/responses/201/content/application~1json/example' '401': $ref: '#/components/responses/UNAUTHENTICATED' '403': @@ -435,7 +433,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X PATCH https://mailtrap.io/api/accounts/{account_id}/contacts/{contact_identifier} \ + curl -X PATCH https://mailtrap.io/api/contacts/{contact_identifier} \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{"contact": { "email": "new@example.com", "fields": {"first_name": "John"}}}' @@ -575,7 +573,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X DELETE https://mailtrap.io/api/accounts/{account_id}/contacts/{contact_identifier} \ + curl -X DELETE https://mailtrap.io/api/contacts/{contact_identifier} \ -H 'Authorization: Bearer YOUR_API_TOKEN' - lang: javascript label: Node.js @@ -649,9 +647,8 @@ paths: '500': $ref: '#/components/responses/INTERNAL_ERROR' parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/contact_identifier' - '/api/accounts/{account_id}/contacts/{contact_identifier}/events': + '/api/contacts/{contact_identifier}/events': post: operationId: createContactEvent summary: Create contact event @@ -662,7 +659,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X POST https://mailtrap.io/api/accounts/{account_id}/contacts/{contact_identifier}/events \ + curl -X POST https://mailtrap.io/api/contacts/{contact_identifier}/events \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{"name": "UserLogin", "params": {"user_id": 101, "is_active": true}}' @@ -775,9 +772,8 @@ paths: '500': $ref: '#/components/responses/INTERNAL_ERROR' parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/contact_identifier' - '/api/accounts/{account_id}/contacts/exports': + '/api/contacts/exports': post: description: Create a new Contact Export operationId: createContactExport @@ -788,7 +784,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X POST https://mailtrap.io/api/accounts/{account_id}/contacts/exports \ + curl -X POST https://mailtrap.io/api/contacts/exports \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{"filters": [{"name": "list_id", "operator": "equal", "value": [1, 2]}]}' @@ -895,9 +891,7 @@ paths: $ref: '#/components/responses/LIMIT_EXCEEDED' '500': $ref: '#/components/responses/INTERNAL_ERROR' - parameters: - - $ref: '#/components/parameters/account_id' - '/api/accounts/{account_id}/contacts/exports/{export_id}': + '/api/contacts/exports/{export_id}': get: description: Get Contact Export operationId: getContactExport @@ -908,7 +902,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/contacts/exports/{export_id} \ + curl -X GET https://mailtrap.io/api/contacts/exports/{export_id} \ -H 'Authorization: Bearer YOUR_API_TOKEN' - lang: javascript label: Node.js @@ -993,9 +987,8 @@ paths: '500': $ref: '#/components/responses/INTERNAL_ERROR' parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/export_id' - '/api/accounts/{account_id}/contacts/imports': + '/api/contacts/imports': post: description: 'Import contacts in bulk with support for custom fields and list management. Existing contacts with matching email addresses will be updated automatically. You can import up to 50,000 contacts per request. The import process runs asynchronously - use the returned import ID to check the status and results.' operationId: importContacts @@ -1006,7 +999,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X POST https://mailtrap.io/api/accounts/{account_id}/contacts/imports \ + curl -X POST https://mailtrap.io/api/contacts/imports \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{"contacts": [{"email": "user1@example.com", "fields": {"first_name": "John"}, "list_ids_included": [1, 2]}]}' @@ -1139,9 +1132,7 @@ paths: - is invalid '500': $ref: '#/components/responses/INTERNAL_ERROR' - parameters: - - $ref: '#/components/parameters/account_id' - '/api/accounts/{account_id}/contacts/imports/{import_id}': + '/api/contacts/imports/{import_id}': get: description: Get Contact Import operationId: getContactImport @@ -1152,7 +1143,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/contacts/imports/{import_id} \ + curl -X GET https://mailtrap.io/api/contacts/imports/{import_id} \ -H 'Authorization: Bearer YOUR_API_TOKEN' - lang: javascript label: Node.js @@ -1239,9 +1230,8 @@ paths: '500': $ref: '#/components/responses/INTERNAL_ERROR' parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/import_id' - '/api/accounts/{account_id}/contacts/lists': + '/api/contacts/lists': get: description: Get all contact lists existing in your account operationId: contactLists @@ -1252,7 +1242,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/contacts/lists \ + curl -X GET https://mailtrap.io/api/contacts/lists \ -H 'Authorization: Bearer YOUR_API_TOKEN' - lang: javascript label: Node.js @@ -1344,7 +1334,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X POST https://mailtrap.io/api/accounts/{account_id}/contacts/lists \ + curl -X POST https://mailtrap.io/api/contacts/lists \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{"name": "Customers"}' @@ -1434,9 +1424,7 @@ paths: $ref: '#/components/responses/LIMIT_EXCEEDED' '500': $ref: '#/components/responses/INTERNAL_ERROR' - parameters: - - $ref: '#/components/parameters/account_id' - '/api/accounts/{account_id}/contacts/lists/{list_id}': + '/api/contacts/lists/{list_id}': get: description: Get a contact list by ID operationId: getContactList @@ -1447,7 +1435,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/contacts/lists/{list_id} \ + curl -X GET https://mailtrap.io/api/contacts/lists/{list_id} \ -H 'Authorization: Bearer YOUR_API_TOKEN' - lang: javascript label: Node.js @@ -1532,7 +1520,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X PATCH https://mailtrap.io/api/accounts/{account_id}/contacts/lists/{list_id} \ + curl -X PATCH https://mailtrap.io/api/contacts/lists/{list_id} \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{"name": "Former Customers"}' @@ -1636,7 +1624,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X DELETE https://mailtrap.io/api/accounts/{account_id}/contacts/lists/{list_id} \ + curl -X DELETE https://mailtrap.io/api/contacts/lists/{list_id} \ -H 'Authorization: Bearer YOUR_API_TOKEN' - lang: javascript label: Node.js @@ -1706,9 +1694,8 @@ paths: '500': $ref: '#/components/responses/INTERNAL_ERROR' parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/list_id' - '/api/accounts/{account_id}/contacts/fields': + '/api/contacts/fields': get: description: Get all Contact Fields existing in your account operationId: contactFields @@ -1719,7 +1706,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/contacts/fields \ + curl -X GET https://mailtrap.io/api/contacts/fields \ -H 'Authorization: Bearer YOUR_API_TOKEN' - lang: javascript label: Node.js @@ -1816,7 +1803,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X POST https://mailtrap.io/api/accounts/{account_id}/contacts/fields \ + curl -X POST https://mailtrap.io/api/contacts/fields \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{"name": "Company", "data_type": "text", "merge_tag": "company"}' @@ -1940,9 +1927,7 @@ paths: $ref: '#/components/responses/LIMIT_EXCEEDED' '500': $ref: '#/components/responses/INTERNAL_ERROR' - parameters: - - $ref: '#/components/parameters/account_id' - '/api/accounts/{account_id}/contacts/fields/{field_id}': + '/api/contacts/fields/{field_id}': get: description: Get a contact Field by ID operationId: getContactField @@ -1953,7 +1938,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/contacts/fields/{field_id} \ + curl -X GET https://mailtrap.io/api/contacts/fields/{field_id} \ -H 'Authorization: Bearer YOUR_API_TOKEN' - lang: javascript label: Node.js @@ -2020,7 +2005,7 @@ paths: schema: $ref: '#/components/schemas/ContactField' example: - $ref: '#/paths/~1api~1accounts~1%7Baccount_id%7D~1contacts~1fields/post/responses/201/content/application~1json/example' + $ref: '#/paths/~1api~1contacts~1fields/post/responses/201/content/application~1json/example' '401': $ref: '#/components/responses/UNAUTHENTICATED' '403': @@ -2042,7 +2027,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X PATCH https://mailtrap.io/api/accounts/{account_id}/contacts/fields/{field_id} \ + curl -X PATCH https://mailtrap.io/api/contacts/fields/{field_id} \ -H 'Authorization: Bearer YOUR_API_TOKEN' \ -H 'Content-Type: application/json' \ -d '{"name": "Updated Name", "merge_tag": "updated_name"}' @@ -2168,7 +2153,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X DELETE https://mailtrap.io/api/accounts/{account_id}/contacts/fields/{field_id} \ + curl -X DELETE https://mailtrap.io/api/contacts/fields/{field_id} \ -H 'Authorization: Bearer YOUR_API_TOKEN' - lang: javascript label: Node.js @@ -2249,7 +2234,6 @@ paths: '500': $ref: '#/components/responses/INTERNAL_ERROR' parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/field_id' components: securitySchemes: @@ -2807,16 +2791,6 @@ components: schema: $ref: '#/components/schemas/NotFoundResponse' parameters: - account_id: - description: Unique account ID - name: account_id - in: path - required: true - schema: - type: integer - format: int64 - minimum: 1 - example: 3229 contact_identifier: name: contact_identifier description: Contact UUID or Email diff --git a/specs/email-sending.openapi.yml b/specs/email-sending.openapi.yml index 3a30568..94ae3df 100644 --- a/specs/email-sending.openapi.yml +++ b/specs/email-sending.openapi.yml @@ -46,7 +46,7 @@ tags: description: List and retrieve email sending logs for the account. paths: - /api/accounts/{account_id}/sending_domains: + /api/sending_domains: post: summary: Create sending domain description: | @@ -64,7 +64,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X POST https://mailtrap.io/api/accounts/{account_id}/sending_domains \ + curl -X POST https://mailtrap.io/api/sending_domains \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ @@ -170,8 +170,6 @@ paths: .create(YOUR_ACCOUNT_ID, request); System.out.println(domain); - parameters: - - $ref: '#/components/parameters/account_id' requestBody: required: true content: @@ -214,7 +212,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/sending_domains \ + curl -X GET https://mailtrap.io/api/sending_domains \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -310,8 +308,6 @@ paths: domains.forEach(domain -> System.out.println("Domain: " + domain.getDomainName()) ); - parameters: - - $ref: '#/components/parameters/account_id' responses: '200': $ref: '#/components/responses/SendingDomainsResponse' @@ -319,7 +315,7 @@ paths: $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' - /api/accounts/{account_id}/sending_domains/{sending_domain_id}: + /api/sending_domains/{sending_domain_id}: get: summary: Get sending domain description: Get details and verification status of a specific sending domain @@ -330,7 +326,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/sending_domains/{sending_domain_id} \ + curl -X GET https://mailtrap.io/api/sending_domains/{sending_domain_id} \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -425,7 +421,6 @@ paths: System.out.println("Domain: " + domain.getDomainName()); parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/sending_domain_id' responses: '200': @@ -447,7 +442,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X DELETE https://mailtrap.io/api/accounts/{account_id}/sending_domains/{sending_domain_id} \ + curl -X DELETE https://mailtrap.io/api/sending_domains/{sending_domain_id} \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -538,7 +533,6 @@ paths: System.out.println("Domain deleted successfully"); parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/sending_domain_id' responses: '204': @@ -561,7 +555,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X PATCH https://mailtrap.io/api/accounts/{account_id}/sending_domains/{sending_domain_id} \ + curl -X PATCH https://mailtrap.io/api/sending_domains/{sending_domain_id} \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ @@ -572,7 +566,6 @@ paths: } }' parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/sending_domain_id' requestBody: required: true @@ -602,7 +595,7 @@ paths: '422': $ref: '#/components/responses/UnprocessableEntity' - /api/accounts/{account_id}/sending_domains/{sending_domain_id}/send_setup_instructions: + /api/sending_domains/{sending_domain_id}/send_setup_instructions: post: summary: Send setup instructions description: Email DNS configuration instructions for the sending domain @@ -613,7 +606,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X POST https://mailtrap.io/api/accounts/{account_id}/sending_domains/{sending_domain_id}/send_setup_instructions \ + curl -X POST https://mailtrap.io/api/sending_domains/{sending_domain_id}/send_setup_instructions \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ @@ -731,7 +724,6 @@ paths: System.out.println("Setup instructions sent"); parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/sending_domain_id' requestBody: required: true @@ -760,7 +752,7 @@ paths: '422': $ref: '#/components/responses/UnprocessableEntity' - /api/accounts/{account_id}/sending_domains/{sending_domain_id}/company_info: + /api/sending_domains/{sending_domain_id}/company_info: get: summary: Get company info description: | @@ -772,10 +764,9 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/sending_domains/{sending_domain_id}/company_info \ + curl -X GET https://mailtrap.io/api/sending_domains/{sending_domain_id}/company_info \ -H 'Authorization: Bearer YOUR_API_KEY' parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/sending_domain_id' responses: '200': @@ -799,7 +790,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X POST https://mailtrap.io/api/accounts/{account_id}/sending_domains/{sending_domain_id}/company_info \ + curl -X POST https://mailtrap.io/api/sending_domains/{sending_domain_id}/company_info \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ @@ -817,7 +808,6 @@ paths: } }' parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/sending_domain_id' requestBody: required: true @@ -866,7 +856,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X PATCH https://mailtrap.io/api/accounts/{account_id}/sending_domains/{sending_domain_id}/company_info \ + curl -X PATCH https://mailtrap.io/api/sending_domains/{sending_domain_id}/company_info \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ @@ -876,7 +866,6 @@ paths: } }' parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/sending_domain_id' requestBody: required: true @@ -905,7 +894,7 @@ paths: '422': $ref: '#/components/responses/UnprocessableEntity' - /api/accounts/{account_id}/suppressions: + /api/suppressions: get: summary: List suppressions description: | @@ -920,11 +909,11 @@ paths: label: 'cURL' source: | # Get all suppressions - curl -X GET https://mailtrap.io/api/accounts/{account_id}/suppressions \ + curl -X GET https://mailtrap.io/api/suppressions \ -H 'Authorization: Bearer YOUR_API_KEY' # Search for specific email - curl -X GET 'https://mailtrap.io/api/accounts/{account_id}/suppressions?email=suppressed@example.com' \ + curl -X GET 'https://mailtrap.io/api/suppressions?email=suppressed@example.com' \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -1062,7 +1051,6 @@ paths: System.out.println("Email: " + filteredSuppression.getEmail()) ); parameters: - - $ref: '#/components/parameters/account_id' - name: email in: query description: Search for specific email address @@ -1095,7 +1083,7 @@ paths: $ref: '#/components/responses/Forbidden' '429': $ref: '#/components/responses/LIMIT_EXCEEDED' - /api/accounts/{account_id}/suppressions/{suppression_id}: + /api/suppressions/{suppression_id}: delete: summary: Delete suppression description: Remove an email from the suppression list to allow sending again @@ -1106,7 +1094,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X DELETE https://mailtrap.io/api/accounts/{account_id}/suppressions/{suppression_id} \ + curl -X DELETE https://mailtrap.io/api/suppressions/{suppression_id} \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -1204,7 +1192,6 @@ paths: System.out.println("Suppression removed: " + result.getEmail()); parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/suppression_id' responses: '200': @@ -1216,7 +1203,7 @@ paths: '404': $ref: '#/components/responses/NotFound' - '/api/accounts/{account_id}/stats': + '/api/stats': get: operationId: getAccountSendingStats summary: Get Sending Stats @@ -1227,7 +1214,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET 'https://mailtrap.io/api/accounts/{account_id}/stats?start_date=2025-01-01&end_date=2025-12-31' \ + curl -X GET 'https://mailtrap.io/api/stats?start_date=2025-01-01&end_date=2025-12-31' \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: ruby label: Ruby @@ -1239,7 +1226,6 @@ paths: puts "Stats: #{stats.get(start_date: '2026-01-01', end_date: '2026-01-31')}" parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/StartDateQueryFilter' - $ref: '#/components/parameters/EndDateQueryFilter' - $ref: '#/components/parameters/SendingDomainIDsQueryFilter' @@ -1261,7 +1247,7 @@ paths: $ref: '#/components/responses/Forbidden' '429': $ref: '#/components/responses/LIMIT_EXCEEDED' - '/api/accounts/{account_id}/stats/domains': + '/api/stats/domains': get: operationId: getAccountSendingStatsByDomains summary: Get Sending Stats by Domains @@ -1272,7 +1258,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET 'https://mailtrap.io/api/accounts/{account_id}/stats/domains?start_date=2025-01-01&end_date=2025-12-31' \ + curl -X GET 'https://mailtrap.io/api/stats/domains?start_date=2025-01-01&end_date=2025-12-31' \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: ruby label: Ruby @@ -1284,7 +1270,6 @@ paths: puts "Stats: #{stats.by_domain(start_date: '2026-01-01', end_date: '2026-01-31')}" parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/StartDateQueryFilter' - $ref: '#/components/parameters/EndDateQueryFilter' - $ref: '#/components/parameters/SendingDomainIDsQueryFilter' @@ -1315,7 +1300,7 @@ paths: $ref: '#/components/responses/Forbidden' '429': $ref: '#/components/responses/LIMIT_EXCEEDED' - '/api/accounts/{account_id}/stats/categories': + '/api/stats/categories': get: operationId: getAccountSendingStatsByCategories summary: Get Sending Stats by Categories @@ -1326,7 +1311,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET 'https://mailtrap.io/api/accounts/{account_id}/stats/categories?start_date=2025-01-01&end_date=2025-12-31' \ + curl -X GET 'https://mailtrap.io/api/stats/categories?start_date=2025-01-01&end_date=2025-12-31' \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: ruby label: Ruby @@ -1338,7 +1323,6 @@ paths: puts "Stats: #{stats.by_category(start_date: '2026-01-01', end_date: '2026-01-31')}" parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/StartDateQueryFilter' - $ref: '#/components/parameters/EndDateQueryFilter' - $ref: '#/components/parameters/SendingDomainIDsQueryFilter' @@ -1368,7 +1352,7 @@ paths: $ref: '#/components/responses/Forbidden' '429': $ref: '#/components/responses/LIMIT_EXCEEDED' - '/api/accounts/{account_id}/stats/email_service_providers': + '/api/stats/email_service_providers': get: operationId: getAccountSendingStatsByEmailServiceProviders summary: Get Sending Stats by Email Service Providers @@ -1379,7 +1363,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET 'https://mailtrap.io/api/accounts/{account_id}/stats/email_service_providers?start_date=2025-01-01&end_date=2025-12-31' \ + curl -X GET 'https://mailtrap.io/api/stats/email_service_providers?start_date=2025-01-01&end_date=2025-12-31' \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: ruby label: Ruby @@ -1391,7 +1375,6 @@ paths: puts "Stats: #{stats.by_email_service_provider(start_date: '2026-01-01', end_date: '2026-01-31')}" parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/StartDateQueryFilter' - $ref: '#/components/parameters/EndDateQueryFilter' - $ref: '#/components/parameters/SendingDomainIDsQueryFilter' @@ -1421,7 +1404,7 @@ paths: $ref: '#/components/responses/Forbidden' '429': $ref: '#/components/responses/LIMIT_EXCEEDED' - '/api/accounts/{account_id}/stats/date': + '/api/stats/date': get: operationId: getAccountSendingStatsByDate summary: Get Sending Stats by Date @@ -1432,7 +1415,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET 'https://mailtrap.io/api/accounts/{account_id}/stats/date?start_date=2025-01-01&end_date=2025-12-31' \ + curl -X GET 'https://mailtrap.io/api/stats/date?start_date=2025-01-01&end_date=2025-12-31' \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: ruby label: Ruby @@ -1444,7 +1427,6 @@ paths: puts "Stats: #{stats.by_date(start_date: '2026-01-01', end_date: '2026-01-31')}" parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/StartDateQueryFilter' - $ref: '#/components/parameters/EndDateQueryFilter' - $ref: '#/components/parameters/SendingDomainIDsQueryFilter' @@ -1476,7 +1458,7 @@ paths: '429': $ref: '#/components/responses/LIMIT_EXCEEDED' - /api/accounts/{account_id}/email_logs: + /api/email_logs: get: operationId: listEmailLogs summary: List email logs @@ -1490,10 +1472,9 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET -g 'https://mailtrap.io/api/accounts/{account_id}/email_logs?filters[sent_after]=2025-01-01T00:00:00Z&filters[sent_before]=2025-01-31T23:59:59Z&filters[to][operator]=ci_equal&filters[to][value]=recipient@example.com&filters[sending_domain_id][operator]=equal&filters[sending_domain_id][value][]=3938&filters[sending_domain_id][value][]=3939' \ + curl -X GET -g 'https://mailtrap.io/api/email_logs?filters[sent_after]=2025-01-01T00:00:00Z&filters[sent_before]=2025-01-31T23:59:59Z&filters[to][operator]=ci_equal&filters[to][value]=recipient@example.com&filters[sending_domain_id][operator]=equal&filters[sending_domain_id][value][]=3938&filters[sending_domain_id][value][]=3939' \ -H 'Authorization: Bearer YOUR_API_KEY' parameters: - - $ref: '#/components/parameters/account_id' - name: search_after in: query description: Cursor for the next page (message_id UUID from previous response next_page_cursor). @@ -1526,7 +1507,7 @@ paths: $ref: '#/components/responses/NotFound' '429': $ref: '#/components/responses/LIMIT_EXCEEDED' - /api/accounts/{account_id}/email_logs/{sending_message_id}: + /api/email_logs/{sending_message_id}: get: operationId: getEmailLogMessage summary: Get an email log message by ID @@ -1537,10 +1518,9 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET 'https://mailtrap.io/api/accounts/{account_id}/email_logs/{sending_message_id}' \ + curl -X GET 'https://mailtrap.io/api/email_logs/{sending_message_id}' \ -H 'Authorization: Bearer YOUR_API_KEY' parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/sending_message_id' responses: '200': @@ -1570,15 +1550,6 @@ components: description: Bearer token authentication parameters: - account_id: - name: account_id - in: path - required: true - description: Account ID - schema: - type: integer - example: 1 - sending_domain_id: name: sending_domain_id in: path diff --git a/specs/sandbox.openapi.yml b/specs/sandbox.openapi.yml index 0175477..266cefe 100644 --- a/specs/sandbox.openapi.yml +++ b/specs/sandbox.openapi.yml @@ -56,7 +56,7 @@ tags: description: Interactions with attachments paths: - '/api/accounts/{account_id}/inboxes': + '/api/inboxes': get: summary: Get a list of inboxes description: Get a list of inboxes. @@ -73,7 +73,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/inboxes \ + curl -X GET https://mailtrap.io/api/inboxes \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -162,9 +162,7 @@ paths: System.out.println(inboxes); operationId: getInboxes - parameters: - - $ref: '#/components/parameters/account_id' - '/api/accounts/{account_id}/projects': + '/api/projects': post: summary: Create project description: The project name is min 2 characters and max 100 characters long. @@ -196,7 +194,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X POST https://mailtrap.io/api/accounts/{account_id}/projects \ + curl -X POST https://mailtrap.io/api/projects \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ @@ -322,7 +320,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/projects \ + curl -X GET https://mailtrap.io/api/projects \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -421,9 +419,7 @@ paths: System.out.println("Project: " + project.getName() + ", ID: " + project.getId()); } - parameters: - - $ref: '#/components/parameters/account_id' - '/api/accounts/{account_id}/projects/{project_id}': + '/api/projects/{project_id}': get: summary: Get project by ID description: Get the project and its inboxes. @@ -443,7 +439,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/projects/{project_id} \ + curl -X GET https://mailtrap.io/api/projects/{project_id} \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -552,7 +548,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X PATCH https://mailtrap.io/api/accounts/{account_id}/projects/{project_id} \ + curl -X PATCH https://mailtrap.io/api/projects/{project_id} \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ @@ -708,7 +704,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X DELETE https://mailtrap.io/api/accounts/{account_id}/projects/{project_id} \ + curl -X DELETE https://mailtrap.io/api/projects/{project_id} \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -827,9 +823,8 @@ paths: $ref: '#/components/responses/NOT_FOUND' operationId: deleteProject parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/project_id' - '/api/accounts/{account_id}/projects/{project_id}/inboxes': + '/api/projects/{project_id}/inboxes': post: summary: Create an inbox description: Create an inbox in a project. @@ -863,7 +858,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X POST https://mailtrap.io/api/accounts/{account_id}/projects/{project_id}/inboxes \ + curl -X POST https://mailtrap.io/api/projects/{project_id}/inboxes \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ @@ -983,9 +978,8 @@ paths: System.out.println("Inbox created: " + inbox.getName()); System.out.println("SMTP credentials - User: " + inbox.getUsername()); parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/project_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}': + '/api/inboxes/{inbox_id}': get: summary: Get inbox attributes description: Get inbox attributes by inbox id. See the list of attributes in the example @@ -1004,7 +998,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id} \ + curl -X GET https://mailtrap.io/api/inboxes/{inbox_id} \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -1117,7 +1111,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X DELETE https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id} \ + curl -X DELETE https://mailtrap.io/api/inboxes/{inbox_id} \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -1245,7 +1239,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X PATCH https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id} \ + curl -X PATCH https://mailtrap.io/api/inboxes/{inbox_id} \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ @@ -1369,9 +1363,8 @@ paths: System.out.println(updatedInbox); operationId: updateInbox parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/inbox_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/clean': + '/api/inboxes/{inbox_id}/clean': patch: summary: Clean inbox description: Delete all messages (emails) from inbox. @@ -1390,7 +1383,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X PATCH https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id}/clean \ + curl -X PATCH https://mailtrap.io/api/inboxes/{inbox_id}/clean \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -1486,9 +1479,8 @@ paths: System.out.println(cleanedInbox); operationId: cleanInbox parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/inbox_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/all_read': + '/api/inboxes/{inbox_id}/all_read': patch: summary: Mark as read description: Mark all messages in the inbox as read. @@ -1507,7 +1499,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X PATCH https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id}/all_read \ + curl -X PATCH https://mailtrap.io/api/inboxes/{inbox_id}/all_read \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -1603,9 +1595,8 @@ paths: System.out.println(markedInbox); operationId: markAsReadInbox parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/inbox_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/reset_credentials': + '/api/inboxes/{inbox_id}/reset_credentials': patch: summary: Reset credentials description: Reset SMTP credentials of the inbox. @@ -1624,7 +1615,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X PATCH https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id}/reset_credentials \ + curl -X PATCH https://mailtrap.io/api/inboxes/{inbox_id}/reset_credentials \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -1720,9 +1711,8 @@ paths: System.out.println(updatedInbox); operationId: resetInboxCredentials parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/inbox_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/toggle_email_username': + '/api/inboxes/{inbox_id}/toggle_email_username': patch: summary: Enable email address description: Turn the email address of the inbox on/off. @@ -1741,7 +1731,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X PATCH https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id}/toggle_email_username \ + curl -X PATCH https://mailtrap.io/api/inboxes/{inbox_id}/toggle_email_username \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -1828,9 +1818,8 @@ paths: System.out.println(updatedInbox); operationId: enableInboxEmailAddresses parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/inbox_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/reset_email_username': + '/api/inboxes/{inbox_id}/reset_email_username': patch: summary: Reset email address description: Reset username of email address per inbox. @@ -1849,7 +1838,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X PATCH https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id}/reset_email_username \ + curl -X PATCH https://mailtrap.io/api/inboxes/{inbox_id}/reset_email_username \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -1937,9 +1926,8 @@ paths: System.out.println(updatedInbox); operationId: resetEmailUserNamePerInbox parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/inbox_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}': + '/api/inboxes/{inbox_id}/messages/{message_id}': get: summary: Show email message description: Get email message by ID. @@ -1999,7 +1987,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id} \ + curl -X GET https://mailtrap.io/api/inboxes/{inbox_id}/messages/{message_id} \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -2229,7 +2217,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X PATCH https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id} \ + curl -X PATCH https://mailtrap.io/api/inboxes/{inbox_id}/messages/{message_id} \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{"message": {"is_read": "true"}}' @@ -2456,7 +2444,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X DELETE https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id} \ + curl -X DELETE https://mailtrap.io/api/inboxes/{inbox_id}/messages/{message_id} \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -2562,10 +2550,9 @@ paths: System.out.println(deletedMessage); operationId: deleteInboxEmailMessage parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/inbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages': + '/api/inboxes/{inbox_id}/messages': get: summary: Get messages description: Get all messages in the inbox. The response contains up to 30 messages. Use `last_id` or `page` to retrieve more. @@ -2679,7 +2666,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id}/messages \ + curl -X GET https://mailtrap.io/api/inboxes/{inbox_id}/messages \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -2815,9 +2802,8 @@ paths: name: page description: Page number for paginated results. parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/inbox_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/forward': + '/api/inboxes/{inbox_id}/messages/{message_id}/forward': post: summary: Forward message description: Forward message to an email address. The email address must be confirmed by the recipient in advance. @@ -2862,7 +2848,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X POST https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/forward \ + curl -X POST https://mailtrap.io/api/inboxes/{inbox_id}/messages/{message_id}/forward \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{"email": "recipient@example.com"}' @@ -2983,10 +2969,9 @@ paths: System.out.println(forwardedMessage); operationId: forwardInboxEmailMessage parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/inbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/spam_report': + '/api/inboxes/{inbox_id}/messages/{message_id}/spam_report': get: summary: Get message spam score description: Get a brief spam report by message ID. @@ -3060,7 +3045,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/spam_report \ + curl -X GET https://mailtrap.io/api/inboxes/{inbox_id}/messages/{message_id}/spam_report \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -3144,10 +3129,9 @@ paths: System.out.println(spamReport); operationId: getInboxEmailMessageSpamReport parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/inbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/analyze': + '/api/inboxes/{inbox_id}/messages/{message_id}/analyze': get: summary: Get message HTML analysis description: Get a brief HTML report by message ID. @@ -3243,7 +3227,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/analyze \ + curl -X GET https://mailtrap.io/api/inboxes/{inbox_id}/messages/{message_id}/analyze \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -3325,10 +3309,9 @@ paths: System.out.println(htmlAnalysis); operationId: getInboxEmailMessageHTMLAnalysis parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/inbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/body.txt': + '/api/inboxes/{inbox_id}/messages/{message_id}/body.txt': get: summary: Get text message description: 'Get text email body, if it exists.' @@ -3375,7 +3358,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/body.txt \ + curl -X GET https://mailtrap.io/api/inboxes/{inbox_id}/messages/{message_id}/body.txt \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -3457,10 +3440,9 @@ paths: System.out.println(textBody); operationId: getInboxEmailMessageBodyAsTxt parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/inbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/body.raw': + '/api/inboxes/{inbox_id}/messages/{message_id}/body.raw': get: summary: Get raw message description: Get raw email body. @@ -3551,7 +3533,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/body.raw \ + curl -X GET https://mailtrap.io/api/inboxes/{inbox_id}/messages/{message_id}/body.raw \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -3633,10 +3615,9 @@ paths: System.out.println(rawBody); operationId: getInboxEmailMessageBodyAsRaw parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/inbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/body.htmlsource': + '/api/inboxes/{inbox_id}/messages/{message_id}/body.htmlsource': get: summary: Get message source description: Get HTML source of email. @@ -3706,7 +3687,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/body.htmlsource \ + curl -X GET https://mailtrap.io/api/inboxes/{inbox_id}/messages/{message_id}/body.htmlsource \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -3784,10 +3765,9 @@ paths: System.out.println(htmlSource); operationId: getInboxEmailMessageBodyAsHtmlSource parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/inbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/body.html': + '/api/inboxes/{inbox_id}/messages/{message_id}/body.html': get: summary: Get HTML message description: Get formatted HTML email body. Not applicable for plain text emails. @@ -3855,7 +3835,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/body.html \ + curl -X GET https://mailtrap.io/api/inboxes/{inbox_id}/messages/{message_id}/body.html \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -3938,10 +3918,9 @@ paths: System.out.println(htmlBody); operationId: getInboxEmailMessageBodyAsHtml parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/inbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/body.eml': + '/api/inboxes/{inbox_id}/messages/{message_id}/body.eml': get: summary: Get message as .eml description: Get email message in .eml format. @@ -4033,7 +4012,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/body.eml \ + curl -X GET https://mailtrap.io/api/inboxes/{inbox_id}/messages/{message_id}/body.eml \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -4115,10 +4094,9 @@ paths: System.out.println(emlContent); operationId: getInboxEmailMessageBodyAsEml parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/inbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/mail_headers': + '/api/inboxes/{inbox_id}/messages/{message_id}/mail_headers': get: summary: Get mail headers description: Get mail headers of a message @@ -4162,7 +4140,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/mail_headers \ + curl -X GET https://mailtrap.io/api/inboxes/{inbox_id}/messages/{message_id}/mail_headers \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -4242,10 +4220,9 @@ paths: System.out.println(mailHeaders); operationId: getMailHeadersOfEmailMessage parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/inbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/attachments': + '/api/inboxes/{inbox_id}/messages/{message_id}/attachments': get: summary: Get attachments description: Get message attachments by inbox_id and message_id. @@ -4326,7 +4303,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/attachments \ + curl -X GET https://mailtrap.io/api/inboxes/{inbox_id}/messages/{message_id}/attachments \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -4407,10 +4384,9 @@ paths: var attachments = client.testingApi().attachments().getAttachments(accountId, inboxId, messageId, null); parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/inbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}': + '/api/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}': get: summary: Get single attachment description: Get message single attachment by id. @@ -4482,7 +4458,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET https://mailtrap.io/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id} \ + curl -X GET https://mailtrap.io/api/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id} \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -4565,7 +4541,6 @@ paths: var client = MailtrapClientFactory.createMailtrapClient(config); var attachment = client.testingApi().attachments().getSingleAttachment(accountId, inboxId, messageId, attachmentId); parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/inbox_id' - $ref: '#/components/parameters/message_id' - $ref: '#/components/parameters/attachment_id' @@ -5134,16 +5109,6 @@ components: schema: $ref: '#/components/schemas/TestingInbox' parameters: - account_id: - description: Unique account ID - name: account_id - in: path - required: true - schema: - type: integer - format: int64 - minimum: 1 - example: 3229 inbox_id: description: Unique inbox ID name: inbox_id diff --git a/specs/templates.openapi.yml b/specs/templates.openapi.yml index 407e264..f82c5c3 100644 --- a/specs/templates.openapi.yml +++ b/specs/templates.openapi.yml @@ -28,7 +28,7 @@ tags: description: Create and manage reusable email templates with dynamic content. paths: - /api/accounts/{account_id}/email_templates: + /api/email_templates: get: description: Get all email templates existing in your account operationId: emailTemplates @@ -39,7 +39,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET "https://mailtrap.io/api/accounts/{account_id}/email_templates" \ + curl -X GET "https://mailtrap.io/api/email_templates" \ -H "Api-Token: YOUR_API_KEY" - lang: javascript label: Node.js @@ -130,7 +130,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X POST "https://mailtrap.io/api/accounts/{account_id}/email_templates" \ + curl -X POST "https://mailtrap.io/api/email_templates" \ -H "Api-Token: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ @@ -264,10 +264,8 @@ paths: $ref: '#/components/responses/Forbidden' '422': $ref: '#/components/responses/UnprocessableEntity' - parameters: - - $ref: '#/components/parameters/account_id' - /api/accounts/{account_id}/email_templates/{email_template_id}: + /api/email_templates/{email_template_id}: get: description: Get an email template by ID operationId: getEmailTemplate @@ -278,7 +276,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X GET "https://mailtrap.io/api/accounts/{account_id}/email_templates/{email_template_id}" \ + curl -X GET "https://mailtrap.io/api/email_templates/{email_template_id}" \ -H "Api-Token: YOUR_API_KEY" - lang: javascript label: Node.js @@ -356,7 +354,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X PATCH "https://mailtrap.io/api/accounts/{account_id}/email_templates/{email_template_id}" \ + curl -X PATCH "https://mailtrap.io/api/email_templates/{email_template_id}" \ -H "Api-Token: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ @@ -465,7 +463,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X DELETE "https://mailtrap.io/api/accounts/{account_id}/email_templates/{email_template_id}" \ + curl -X DELETE "https://mailtrap.io/api/email_templates/{email_template_id}" \ -H "Api-Token: YOUR_API_KEY" - lang: javascript label: Node.js @@ -529,7 +527,6 @@ paths: '404': $ref: '#/components/responses/NotFound' parameters: - - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/email_template_id' components: @@ -546,15 +543,6 @@ components: description: Bearer token authentication parameters: - account_id: - name: account_id - in: path - required: true - description: Account ID - schema: - type: integer - example: 1 - email_template_id: name: email_template_id in: path