Grant stamp permission
POST/openapi/v1/stamps/grant
Grant Space members permission to use a specified stamp at the Space level (permanent or time-bound), in batch. Pass members' business UserIDs (obtainable via List Members).
- A member that is already authorized is treated as success (returned in
UserIds); a member that does not exist or is deactivated is reported inFailedUserswith a reason. - A repeated grant overwrites the member's previous validity period, remark and grantor: granting again with the default
permanentturns an existingcustom_timegrant into a permanent one. This is not a no-op idempotent action — confirm the intended validity period before calling. - If the stamp does not exist or does not belong to the current Space,
OPENAPI.STAMP_NOT_FOUNDis returned.
In the console: Admin > Stamps > Stamp permissions.
Required Scope: stamp:manage
Request Parameters
Header Parameters
AuthorizationRequiredstring
Bearer <access_token>
X-Operator-User-IdOptionalstring
Operator user ID. Not required in the authorization code flow (the authorized user is used automatically); **required** in the client credentials flow. The operator must be an administrator of the current Space.
Request Body
application/jsonStampIdRequiredstring
Stamp ID.
UserIdsRequiredarray<string>
Business UserIDs of members to grant, 1–100 after deduplication and removal of empty values.
GrantTypeOptionalstring
Grant type. Values: `permanent` (default, no expiry) and `custom_time` (custom time window, requires `StartAt` / `ExpiresAt`).
StartAtOptionalstring(date-time)
Effective time in RFC3339 format (must include a timezone offset; UTC recommended), e.g. `2026-06-01T00:00:00Z`. When `GrantType=custom_time`, both `StartAt` and `ExpiresAt` are required together, and `ExpiresAt` must be later than `StartAt` and in the future. For `permanent`, the time fields do not participate in the grant and are ignored even if provided.
ExpiresAtOptionalstring(date-time)
Expiry time in RFC3339 format (must include a timezone offset; UTC recommended), e.g. `2026-06-30T23:59:59Z`. Required for `custom_time`; must be later than `StartAt` and in the future.
GrantorUserIdOptionalstring
Business UserID of the grantor. Defaults to the current operator; when provided, must be an enabled administrator of the current Space.
RemarkOptionalstring
Grant remark, up to 300 characters.
Response Parameters
Response.Data
UserIdsOptionalarray<string>
UserIDs successfully granted.
FailedUsersOptionalarray<object>
Members that could not be granted and the reason.
UserIdOptionalstring
The member's business UserID
ReasonOptionalstring
Failure reason. Values: `member_not_found` (no such member in the Space), `member_disabled` (member is deactivated), `internal_error` (internal service error).
GrantRecordIdOptionalstring
Grant record ID (batch identifier for this request), which you may keep for correlation. To view the current details of Space-level grants, use `Authorizations` returned by `stamps/list`; the existing `list-envelope-grants` endpoint queries envelope-level stamp permission operation results only and does not support querying Space-level grant history by this batch.
Error Codes
| Error Code | Description |
|---|---|
INVALID_REQUEST | Invalid request parameters (empty StampId, empty UserIds or more than 100 after deduplication, invalid GrantType, missing StartAt / ExpiresAt or non-RFC3339 values for custom_time, ExpiresAt not later than StartAt or not in the future, Remark over 300 characters) |
OPENAPI.OPERATOR_USER_ID_REQUIRED | X-Operator-User-Id not provided in the client credentials flow |
OPENAPI.OPERATOR_USER_NOT_FOUND | Operator user does not exist, account not enabled, or not an enabled member of the current Space |
OPENAPI.OPERATOR_USER_NOT_HUMAN | Operator user is not a real user |
MEMBER.INSUFFICIENT_PERMISSION | The operator is not a Space administrator, or GrantorUserId is not an enabled administrator of the current Space |
OPENAPI.STAMP_NOT_FOUND | The stamp does not exist or does not belong to the current Space |
INTERNAL_ERROR | Internal server error |