POST /api/public/professionals/apply

A professional applies: the account is made and signed in, and the pool opens once we have approved it.

Surface: public. Who may call: public. Key: public.professional.apply.

Example request

curl -X POST https://caremcp.com/api/public/professionals/apply \
  -H "Content-Type: application/json" \
  -d '{"email":"vera@example.com","password":"a long enough password","name":"Vera Lind","location":{"country":"SE"},"languages":["sv","en"],"professions":["personal-trainer","nutrition-coach"],"licensedIn":[]}'

Example input

{
  "email": "vera@example.com",
  "password": "a long enough password",
  "name": "Vera Lind",
  "location": {
    "country": "SE"
  },
  "languages": [
    "sv",
    "en"
  ],
  "professions": [
    "personal-trainer",
    "nutrition-coach"
  ],
  "licensedIn": []
}

Input schema

{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "email": {
   "type": "string",
   "maxLength": 200,
   "format": "email",
   "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
  },
  "password": {
   "type": "string",
   "minLength": 10,
   "maxLength": 200
  },
  "name": {
   "type": "string",
   "minLength": 2,
   "maxLength": 100
  },
  "location": {
   "type": "object",
   "properties": {
    "country": {
     "type": "string",
     "pattern": "^[A-Z]{2}$"
    },
    "region": {
     "type": "string",
     "pattern": "^[A-Z0-9]{1,3}$"
    }
   },
   "required": [
    "country"
   ]
  },
  "languages": {
   "minItems": 1,
   "maxItems": 10,
   "type": "array",
   "items": {
    "$ref": "#/$defs/__schema0"
   }
  },
  "professions": {
   "minItems": 1,
   "maxItems": 5,
   "type": "array",
   "items": {
    "$ref": "#/$defs/__schema1"
   }
  },
  "licensedIn": {
   "default": [],
   "maxItems": 20,
   "type": "array",
   "items": {
    "$ref": "#/$defs/__schema2"
   }
  }
 },
 "required": [
  "email",
  "password",
  "name",
  "location",
  "languages",
  "professions"
 ],
 "$defs": {
  "__schema0": {
   "type": "string",
   "pattern": "^[a-z]{2}(-[A-Z]{2})?$"
  },
  "__schema1": {
   "type": "string",
   "minLength": 1
  },
  "__schema2": {
   "type": "string",
   "pattern": "^[A-Z]{2}$"
  }
 }
}

Output schema

{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "token": {
   "type": "string"
  },
  "kind": {
   "type": "string",
   "enum": [
    "client",
    "professional",
    "organisation"
   ]
  },
  "id": {
   "type": "string"
  }
 },
 "required": [
  "token",
  "kind",
  "id"
 ],
 "additionalProperties": false
}