Managing user-creator sponsor relationships
Set the creator that a user supports. After setting a sponsor, the user’s payments are automatically attributed to the creator.
POST /sponsors Behavior
POST /sponsors works as upsert:
| Current State | Requested creatorKey | Behavior |
|---|---|---|
| No sponsor | - | Create new |
| Sponsoring same creator | Same | Return current state |
| Sponsoring different creator | Different | Change after 30-day cooldown |
| Sponsor ended | - | Reactivate |
POST /sponsors handles both sponsor creation and changes in one API.
Flow
1. Search/Select creator → 2. Create sponsor → 3. Future payments auto-attributed
Create Sponsor
Request
curl -X POST "https://sandbox-sdk-api.playcamp.io/v1/server/sponsors" \
-H "Authorization: Bearer ak_server_xxx:secret" \
-H "Content-Type: application/json" \
-d '{
"userId": "user_12345",
"creatorKey": "ABC12"
}'{
"data": {
"userId": "user_12345",
"campaignId": "campaign_001",
"creatorKey": "ABC12",
"isActive": true,
"sponsoredAt": "2024-01-15T10:30:00.000Z"
}
}Remove Sponsor
If campaignId is not specified, sponsor from the active campaign will be removed.Request
curl -X DELETE "https://sandbox-sdk-api.playcamp.io/v1/server/sponsors/user/user_12345" \ -H "Authorization: Bearer ak_server_xxx:secret"
Error Handling
| HTTP | Code | Description | Action |
|---|---|---|---|
| 400 | BAD_REQUEST |
No active campaign or 30-day cooldown | Check campaign status, wait for cooldown |
| 404 | NOT_FOUND |
Creator not found | Verify creatorKey |