> ## Documentation Index
> Fetch the complete documentation index at: https://playcamp.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Creator Boost

> Managing user-creator boost relationships via the Sponsor API

Set the creator that a user boosts. After setting a boost, the user's payments are automatically attributed to the creator.

## POST /sponsors Behavior

`POST /sponsors` works as upsert:

| Current State              | Requested creatorKey | Behavior                     |
| -------------------------- | -------------------- | ---------------------------- |
| No boost                   | -                    | Create new                   |
| Boosting same creator      | Same                 | Return current state         |
| Boosting different creator | Different            | Change after 30-day cooldown |
| Boost ended                | -                    | Reactivate                   |

<Note>
  `POST /sponsors` handles both boost creation and changes in one API.
</Note>

## Flow

```
1. Search/Select creator  →  2. Create boost (POST /sponsors)  →  3. Future payments auto-attributed
```

## Create Boost

<Info>
  If `campaignId` is not specified, it will be automatically assigned to the currently active campaign.
</Info>

<Warning>
  When operating multiple campaigns for a single game, you must specify `campaignId` to distinguish between campaigns.
</Warning>

**Request**

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    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",
        "callbackId": "game-session-abc123"
      }'
    ```
  </Tab>

  <Tab title="Node SDK">
    ```typescript theme={null}
    const sponsor = await server.sponsors.create({
      userId: 'user_12345',
      creatorKey: 'ABC12',
      callbackId: 'game-session-abc123', // optional
    });
    ```
  </Tab>

  <Tab title="Go SDK">
    ```go theme={null}
    sponsor, err := server.Sponsors.Create(ctx, playcamp.CreateSponsorParams{
        UserID:     "user_12345",
        CreatorKey: "ABC12",
        CallbackID: "game-session-abc123", // optional
    })
    ```
  </Tab>
</Tabs>

**Response (201 Created)**

```json theme={null}
{
  "data": {
    "userId": "user_12345",
    "campaignId": "campaign_001",
    "creatorKey": "ABC12",
    "isActive": true,
    "sponsoredAt": "2024-01-15T10:30:00.000Z"
  }
}
```

## Remove Boost

If `campaignId` is not specified, boost from the active campaign will be removed.

**Request**

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl -X DELETE "https://sandbox-sdk-api.playcamp.io/v1/server/sponsors/user/user_12345" \
      -H "Authorization: Bearer ak_server_xxx:secret"
    ```
  </Tab>

  <Tab title="Node SDK">
    ```typescript theme={null}
    await server.sponsors.remove({ userId: 'user_12345' });
    ```
  </Tab>

  <Tab title="Go SDK">
    ```go theme={null}
    err := server.Sponsors.Delete(ctx, "user_12345", nil)
    ```
  </Tab>
</Tabs>

## Optional Parameters

| Field        | Type    | Description                                                     |
| ------------ | ------- | --------------------------------------------------------------- |
| `campaignId` | string  | Campaign ID (auto-assigned to active campaign if not specified) |
| `callbackId` | string  | Webhook tracking ID (included in webhook events)                |
| `isTest`     | boolean | Test mode (does not create actual data)                         |

## 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                        |
