POST /v1/affiliates
Service: affiliates · operationId: (none)
Required scopes
(no scope declared — review service config)
Request body
{
"type": "object",
"properties": {
"user_id": {
"type": "string",
"minLength": 1
},
"referral_code": {
"type": "string",
"minLength": 1
},
"commission_rate_bps": {
"type": "integer",
"minimum": 0,
"maximum": 10000,
"default": 1000
},
"brand_id": {
"type": "string",
"default": "loop-health"
},
"metadata": {
"type": [
"object",
"null"
],
"additionalProperties": {}
}
},
"required": [
"user_id",
"referral_code"
]
}Responses
201 Affiliate created
{
"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"
},
"created_at": {
"type": "string"
},
"updated_at": {
"type": "string"
}
},
"required": [
"id",
"user_id",
"referral_code",
"commission_rate_bps",
"status",
"brand_id",
"created_at",
"updated_at"
]
}400 Validation error
{
"type": "object",
"properties": {
"error": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"error",
"message"
]
}Example
curl -X POST https://affiliates.platform.loop.health/v1/affiliates \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{ ... }'Related
services/affiliates— service overview- All endpoints — directory across services
- Auth model — how scopes are enforced