ComRaidComRaid Docs
API referenceMobile

Attach a contact identity to a subscription

Upserts a contact for external_user_id and binds this subscription. Requires a matching subscription_credential (credential-less Endpoints return 401). Inactive Subscriptions return 409 (`subscription_inactive`). When the project has identity_verification_required, jwt (RS256 JWT for Identity verification) is mandatory and must verify. When optional, omit jwt for an unverified bind, but any supplied invalid jwt is rejected (never downgraded).

POST
/mobile/subscriptions/{id}/login

Upserts a contact for external_user_id and binds this subscription. Requires a matching subscription_credential (credential-less Endpoints return 401). Inactive Subscriptions return 409 (subscription_inactive). When the project has identity_verification_required, jwt (RS256 JWT for Identity verification) is mandatory and must verify. When optional, omit jwt for an unverified bind, but any supplied invalid jwt is rejected (never downgraded).

Authorization

mobileAppId
headerX-ComRaid-App-Id<token>

Publishable mobile app id (cr_app_...)

Path Parameters

id*string
Formatuuid

Request Body

application/json
  1. body
external_user_id*string

Product-owned contact identity

subscription_credential?string

Required once the subscription has been issued a credential

jwt?string

RS256 JWT for Identity verification (iss=comraid:{project_id}, aud=comraid:identity, kid, iat, exp≤10m). Required when the project enforces identity verification.

Response Body

Logged in

application/json
  1. response
subscription_id*string
Formatuuid
contact_id*string
Formatuuid
external_user_id*string
anonymous*false
Value infalse
verified*boolean

True when this login presented a valid Identity verification JWT

Example Request
curl -X POST 'https://api.comraid.io/mobile/subscriptions/497f6eca-6276-4993-bfeb-53cbbbba6f08/login' \  -H 'Content-Type: application/json' \  -d '{  "external_user_id": "user_123",  "subscription_credential": "high-entropy-secret",  "jwt": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImFjbWUtMjAyNiJ9..."}'
Example Response
{  "subscription_id": "0a1b2c3d-4e5f-6789-abcd-ef0123456789",  "contact_id": "9f8e7d6c-5b4a-3210-9876-543210fedcba",  "external_user_id": "user_123",  "anonymous": false,  "verified": true}