Skip to content

Commit 07c93f1

Browse files
committed
MT-23076: document --expires-at in README and accounts reference
1 parent 56bb576 commit 07c93f1

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎README.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ mailtrap inbound messages list --inbox-id 735
130130
mailtrap inbound messages reply --inbox-id 735 --id <MESSAGE_ID> --text "Thanks for reaching out!"
131131
mailtrap inbound threads list --inbox-id 735
132132

133+
# API tokens (--expires-at takes an ISO 8601 date-time or 'never'; omit it for the server default)
134+
mailtrap tokens create --name "ci-token" --permissions '[{"resource_type":"account","resource_id":123,"access_level":100}]' --expires-at 2027-06-01T00:00:00Z
135+
mailtrap tokens reset --id 42 --expires-at never
136+
133137
# Contacts
134138
mailtrap contacts create --email "user@example.com" --first-name "John"
135139
mailtrap contact-lists list
@@ -187,7 +191,7 @@ mailtrap domains list --output text
187191
| **Accounts** | `accounts list` |
188192
| **Account Access** | `account-access list`, `account-access remove` |
189193
| **Permissions** | `permissions resources`, `permissions bulk-update` |
190-
| **Tokens** | `tokens list`, `tokens get`, `tokens create`, `tokens delete`, `tokens reset` |
194+
| **Tokens** | `tokens list`, `tokens get`, `tokens create [--expires-at]`, `tokens delete`, `tokens reset [--expires-at]` |
191195
| **Billing** | `billing usage` |
192196
| **Organizations** | `organizations list-sub-accounts`, `organizations create-sub-account` |
193197
| **Config** | `configure`, `completion [bash\|zsh\|fish\|powershell]` |

‎skills/mailtrap-cli/references/accounts.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Create a new API token.
5858
|------|------|----------|-------------|
5959
| `--name` | string | Yes | Token name |
6060
| `--permissions` | string | Yes | Permissions JSON array, e.g. `'[{"resource_type":"account","resource_id":123,"access_level":100}]'` |
61+
| `--expires-at` | string | No | Token expiration as an ISO 8601 date-time, e.g. `2027-06-01T00:00:00Z`. Pass `never` for a token that never expires. Omit for the server default (a 1-year default is being rolled out) |
6162

6263
**Note:** The token value is shown only once in the response. Store it securely.
6364

@@ -80,6 +81,7 @@ Reset (regenerate) an API token.
8081
| Flag | Type | Required | Description |
8182
|------|------|----------|-------------|
8283
| `--id` | string | Yes | Token ID |
84+
| `--expires-at` | string | No | New token expiration as an ISO 8601 date-time, e.g. `2027-06-01T00:00:00Z`. Pass `never` for a token that never expires. Omit for the server default (a 1-year default is being rolled out) |
8385

8486
**Note:** The new token value is shown only once. The old token stops working immediately.
8587

0 commit comments

Comments
 (0)