Skip to main content

Create Agreement

POST /v1/agreement

Creates a new agreement record (e.g., user terms or service policy). The service validates input, applies defaults (such as active, global, and reconsent flags), associates any referenced services, and returns the persisted agreement with timestamps and identifiers.

Request Body

{
"content": {
"en": {
"title": "User Agreement",
"description": "Terms and conditions for using our services.",
"body": "{\"blocks\":[{\"key\":\"a1b2c\",\"text\":\"By continuing to use our services, you agree to comply with the terms and conditions stated in this agreement. Please read them carefully before proceeding.\",\"type\":\"unstyled\",\"depth\":0,\"inlineStyleRanges\":[],\"entityRanges\":[],\"data\":{}},{\"key\":\"d3e4f\",\"text\":\"Your consent allows us to provide, improve, and personalize our services according to your preferences and needs.\",\"type\":\"unstyled\",\"depth\":0,\"inlineStyleRanges\":[],\"entityRanges\":[],\"data\":{}}],\"entityMap\":{}}"
}
},
"tenant": "tenant-id-1",
"type": "USER",
"active": true,
"global": false,
"reconsent": true,
"services": [
"service-id-1",
"service-id-2"
]
}

Response Example

{
"content": {
"en": {
"title": "User Agreement",
"description": "Terms and conditions for using our services.",
"body": "{\"blocks\":[{\"key\":\"ab123\",\"text\":\"By using our services, you accept these terms.\",\"type\":\"unstyled\",\"depth\":0,\"inlineStyleRanges\":[],\"entityRanges\":[],\"data\":{}}],\"entityMap\":{}}"
}
},
"services": ["service-id-1", "service-id-2"],
"active": true,
"global": false,
"reconsent": true,
"_id": "agreement-id-1",
"tenant": "tenant-id-1",
"type": "USER",
"created": "2025-11-03T15:35:48.001Z",
"updated": "2025-11-03T15:35:48.001Z",
"__v": 0
}