Skip to content
Insy
For developers
Esc
navigateopen⌘Jpreview

Provision a community membership from an external sales funnel. Looks up / creates the user by email or telegramUserId, handles overlap with existing memberships, and is idempotent via externalOrderId.

Private access. This endpoint provisions paid access without a payment, so it is granted only to vetted partners. Request it from support@insy.io.

POST/membership/provision-external
Authorization
AuthorizationBearer token (API Key) · headerrequired
API Key for programmatic access (format: insy_xxxxx)
Request body
requiredapplication/json
communityIdstring<uuid>required
Community for which the membership is provisioned
emailstring<email>
Email of the member. At least one of email or telegramUserId must be provided.
telegramUserIdnumber
Telegram user id. At least one of email or telegramUserId must be provided.
min 1
pricingPlanIdstring<uuid>
Pricing plan id the membership should be associated with
validFromstring
Membership start, ISO-8601. Defaults to now.
validUntilstring
Membership end, ISO-8601. Omit for lifetime membership.
externalOrderIdstringrequired
Idempotency key from the external system. Re-calling with the same externalOrderId returns the existing membership unchanged.
onOverlapstring
Behavior when the user already has an active, non-expired membership for this community. Defaults to 'extend'.
default: "extend"
Allowed:extendreplaceerror
Responses
200Successful response
successbooleanrequired
Whether the request was successful
errorCodestringrequired
The error code returned by the request
Allowed:not_foundbad_requestalready_existsunauthorizedforbiddeninternal_server_errorservice_unavailabletimeoutconflictprecondition_failedunprocessable_entity
messagestringrequired
The message returned by the request
dataProvisionExternalMembershipResponseDto
Show properties
membershipIdstringrequired
userIdstringrequired
validFromstring<date-time>required
validUntilstring<date-time> | nullrequired
statusstringrequired
Allowed:createdextendedreplacedidempotent_return
401Invalid, expired, or revoked API key
403Insufficient API key permissions
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST "https://api.insy.io/membership/provision-external" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "communityId": "123e4567-e89b-12d3-a456-426614174000",
  "email": "user@example.com",
  "telegramUserId": 1,
  "pricingPlanId": "c93726f9-189f-4fc5-bad5-9d1f51ff93e2",
  "validFrom": "string",
  "validUntil": "string",
  "externalOrderId": "string",
  "onOverlap": "extend"
}'
Response
{
  "success": true,
  "errorCode": "not_found",
  "message": "Success",
  "data": {
    "membershipId": "string",
    "userId": "string",
    "validFrom": "2019-08-24T14:15:22Z",
    "validUntil": "2019-08-24T14:15:22Z",
    "status": "created"
  }
}