Grace Periods API
Grace Periods API
Section titled “Grace Periods API”The Grace Periods API allows platforms to track and manage the 30-day compliance windows when identities are boxed.
List Grace Periods
Section titled “List Grace Periods”List active grace periods for your platform.
Endpoint
Section titled “Endpoint”GET /v1/lmif/grace-periodsRequest
Section titled “Request”const gracePeriods = await lmif.gracePeriods.list({ status: 'active', limit: 20});curl https://api.lookmaimfamous.com/v1/lmif/grace-periods?status=active \ -H "Authorization: Bearer lmif_live_xxx"Query Parameters
Section titled “Query Parameters”| Parameter | Type | Description |
|---|---|---|
status | string | active, paused, resolved, expired |
boxId | string | Filter by box ID |
expiringWithin | integer | Days until expiration (e.g., 7) |
limit | integer | Max items |
offset | integer | Items to skip |
Response
Section titled “Response”{ "data": [ { "id": "gp_abc123", "boxId": "box_xyz789", "violationId": "viol_123456", "identityName": "Taylor Swift", "status": "active", "startedAt": "2024-01-01T00:00:00Z", "expiresAt": "2024-01-31T00:00:00Z", "daysRemaining": 15, "affectedAvatars": 3, "affectedUsers": 15000 } ], "meta": { "total": 5, "limit": 20, "offset": 0 }}Get Grace Period
Section titled “Get Grace Period”Get details of a specific grace period.
Endpoint
Section titled “Endpoint”GET /v1/lmif/grace-periods/{id}Request
Section titled “Request”const gracePeriod = await lmif.gracePeriods.get('gp_abc123');curl https://api.lookmaimfamous.com/v1/lmif/grace-periods/gp_abc123 \ -H "Authorization: Bearer lmif_live_xxx"Response
Section titled “Response”{ "data": { "id": "gp_abc123", "boxId": "box_xyz789", "violationId": "viol_123456", "identityName": "Taylor Swift", "policy": "MONETIZE", "status": "active", "startedAt": "2024-01-01T00:00:00Z", "expiresAt": "2024-01-31T00:00:00Z", "daysRemaining": 15, "notifications": { "day0": { "sent": true, "at": "2024-01-01T00:00:00Z", "recipients": ["creator@example.com"] }, "day7": { "sent": true, "at": "2024-01-08T00:00:00Z", "recipients": ["creator@example.com"] }, "day21": { "sent": false, "scheduledAt": "2024-01-22T00:00:00Z" }, "day28": { "sent": false, "scheduledAt": "2024-01-29T00:00:00Z" } }, "affectedAvatars": [ { "avatarId": "avatar_001", "name": "Taylor AI", "creatorId": "creator_abc", "creatorEmail": "john@example.com", "userCount": 5000, "status": "active" }, { "avatarId": "avatar_002", "name": "Swift Bot", "creatorId": "creator_def", "creatorEmail": "jane@example.com", "userCount": 10000, "status": "active" } ], "resolutionOptions": [ { "type": "license", "available": true, "pricing": { "personal": 0, "creator": 50, "commercial": 500 } }, { "type": "remove", "available": true }, { "type": "modify", "available": true } ] }}Resolve Grace Period
Section titled “Resolve Grace Period”Mark a grace period as resolved.
Endpoint
Section titled “Endpoint”POST /v1/lmif/grace-periods/{id}/resolveRequest
Section titled “Request”await lmif.gracePeriods.resolve('gp_abc123', { resolution: 'licensed', licenseId: 'lic_xyz789', avatarId: 'avatar_001'});curl -X POST https://api.lookmaimfamous.com/v1/lmif/grace-periods/gp_abc123/resolve \ -H "Authorization: Bearer lmif_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "resolution": "licensed", "licenseId": "lic_xyz789", "avatarId": "avatar_001" }'Request Body
Section titled “Request Body”| Field | Type | Required | Description |
|---|---|---|---|
resolution | string | Yes | Resolution type |
avatarId | string | Yes | Avatar being resolved |
licenseId | string | No | License ID if licensed |
notes | string | No | Additional notes |
Resolution Types
Section titled “Resolution Types”| Type | Description |
|---|---|
licensed | Obtained a license |
removed | Avatar was removed |
modified | Avatar was modified |
parody | Marked as parody |
Response
Section titled “Response”{ "data": { "id": "gp_abc123", "status": "resolved", "resolution": "licensed", "resolvedAt": "2024-01-16T10:00:00Z", "remainingAvatars": 2 }}Grace Period Timeline
Section titled “Grace Period Timeline”┌─────────────────────────────────────────────────────────────┐│ 30-DAY GRACE PERIOD │├─────────────────────────────────────────────────────────────┤│ ││ Day 0: Grace period starts ││ ├── Violation created ││ ├── Avatar creators notified ││ └── Users notified ││ ││ Day 7: First reminder ││ └── "23 days remaining" ││ ││ Day 21: Second reminder ││ └── "9 days remaining" ││ ││ Day 28: Final warning ││ └── "2 days remaining - take action now" ││ ││ Day 30: Enforcement ││ ├── Unlicensed avatars deactivated ││ └── Users notified and migrated ││ │└─────────────────────────────────────────────────────────────┘Grace Period Statuses
Section titled “Grace Period Statuses”| Status | Description |
|---|---|
active | Countdown in progress |
paused | Paused due to appeal |
resolved | All avatars complied |
expired | Time ran out, enforcement triggered |
cancelled | Box was removed |
Webhook Events
Section titled “Webhook Events”Grace periods trigger webhook events:
// Handle grace period webhooksapp.post('/webhooks/lmif', (req, res) => { const event = req.body;
switch (event.type) { case 'grace_period.started': // New grace period - notify affected users break;
case 'grace_period.reminder': // Reminder sent (day 7, 21, 28) // event.data.reminderDay = 7 | 21 | 28 break;
case 'grace_period.ending': // 2 days left - urgent action needed break;
case 'grace_period.expired': // Time's up - deactivate avatars break;
case 'grace_period.resolved': // Avatar creator resolved break;
case 'grace_period.paused': // Paused due to appeal break;
case 'grace_period.resumed': // Appeal denied, countdown resumed break; }
res.status(200).send('OK');});Sandbox Testing
Section titled “Sandbox Testing”In sandbox, grace periods are accelerated:
| Production | Sandbox |
|---|---|
| 30 days | 24 hours |
| Day 7 | Hour 6 |
| Day 21 | Hour 18 |
| Day 28 | Hour 22 |