Update Affiliate

Change an affiliate's status - approve, reject, or remove them from your program.

PATCH/api/v1/affiliates/:id

Update the status of an affiliate partnership. Use this to approve pending affiliates, reject applications, or remove affiliates from your program.

Status changes trigger the corresponding webhook event (affiliate.approved, affiliate.rejected, or affiliate.removed) if configured.

Path parameters

ParameterTypeDescription
idrequired
stringThe partnership ID.

Request body

ParameterTypeDescription
statusrequired
stringNew status: active (approve), rejected, or removed.

Example request

bash
curl -X PATCH https://anderro.com/api/v1/affiliates/part_abc123 \
  -H "Content-Type: application/json" \
  -H "x-api-key: sk_your_secret_key" \
  -d '{ "status": "active" }'

Responses

200Affiliate status updated
json
{
  "data": {
    "id": "part_abc123",
    "status": "active",
    "referral_code": "jane-smith",
    "created_at": "2026-04-01T10:00:00.000Z",
    "affiliate": {
      "id": "ap_xyz789",
      "email": "[email protected]",
      "name": "Jane Smith"
    }
  }
}
400Invalid status value
json
{
  "error": "Invalid status. Must be active, rejected, or removed."
}
404Affiliate not found
json
{
  "error": "Affiliate not found"
}