From 351e9c6940ece0e82ba0718469140ad248c8b701 Mon Sep 17 00:00:00 2001 From: Ivan Yurchanka Date: Mon, 4 May 2026 18:24:16 +0200 Subject: [PATCH 1/3] Replace Inboxes API with Sandboxes API --- specs/sandbox.openapi.yml | 378 +++++++++++++++++++------------------- 1 file changed, 189 insertions(+), 189 deletions(-) diff --git a/specs/sandbox.openapi.yml b/specs/sandbox.openapi.yml index 0175477..4a448d6 100644 --- a/specs/sandbox.openapi.yml +++ b/specs/sandbox.openapi.yml @@ -22,20 +22,20 @@ tags: x-page-description: Organize test environments description: Interactions with projects - - name: Sandboxes (Inboxes) - x-page-title: Sandboxes (Inboxes) - x-page-description: Manage test inboxes + - name: Sandboxes + x-page-title: Sandboxes + x-page-description: Manage test sandboxes description: | - Manage Sandboxes (Inboxes) for email testing. Capture and inspect emails without delivering them to real recipients. This is ideal for development, staging, and QA environments. + Manage Sandboxes for email testing. Capture and inspect emails without delivering them to real recipients. This is ideal for development, staging, and QA environments. ### Get your Sandbox ID - To use the Sandbox API, you need a Sandbox (Inbox) ID. You can get it in one of the following ways. + To use the Sandbox API, you need a Sandbox ID. You can get it in one of the following ways. - #### Option 1: From the inbox URL + #### Option 1: From the sandbox URL 1. Open your Sandbox in Mailtrap. - 2. Copy the ID from the inbox URL. + 2. Copy the ID from the sandbox URL. Example: - URL: https://mailtrap.io/sandboxes/2564102/settings @@ -43,7 +43,7 @@ tags: #### Option 2: Via the API - Use the `Get a list of inboxes` endpoint to retrieve all Sandboxes in your account. + Use the `Get a list of sandboxes` endpoint to retrieve all Sandboxes in your account. - name: Messages x-page-title: Messages @@ -56,12 +56,12 @@ tags: description: Interactions with attachments paths: - '/api/accounts/{account_id}/inboxes': + '/api/accounts/{account_id}/sandboxes': get: - summary: Get a list of inboxes - description: Get a list of inboxes. + summary: Get a list of sandboxes + description: Get a list of sandboxes. tags: - - Sandboxes (Inboxes) + - Sandboxes responses: '200': $ref: '#/components/responses/InboxesResponse' @@ -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/accounts/{account_id}/sandboxes \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -161,7 +161,7 @@ paths: .getInboxes(accountId); System.out.println(inboxes); - operationId: getInboxes + operationId: getSandboxes parameters: - $ref: '#/components/parameters/account_id' '/api/accounts/{account_id}/projects': @@ -307,7 +307,7 @@ paths: System.out.println(project); get: summary: Get a list of projects - description: List projects and their inboxes to which the API token has access. + description: List projects and their sandboxes to which the API token has access. tags: - Projects responses: @@ -426,7 +426,7 @@ paths: '/api/accounts/{account_id}/projects/{project_id}': get: summary: Get project by ID - description: Get the project and its inboxes. + description: Get the project and its sandboxes. tags: - Projects responses: @@ -701,7 +701,7 @@ paths: operationId: updateProject delete: summary: Delete project - description: Delete project and its inboxes. + description: Delete project and its sandboxes. tags: - Projects x-codeSamples: @@ -829,26 +829,26 @@ paths: parameters: - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/project_id' - '/api/accounts/{account_id}/projects/{project_id}/inboxes': + '/api/accounts/{account_id}/projects/{project_id}/sandboxes': post: - summary: Create an inbox - description: Create an inbox in a project. + summary: Create a sandbox + description: Create a sandbox in a project. tags: - - Sandboxes (Inboxes) + - Sandboxes requestBody: content: application/json: schema: type: object properties: - inbox: + sandbox: type: object properties: name: type: string example: - inbox: - name: My new inbox + sandbox: + name: My new sandbox responses: '200': $ref: '#/components/responses/InboxResponse' @@ -858,17 +858,17 @@ paths: $ref: '#/components/responses/PERMISSION_DENIED' '404': $ref: '#/components/responses/NOT_FOUND' - operationId: createInbox + operationId: createSandbox x-codeSamples: - 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/accounts/{account_id}/projects/{project_id}/sandboxes \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ - "inbox": { - "name": "My Test Inbox" + "sandbox": { + "name": "My Test Sandbox" } }' - lang: javascript @@ -985,12 +985,12 @@ paths: parameters: - $ref: '#/components/parameters/account_id' - $ref: '#/components/parameters/project_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}': + '/api/accounts/{account_id}/sandboxes/{sandbox_id}': get: - summary: Get inbox attributes - description: Get inbox attributes by inbox id. See the list of attributes in the example + summary: Get sandbox attributes + description: Get sandbox attributes by sandbox id. See the list of attributes in the example tags: - - Sandboxes (Inboxes) + - Sandboxes responses: '200': $ref: '#/components/responses/InboxResponse' @@ -1004,7 +1004,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/accounts/{account_id}/sandboxes/{sandbox_id} \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -1098,12 +1098,12 @@ paths: .getInboxAttributes(accountId, inboxId); System.out.println(inboxAttributes); - operationId: getInboxAttributes + operationId: getSandboxAttributes delete: - summary: Delete an inbox - description: Delete an inbox with all its emails. + summary: Delete a sandbox + description: Delete a sandbox with all its emails. tags: - - Sandboxes (Inboxes) + - Sandboxes responses: '200': $ref: '#/components/responses/InboxResponse' @@ -1117,7 +1117,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/accounts/{account_id}/sandboxes/{sandbox_id} \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -1209,19 +1209,19 @@ paths: .deleteInbox(ACCOUNT_ID, inboxId); System.out.println(deletedInbox); - operationId: deleteInbox + operationId: deleteSandbox patch: - summary: Update an inbox - description: 'Update inbox name, inbox email username.' + summary: Update a sandbox + description: 'Update sandbox name, sandbox email username.' tags: - - Sandboxes (Inboxes) + - Sandboxes requestBody: content: application/json: schema: type: object properties: - inbox: + sandbox: type: object properties: name: @@ -1229,8 +1229,8 @@ paths: email_username: type: string example: - inbox: - name: New Inbox Name + sandbox: + name: New Sandbox Name email_username: my-username responses: '200': @@ -1245,12 +1245,12 @@ 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/accounts/{account_id}/sandboxes/{sandbox_id} \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ - "inbox": { - "name": "Updated Inbox Name", + "sandbox": { + "name": "Updated Sandbox Name", "email_username": "new-username" } }' @@ -1367,16 +1367,16 @@ paths: .updateInbox(accountId, inboxId, updateRequest); System.out.println(updatedInbox); - operationId: updateInbox + operationId: updateSandbox parameters: - $ref: '#/components/parameters/account_id' - - $ref: '#/components/parameters/inbox_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/clean': + - $ref: '#/components/parameters/sandbox_id' + '/api/accounts/{account_id}/sandboxes/{sandbox_id}/clean': patch: - summary: Clean inbox - description: Delete all messages (emails) from inbox. + summary: Clean sandbox + description: Delete all messages (emails) from sandbox. tags: - - Sandboxes (Inboxes) + - Sandboxes responses: '200': $ref: '#/components/responses/InboxResponse' @@ -1390,7 +1390,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/accounts/{account_id}/sandboxes/{sandbox_id}/clean \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -1484,16 +1484,16 @@ paths: .cleanInbox(accountId, inboxId); System.out.println(cleanedInbox); - operationId: cleanInbox + operationId: cleanSandbox parameters: - $ref: '#/components/parameters/account_id' - - $ref: '#/components/parameters/inbox_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/all_read': + - $ref: '#/components/parameters/sandbox_id' + '/api/accounts/{account_id}/sandboxes/{sandbox_id}/all_read': patch: summary: Mark as read - description: Mark all messages in the inbox as read. + description: Mark all messages in the sandbox as read. tags: - - Sandboxes (Inboxes) + - Sandboxes responses: '200': $ref: '#/components/responses/InboxResponse' @@ -1507,7 +1507,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/accounts/{account_id}/sandboxes/{sandbox_id}/all_read \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -1601,16 +1601,16 @@ paths: .markAsRead(accountId, inboxId); System.out.println(markedInbox); - operationId: markAsReadInbox + operationId: markAsReadSandbox parameters: - $ref: '#/components/parameters/account_id' - - $ref: '#/components/parameters/inbox_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/reset_credentials': + - $ref: '#/components/parameters/sandbox_id' + '/api/accounts/{account_id}/sandboxes/{sandbox_id}/reset_credentials': patch: summary: Reset credentials - description: Reset SMTP credentials of the inbox. + description: Reset SMTP credentials of the sandbox. tags: - - Sandboxes (Inboxes) + - Sandboxes responses: '200': $ref: '#/components/responses/InboxResponse' @@ -1624,7 +1624,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/accounts/{account_id}/sandboxes/{sandbox_id}/reset_credentials \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -1718,16 +1718,16 @@ paths: .resetCredentials(accountId, inboxId); System.out.println(updatedInbox); - operationId: resetInboxCredentials + operationId: resetSandboxCredentials parameters: - $ref: '#/components/parameters/account_id' - - $ref: '#/components/parameters/inbox_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/toggle_email_username': + - $ref: '#/components/parameters/sandbox_id' + '/api/accounts/{account_id}/sandboxes/{sandbox_id}/toggle_email_username': patch: summary: Enable email address - description: Turn the email address of the inbox on/off. + description: Turn the email address of the sandbox on/off. tags: - - Sandboxes (Inboxes) + - Sandboxes responses: '200': $ref: '#/components/responses/InboxResponse' @@ -1741,7 +1741,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/accounts/{account_id}/sandboxes/{sandbox_id}/toggle_email_username \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -1826,16 +1826,16 @@ paths: .enableEmailAddress(accountId, inboxId); System.out.println(updatedInbox); - operationId: enableInboxEmailAddresses + operationId: enableSandboxEmailAddresses parameters: - $ref: '#/components/parameters/account_id' - - $ref: '#/components/parameters/inbox_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/reset_email_username': + - $ref: '#/components/parameters/sandbox_id' + '/api/accounts/{account_id}/sandboxes/{sandbox_id}/reset_email_username': patch: summary: Reset email address - description: Reset username of email address per inbox. + description: Reset username of email address per sandbox. tags: - - Sandboxes (Inboxes) + - Sandboxes responses: '200': $ref: '#/components/responses/InboxResponse' @@ -1849,7 +1849,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/accounts/{account_id}/sandboxes/{sandbox_id}/reset_email_username \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -1935,11 +1935,11 @@ paths: .resetEmailAddresses(accountId, inboxId); System.out.println(updatedInbox); - operationId: resetEmailUserNamePerInbox + operationId: resetEmailUserNamePerSandbox parameters: - $ref: '#/components/parameters/account_id' - - $ref: '#/components/parameters/inbox_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}': + - $ref: '#/components/parameters/sandbox_id' + '/api/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}': get: summary: Show email message description: Get email message by ID. @@ -1956,7 +1956,7 @@ paths: - $ref: '#/components/schemas/InboxMessageWithBlacklistsReportInfo' example: id: 2323 - inbox_id: 17002 + sandbox_id: 17002 subject: Test email sent_at: '2022-07-01T19:29:59.295Z' from_email: john@mailtrap.io @@ -1970,11 +1970,11 @@ paths: html_body_size: 150 text_body_size: 100 human_size: 300 Bytes - html_path: /api/accounts/16297/inboxes/17002/messages/2323/body.html - txt_path: /api/accounts/16297/inboxes/17002/messages/2323/body.txt - raw_path: /api/accounts/16297/inboxes/17002/messages/2323/body.raw - download_path: /api/accounts/16297/inboxes/17002/messages/2323/body.eml - html_source_path: /api/accounts/16297/inboxes/17002/messages/2323/body.htmlsource + html_path: /api/accounts/16297/sandboxes/17002/messages/2323/body.html + txt_path: /api/accounts/16297/sandboxes/17002/messages/2323/body.txt + raw_path: /api/accounts/16297/sandboxes/17002/messages/2323/body.raw + download_path: /api/accounts/16297/sandboxes/17002/messages/2323/body.eml + html_source_path: /api/accounts/16297/sandboxes/17002/messages/2323/body.htmlsource blacklists_report_info: false smtp_information: ok: true @@ -1992,14 +1992,14 @@ paths: properties: errors: type: string - example: Inbox is not active or you have insufficient permissions + example: Sandbox is not active or you have insufficient permissions '404': $ref: '#/components/responses/NOT_FOUND' x-codeSamples: - 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/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id} \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -2102,7 +2102,7 @@ paths: .getMessage(accountId, inboxId, messageId); System.out.println(message); - operationId: showInboxEmailMessage + operationId: showSandboxEmailMessage patch: summary: Update message description: Update message attributes (right now only the **is_read** attribute is available for modification). @@ -2132,7 +2132,7 @@ paths: properties: id: type: integer - inbox_id: + sandbox_id: type: integer subject: type: string @@ -2186,7 +2186,7 @@ paths: type: string example: id: 427 - inbox_id: 4324 + sandbox_id: 4324 subject: Test email sent_at: '2022-06-02T19:24:08.941Z' from_email: john@mailtrap.io @@ -2200,11 +2200,11 @@ paths: html_body_size: 150 text_body_size: 100 human_size: 300 Bytes - html_path: /api/accounts/3761/inboxes/4324/messages/427/body.html - txt_path: /api/accounts/3761/inboxes/4324/messages/427/body.txt - raw_path: /api/accounts/3761/inboxes/4324/messages/427/body.raw - download_path: /api/accounts/3761/inboxes/4324/messages/427/body.eml - html_source_path: /api/accounts/3761/inboxes/4324/messages/427/body.htmlsource + html_path: /api/accounts/3761/sandboxes/4324/messages/427/body.html + txt_path: /api/accounts/3761/sandboxes/4324/messages/427/body.txt + raw_path: /api/accounts/3761/sandboxes/4324/messages/427/body.raw + download_path: /api/accounts/3761/sandboxes/4324/messages/427/body.eml + html_source_path: /api/accounts/3761/sandboxes/4324/messages/427/body.htmlsource blacklists_report_info: false smtp_information: ok: true @@ -2222,14 +2222,14 @@ paths: properties: errors: type: string - example: Inbox is not active or you have insufficient permissions + example: Sandbox is not active or you have insufficient permissions '404': $ref: '#/components/responses/NOT_FOUND' x-codeSamples: - 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/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id} \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{"message": {"is_read": "true"}}' @@ -2351,10 +2351,10 @@ paths: .updateMessage(accountId, inboxId, messageId, updateRequest); System.out.println(updatedMessage); - operationId: updateInboxEmailMessage + operationId: updateSandboxEmailMessage delete: summary: Delete message - description: Delete message from inbox. + description: Delete message from sandbox. tags: - Messages responses: @@ -2367,7 +2367,7 @@ paths: properties: id: type: integer - inbox_id: + sandbox_id: type: integer subject: type: string @@ -2421,7 +2421,7 @@ paths: type: string example: id: 433 - inbox_id: 4338 + sandbox_id: 4338 subject: Test email sent_at: '2022-06-02T19:24:10.746Z' from_email: john@mailtrap.io @@ -2435,11 +2435,11 @@ paths: html_body_size: 150 text_body_size: 100 human_size: 300 Bytes - html_path: /api/accounts/3775/inboxes/4338/messages/433/body.html - txt_path: /api/accounts/3775/inboxes/4338/messages/433/body.txt - raw_path: /api/accounts/3775/inboxes/4338/messages/433/body.raw - download_path: /api/accounts/3775/inboxes/4338/messages/433/body.eml - html_source_path: /api/accounts/3775/inboxes/4338/messages/433/body.htmlsource + html_path: /api/accounts/3775/sandboxes/4338/messages/433/body.html + txt_path: /api/accounts/3775/sandboxes/4338/messages/433/body.txt + raw_path: /api/accounts/3775/sandboxes/4338/messages/433/body.raw + download_path: /api/accounts/3775/sandboxes/4338/messages/433/body.eml + html_source_path: /api/accounts/3775/sandboxes/4338/messages/433/body.htmlsource blacklists_report_info: false smtp_information: ok: true @@ -2456,7 +2456,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/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id} \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -2560,15 +2560,15 @@ paths: .deleteMessage(accountId, inboxId, messageId); System.out.println(deletedMessage); - operationId: deleteInboxEmailMessage + operationId: deleteSandboxEmailMessage parameters: - $ref: '#/components/parameters/account_id' - - $ref: '#/components/parameters/inbox_id' + - $ref: '#/components/parameters/sandbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages': + '/api/accounts/{account_id}/sandboxes/{sandbox_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. + description: Get all messages in the sandbox. The response contains up to 30 messages. Use `last_id` or `page` to retrieve more. tags: - Messages responses: @@ -2583,7 +2583,7 @@ paths: properties: id: type: integer - inbox_id: + sandbox_id: type: integer subject: type: string @@ -2637,7 +2637,7 @@ paths: type: string example: - id: 92 - inbox_id: 342 + sandbox_id: 342 subject: Test email sent_at: '2022-08-19T11:34:33.839Z' from_email: per667son25@feeney.biz @@ -2651,11 +2651,11 @@ paths: html_body_size: 150 text_body_size: 100 human_size: 300 Bytes - html_path: /api/accounts/336/inboxes/342/messages/92/body.html - txt_path: /api/accounts/336/inboxes/342/messages/92/body.txt - raw_path: /api/accounts/336/inboxes/342/messages/92/body.raw - download_path: /api/accounts/336/inboxes/342/messages/92/body.eml - html_source_path: /api/accounts/336/inboxes/342/messages/92/body.htmlsource + html_path: /api/accounts/336/sandboxes/342/messages/92/body.html + txt_path: /api/accounts/336/sandboxes/342/messages/92/body.txt + raw_path: /api/accounts/336/sandboxes/342/messages/92/body.raw + download_path: /api/accounts/336/sandboxes/342/messages/92/body.eml + html_source_path: /api/accounts/336/sandboxes/342/messages/92/body.htmlsource blacklists_report_info: false smtp_information: ok: true @@ -2673,13 +2673,13 @@ paths: properties: errors: type: string - example: Inbox is not active or you have insufficient permissions - operationId: getInboxEmailMessage + example: Sandbox is not active or you have insufficient permissions + operationId: getSandboxEmailMessage x-codeSamples: - 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/accounts/{account_id}/sandboxes/{sandbox_id}/messages \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -2816,8 +2816,8 @@ paths: 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': + - $ref: '#/components/parameters/sandbox_id' + '/api/accounts/{account_id}/sandboxes/{sandbox_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. @@ -2855,14 +2855,14 @@ paths: properties: errors: type: string - example: Inbox is not active or you have insufficient permissions + example: Sandbox is not active or you have insufficient permissions '404': $ref: '#/components/responses/NOT_FOUND' x-codeSamples: - 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/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}/forward \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{"email": "recipient@example.com"}' @@ -2981,12 +2981,12 @@ paths: .forwardMessage(accountId, inboxId, messageId, forwardRequest); System.out.println(forwardedMessage); - operationId: forwardInboxEmailMessage + operationId: forwardSandboxEmailMessage parameters: - $ref: '#/components/parameters/account_id' - - $ref: '#/components/parameters/inbox_id' + - $ref: '#/components/parameters/sandbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/spam_report': + '/api/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}/spam_report': get: summary: Get message spam score description: Get a brief spam report by message ID. @@ -3053,14 +3053,14 @@ paths: properties: errors: type: string - example: Inbox is not active or you have insufficient permissions + example: Sandbox is not active or you have insufficient permissions '404': $ref: '#/components/responses/NOT_FOUND' x-codeSamples: - 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/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}/spam_report \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -3142,12 +3142,12 @@ paths: var spamReport = client.testingApi().messages().getSpamScore(accountId, inboxId, messageId); System.out.println(spamReport); - operationId: getInboxEmailMessageSpamReport + operationId: getSandboxEmailMessageSpamReport parameters: - $ref: '#/components/parameters/account_id' - - $ref: '#/components/parameters/inbox_id' + - $ref: '#/components/parameters/sandbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/analyze': + '/api/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}/analyze': get: summary: Get message HTML analysis description: Get a brief HTML report by message ID. @@ -3236,14 +3236,14 @@ paths: properties: errors: type: string - example: Inbox is not active or you have insufficient permissions + example: Sandbox is not active or you have insufficient permissions '404': $ref: '#/components/responses/NOT_FOUND' x-codeSamples: - 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/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}/analyze \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -3323,12 +3323,12 @@ paths: long inboxId = 12345L; var htmlAnalysis = client.testingApi().messages().getMessageHtmlAnalysis(accountId, inboxId, messageId); System.out.println(htmlAnalysis); - operationId: getInboxEmailMessageHTMLAnalysis + operationId: getSandboxEmailMessageHTMLAnalysis parameters: - $ref: '#/components/parameters/account_id' - - $ref: '#/components/parameters/inbox_id' + - $ref: '#/components/parameters/sandbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/body.txt': + '/api/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}/body.txt': get: summary: Get text message description: 'Get text email body, if it exists.' @@ -3375,7 +3375,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/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}/body.txt \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -3455,12 +3455,12 @@ paths: String textBody = client.testingApi().messages().getTextMessage(accountId, inboxId, messageId); System.out.println(textBody); - operationId: getInboxEmailMessageBodyAsTxt + operationId: getSandboxEmailMessageBodyAsTxt parameters: - $ref: '#/components/parameters/account_id' - - $ref: '#/components/parameters/inbox_id' + - $ref: '#/components/parameters/sandbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/body.raw': + '/api/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}/body.raw': get: summary: Get raw message description: Get raw email body. @@ -3551,7 +3551,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/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}/body.raw \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -3631,12 +3631,12 @@ paths: String rawBody = client.testingApi().messages().getRawMessage(accountId, inboxId, messageId); System.out.println(rawBody); - operationId: getInboxEmailMessageBodyAsRaw + operationId: getSandboxEmailMessageBodyAsRaw parameters: - $ref: '#/components/parameters/account_id' - - $ref: '#/components/parameters/inbox_id' + - $ref: '#/components/parameters/sandbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/body.htmlsource': + '/api/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}/body.htmlsource': get: summary: Get message source description: Get HTML source of email. @@ -3706,7 +3706,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/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}/body.htmlsource \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -3782,12 +3782,12 @@ paths: String htmlSource = client.testingApi().messages().getMessageSource(accountId, inboxId, messageId); System.out.println(htmlSource); - operationId: getInboxEmailMessageBodyAsHtmlSource + operationId: getSandboxEmailMessageBodyAsHtmlSource parameters: - $ref: '#/components/parameters/account_id' - - $ref: '#/components/parameters/inbox_id' + - $ref: '#/components/parameters/sandbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/body.html': + '/api/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}/body.html': get: summary: Get HTML message description: Get formatted HTML email body. Not applicable for plain text emails. @@ -3841,7 +3841,7 @@ paths: properties: errors: type: string - example: Inbox is not active or you have insufficient permissions + example: Sandbox is not active or you have insufficient permissions '404': $ref: '#/components/responses/NOT_FOUND' '409': @@ -3855,7 +3855,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/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}/body.html \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -3936,12 +3936,12 @@ paths: long messageId = 12345L; String htmlBody = client.testingApi().messages().getHtmlMessage(accountId, inboxId, messageId); System.out.println(htmlBody); - operationId: getInboxEmailMessageBodyAsHtml + operationId: getSandboxEmailMessageBodyAsHtml parameters: - $ref: '#/components/parameters/account_id' - - $ref: '#/components/parameters/inbox_id' + - $ref: '#/components/parameters/sandbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/body.eml': + '/api/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}/body.eml': get: summary: Get message as .eml description: Get email message in .eml format. @@ -4033,7 +4033,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/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}/body.eml \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -4113,12 +4113,12 @@ paths: String emlContent = client.testingApi().messages().getMessageAsEml(accountId, inboxId, messageId); System.out.println(emlContent); - operationId: getInboxEmailMessageBodyAsEml + operationId: getSandboxEmailMessageBodyAsEml parameters: - $ref: '#/components/parameters/account_id' - - $ref: '#/components/parameters/inbox_id' + - $ref: '#/components/parameters/sandbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/mail_headers': + '/api/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}/mail_headers': get: summary: Get mail headers description: Get mail headers of a message @@ -4162,7 +4162,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/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}/mail_headers \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -4243,12 +4243,12 @@ paths: operationId: getMailHeadersOfEmailMessage parameters: - $ref: '#/components/parameters/account_id' - - $ref: '#/components/parameters/inbox_id' + - $ref: '#/components/parameters/sandbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/attachments': + '/api/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}/attachments': get: summary: Get attachments - description: Get message attachments by inbox_id and message_id. + description: Get message attachments by sandbox_id and message_id. tags: - Attachments parameters: @@ -4306,7 +4306,7 @@ paths: created_at: '2022-06-02T19:25:54.827Z' updated_at: '2022-06-02T19:25:54.827Z' attachment_human_size: 0 Bytes - download_path: /api/accounts/3831/inboxes/4394/messages/457/attachments/67/download + download_path: /api/accounts/3831/sandboxes/4394/messages/457/attachments/67/download '401': $ref: '#/components/responses/UNAUTHENTICATED' '403': @@ -4318,15 +4318,15 @@ paths: properties: errors: type: string - example: Inbox is not active or you have insufficient permissions + example: Sandbox is not active or you have insufficient permissions '404': $ref: '#/components/responses/NOT_FOUND' - operationId: getInboxMessageAttachments + operationId: getSandboxMessageAttachments x-codeSamples: - 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/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}/attachments \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -4408,9 +4408,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/sandbox_id' - $ref: '#/components/parameters/message_id' - '/api/accounts/{account_id}/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}': + '/api/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}/attachments/{attachment_id}': get: summary: Get single attachment description: Get message single attachment by id. @@ -4462,7 +4462,7 @@ paths: created_at: '2022-06-02T19:25:55.687Z' updated_at: '2022-06-02T19:25:55.687Z' attachment_human_size: 0 Bytes - download_path: /api/accounts/3838/inboxes/4401/messages/460/attachments/70/download + download_path: /api/accounts/3838/sandboxes/4401/messages/460/attachments/70/download '401': $ref: '#/components/responses/UNAUTHENTICATED' '403': @@ -4474,15 +4474,15 @@ paths: properties: errors: type: string - example: Inbox is not active or you have insufficient permissions + example: Sandbox is not active or you have insufficient permissions '404': $ref: '#/components/responses/NOT_FOUND' - operationId: getInboxMessageAttachment + operationId: getSandboxMessageAttachment x-codeSamples: - 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/accounts/{account_id}/sandboxes/{sandbox_id}/messages/{message_id}/attachments/{attachment_id} \ -H 'Authorization: Bearer YOUR_API_KEY' - lang: javascript label: Node.js @@ -4566,7 +4566,7 @@ paths: var attachment = client.testingApi().attachments().getSingleAttachment(accountId, inboxId, messageId, attachmentId); parameters: - $ref: '#/components/parameters/account_id' - - $ref: '#/components/parameters/inbox_id' + - $ref: '#/components/parameters/sandbox_id' - $ref: '#/components/parameters/message_id' - $ref: '#/components/parameters/attachment_id' components: @@ -4577,7 +4577,7 @@ components: properties: id: type: integer - inbox_id: + sandbox_id: type: integer subject: type: string @@ -4635,7 +4635,7 @@ components: properties: id: type: integer - inbox_id: + sandbox_id: type: integer subject: type: string @@ -4781,7 +4781,7 @@ components: password: type: string nullable: true - description: Password is only available if you have admin permissions for the inbox. + description: Password is only available if you have admin permissions for the sandbox. max_size: type: integer status: @@ -4940,7 +4940,7 @@ components: can_destroy: true can_leave: true Project: - summary: Project with inbox + summary: Project with sandbox value: id: 2436 name: Admin Project @@ -4987,7 +4987,7 @@ components: can_destroy: true can_leave: true Inboxes: - summary: List of inboxes + summary: List of sandboxes value: - id: 3538 name: Admin Inbox @@ -5114,8 +5114,8 @@ components: $ref: '#/components/examples/Project' InboxesResponse: description: |- - Returns the list of inboxes in the account to which the API token has access. - - **permissions** returns the permissions of the token for the inbox. + Returns the list of sandboxes in the account to which the API token has access. + - **permissions** returns the permissions of the token for the sandbox. content: application/json: schema: @@ -5127,8 +5127,8 @@ components: $ref: '#/components/examples/Inboxes' InboxResponse: description: |- - Returns attributes of the inbox. - - **permissions** returns the permissions of the token for the inbox. + Returns attributes of the sandbox. + - **permissions** returns the permissions of the token for the sandbox. content: application/json: schema: @@ -5144,9 +5144,9 @@ components: format: int64 minimum: 1 example: 3229 - inbox_id: - description: Unique inbox ID - name: inbox_id + sandbox_id: + description: Unique sandbox ID + name: sandbox_id in: path required: true schema: From 85750ceb5a56b1988822ba793563c3f3b6f7c160 Mon Sep 17 00:00:00 2001 From: Ivan Yurchanka Date: Mon, 4 May 2026 18:43:31 +0200 Subject: [PATCH 2/3] Rename sandboxes in examples --- specs/sandbox.openapi.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/specs/sandbox.openapi.yml b/specs/sandbox.openapi.yml index 4a448d6..3681659 100644 --- a/specs/sandbox.openapi.yml +++ b/specs/sandbox.openapi.yml @@ -4842,7 +4842,7 @@ components: type: boolean example: id: 3538 - name: Admin Inbox + name: Admin Sandbox username: b3a87978452ae1 password: 6be9fcfc613a7c max_size: 0 @@ -4902,7 +4902,7 @@ components: viewer: 'https://localhost/projects/2436/share/QEVuQwEAYWN-NIhmrB8qX6ZWzToqdOE9dw1ylIfOQ-_fKwYAD_CCkhRzmAanker219x25PM7YSu12_li4QtOGl363syqCpKX7vlXvIub7b_V1BU2qypVHfspL7qfSIja0edd7hSh' inboxes: - id: 3874 - name: Admin Inbox + name: Admin Sandbox username: f796d276ca4d13 password: 293caeb0f100e4 max_size: 0 @@ -4949,7 +4949,7 @@ components: viewer: 'https://localhost/projects/2436/share/QEVuQwEAYWN-NIhmrB8qX6ZWzToqdOE9dw1ylIfOQ-_fKwYAD_CCkhRzmAanker219x25PM7YSu12_li4QtOGl363syqCpKX7vlXvIub7b_V1BU2qypVHfspL7qfSIja0edd7hSh' inboxes: - id: 3874 - name: Admin Inbox + name: Admin Sandbox username: f796d276ca4d13 password: 293caeb0f100e4 max_size: 0 @@ -4990,7 +4990,7 @@ components: summary: List of sandboxes value: - id: 3538 - name: Admin Inbox + name: Admin Sandbox username: b3a87978452ae1 password: 6be9fcfc613a7c max_size: 0 @@ -5023,7 +5023,7 @@ components: can_destroy: true can_leave: true - id: 4089 - name: Viewer Inbox + name: Viewer Sandbox username: 1d0aa0282f7712 password: 5667a20f611ae7 max_size: 0 From 7e51bbb4da5d3f999d3e973d4e92c179c02321ba Mon Sep 17 00:00:00 2001 From: Ivan Yurchanka Date: Mon, 4 May 2026 18:47:05 +0200 Subject: [PATCH 3/3] Use sandbox_id in sanbox sending --- specs/sandbox-sending.openapi.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/specs/sandbox-sending.openapi.yml b/specs/sandbox-sending.openapi.yml index 97d65cc..55c5cda 100644 --- a/specs/sandbox-sending.openapi.yml +++ b/specs/sandbox-sending.openapi.yml @@ -22,9 +22,9 @@ tags: x-page-description: Send emails to sandbox description: Test Emails paths: - '/api/send/{inbox_id}': + '/api/send/{sandbox_id}': post: - description: Send email message to the specified inbox. + description: Send email message to the specified sandbox. operationId: sendEmail summary: Send email (including templates) tags: @@ -33,7 +33,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X POST https://sandbox.api.mailtrap.io/api/send/{inbox_id} \ + curl -X POST https://sandbox.api.mailtrap.io/api/send/{sandbox_id} \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ @@ -212,7 +212,7 @@ paths: schema: $ref: '#/components/schemas/SendEmailErrorResponse' '429': - description: Billing plan limit exhausted or inbox rate limit exceeded (see the response for details). + description: Billing plan limit exhausted or sandbox rate limit exceeded (see the response for details). content: application/json: schema: @@ -224,8 +224,8 @@ paths: schema: $ref: '#/components/schemas/SendEmailErrorResponse' parameters: - - $ref: '#/components/parameters/inbox_id' - '/api/batch/{inbox_id}': + - $ref: '#/components/parameters/sandbox_id' + '/api/batch/{sandbox_id}': post: description: | Batch send email (text, html, text&html, templates). Please note that the endpoint will return a 200-level http status, even when sending for individual messages may fail. Users of this endpoint should check the success and errors for each message in the response (the results are ordered the same as the original messages - `requests`). Please note that the endpoint accepts up to 500 messages per API call, and up to 50 MB payload size, including attachments. @@ -237,7 +237,7 @@ paths: - lang: shell label: 'cURL' source: | - curl -X POST https://sandbox.api.mailtrap.io/api/batch/{inbox_id} \ + curl -X POST https://sandbox.api.mailtrap.io/api/batch/{sandbox_id} \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ @@ -469,7 +469,7 @@ paths: schema: $ref: '#/components/schemas/SendEmailErrorResponse' parameters: - - $ref: '#/components/parameters/inbox_id' + - $ref: '#/components/parameters/sandbox_id' components: schemas: EmailWithText: @@ -963,9 +963,9 @@ components: scheme: bearer bearerFormat: JWT parameters: - inbox_id: - description: Unique inbox ID - name: inbox_id + sandbox_id: + description: Sandbox ID + name: sandbox_id in: path required: true schema: