Sample - Slack Web API
POST/admin.users.setExpiration

Set a guest user expiration

Sets an expiration timestamp for a guest user in a workspace. Supply team_id, user_id, and expiration_ts to identify the guest account and the time when it should be disabled. The authenticated user must provide an administrative token with the required write scope.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

1 parameter · 3 body fields
tokenstringrequired
Authentication token with the `admin.users:write` scope.

Form-encoded workspace, user, and expiration details for a guest account.

team_idstringrequired
The ID (`T1234`) of the workspace.
user_idstringrequired
The ID of the user to set an expiration for.
expiration_tsintegerrequired
Timestamp when guest account should be disabled.

2 status codes
200Returns an object with `ok` set to true when the guest expiration is set.
okbooleanrequired
Allowed:true
defaultReturns an object with `ok` set to false when the operation does not complete successfully.
okbooleanrequired
Allowed:false

Error handling

team_id, user_id, and expiration_ts are required. expiration_ts must be an integer timestamp, and the token must have the admin.users:write scope.