API ReferenceapiaffiliatesPOST /v1/affiliates/{id}/approve

POST /v1/affiliates/\{id\}/approve

Service: affiliates · operationId: (none)

Approve a pending affiliate application

Required scopes

(no scope declared — review service config)

Path parameters

  • id (string) required

Request body

{
  "type": "object",
  "properties": {
    "reviewed_by": {
      "type": "string",
      "minLength": 1
    }
  },
  "required": [
    "reviewed_by"
  ]
}

Responses

200 Application approved

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "user_id": {
      "type": "string"
    },
    "referral_code": {
      "type": "string"
    },
    "commission_rate_bps": {
      "type": "integer"
    },
    "status": {
      "type": "string"
    },
    "brand_id": {
      "type": "string"
    },
    "applied_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "reviewed_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "reviewed_by": {
      "type": [
        "string",
        "null"
      ]
    },
    "rejection_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "user_id",
    "referral_code",
    "commission_rate_bps",
    "status",
    "brand_id",
    "applied_at",
    "reviewed_at",
    "reviewed_by",
    "rejection_reason",
    "created_at",
    "updated_at"
  ]
}

404 Affiliate not found

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

422 Not in pending_approval state

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

Example

curl -X POST https://affiliates.platform.loop.health/v1/affiliates/{id}/approve \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'