logo
AdminUpdate an API token

Update an API token

curl -X PATCH "https://mail.haltman.io/api/admin/api-tokens/123" \
  -H "Content-Type: application/json" \
  -H "X-CSRF-Token: YOUR_API_KEY" \
  -d '{
  "owner_email": "user@example.com",
  "status": "active",
  "expires_at": "2024-12-25T10:00:00Z",
  "revoked": true,
  "revoked_reason": "example_string"
}'
{
  "ok": true,
  "updated": true,
  "deleted": true,
  "item": {
    "id": 123,
    "owner_email": "user@example.com",
    "status": "active",
    "created_at": "2024-12-25T10:00:00Z",
    "expires_at": "2024-12-25T10:00:00Z",
    "revoked_at": "2024-12-25T10:00:00Z",
    "revoked_reason": "example_string",
    "created_ip": "example_string",
    "user_agent": "example_string",
    "last_used_at": "2024-12-25T10:00:00Z",
    "active": true
  }
}
PATCH
/api/admin/api-tokens/{id}
PATCH
API Key (cookie: __Host-access)
__Host-accessstring
Required

Access-session cookie used for user and admin authentication.

Access-session cookie used for user and admin authentication.
API Key (header: X-CSRF-Token)
X-CSRF-Tokenstring
Required

CSRF token derived from the current session family.

CSRF token derived from the current session family.
path
idinteger
Required

Resource identifier.

Content-Typestring
Required

The media type of the request body

Options: application/json
owner_emailstring
Format: email
statusstring
Options: active, revoked, expired
expires_atstring
Format: date-time
Request Preview
Response

Response will appear here after sending the request

Authentication

path
parameterstring
Required

API Key for authentication. Access-session cookie used for user and admin authentication.

header
X-CSRF-Tokenstring
Required

API Key for authentication. CSRF token derived from the current session family.

Path Parameters

idinteger
Required

Resource identifier.

Body

application/json
statusstring
Allowed values:activerevokedexpired

Responses

okboolean
Required
updatedboolean
deletedboolean
itemobject
Required