Add a retained version to a custom FHIR profile

POST/fhir/profiles/{id}/versions
RequiresBearerauthentication

Path parameters

idstringrequired
Returns  

Response fields

idstringrequired
sourcestringrequired
custombuiltin
resource_typestringrequired
urlstringrequired
versionstringrequired
statusstringoptional
datestringoptional
canonicalstringrequired
fhir_versionstringrequired
implementation_guidestringrequired
created_atstring (date-time)required
updated_atstring (date-time)required
POSTRequest
# Get authentication token
PHENOML_TOKEN=$(curl -X POST "https://experiment.app.pheno.ml/v2/auth/token" \
  -u "$PHENOML_CLIENT_ID:$PHENOML_CLIENT_SECRET" \
  | jq -r '.access_token')

curl -X POST "https://experiment.app.pheno.ml/fhir/profiles/custom-patient/versions" \
  -H "Authorization: Bearer $PHENOML_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "resourceType": "StructureDefinition",
  "id": "custom-patient",
  "url": "http://phenoml.com/fhir/StructureDefinition/custom-patient",
  "version": "2.0.0",
  "name": "CustomPatient",
  "status": "active",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Patient",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Patient",
  "derivation": "constraint",
  "snapshot": {
    "element": [
      {
        "id": "Patient",
        "path": "Patient"
      }
    ]
  }
}'
201 CreatedExample Response
{
  "id": "custom-patient",
  "source": "custom",
  "resource_type": "Patient",
  "url": "http://phenoml.com/fhir/StructureDefinition/custom-patient",
  "version": "1.0.0",
  "status": "active",
  "date": "2026-08-24",
  "canonical": "http://phenoml.com/fhir/StructureDefinition/custom-patient|1.0.0",
  "fhir_version": "4.0.1",
  "implementation_guide": "acme-cardiology",
  "created_at": "2026-08-24T15:04:05Z",
  "updated_at": "2026-08-25T16:04:05Z"
}