Download OpenAPI specification:Download
This is the Form Builder Metadata API documentation.
The application is responsible for storing and serving metadata versions for all the services created by the MoJ Online Form Builder tool.
The code repository can be found here.
In order to interact with the API each request must have a JWT bearer token in the Authorizaion header signed by a private key.
Creates a brand new service
required | object (service) Service schema definition |
{- "metadata": {
- "service_name": "Service Name",
- "created_at": "2020-10-09T11:51:46",
- "created_by": "4634ec01-5618-45ec-a4e2-bb5aa587e751",
- "configuration": {
- "_id": "service",
- "_type": "config.service"
}, - "pages": [
- {
- "_id": "page.start",
- "_type": "page.start",
- "url": "/"
}
], - "locale": "en"
}
}
{- "service_id": "634aa3d5-a3b3-4d0f-9078-bb754542a1d3",
- "service_name": "Service Name",
- "version_id": "ac4b45c5-071e-4d07-b5a2-9f0196a5b267",
- "created_at": "2020-10-09T11:51:46",
- "created_by": "4634ec01-5618-45ec-a4e2-bb5aa587e751",
- "configuration": {
- "_id": "service",
- "_type": "config.service"
}, - "pages": [
- {
- "_id": "page.start",
- "_type": "page.start",
- "url": "/"
}
], - "locale": "en"
}
Updates metadata for a given Service ID with a new version
service_id required | string The Service ID that needs to be updated |
locale | string Optional. The locale of the metadata. Defaults to "en". Could be "cy" |
required | object (service) Service schema definition |
{- "metadata": {
- "service_name": "Service Name",
- "created_at": "2020-10-09T11:51:46",
- "created_by": "4634ec01-5618-45ec-a4e2-bb5aa587e751",
- "configuration": {
- "_id": "service",
- "_type": "config.service"
}, - "pages": [
- {
- "_id": "page.start",
- "_type": "page.start",
- "url": "/"
}
], - "locale": "en"
}
}
{- "service_id": "634aa3d5-a3b3-4d0f-9078-bb754542a1d3",
- "service_name": "Service Name",
- "version_id": "ac4b45c5-071e-4d07-b5a2-9f0196a5b267",
- "created_at": "2020-10-09T11:51:46",
- "created_by": "4634ec01-5618-45ec-a4e2-bb5aa587e751",
- "configuration": {
- "_id": "service",
- "_type": "config.service",
- "attachUserSubmission": true,
- "emailInputNameUser": "moj-online",
- "emailSubjectTeam": "MoJ Online",
- "emailSubjectUser": "MoJ Online",
- "pdfHeading": "Service Name Submission",
- "phase": "beta",
- "phaseText": "This is a new Service."
}, - "global": [
- {
- "_id": "upload.hint.maxsize",
- "_type": "string",
- "description": "Text description",
- "value": "Hello world"
}
], - "modules": {
- "_id": "config.modules",
- "_type": "config.modules",
- "modules": [
- {
- "_id": "config.module.savereturn",
- "_type": "config.module",
- "enabled": "off",
- "module": "savereturn",
- "title": "Save and return"
}
]
}, - "meta": {
- "_id": "config.meta",
- "_type": "config.meta",
- "items": [
- {
- "_id": "config.meta--link--3",
- "_type": "link",
- "href": "/accessibility",
- "text": "Accessibility"
}
]
}, - "standalone": [
- {
- "_id": "page.accessibility",
- "_type": "page.content",
- "body": "A Jedi and a farm boy walk into a cantina . . .",
- "heading": "Accessibility statement for this online form",
- "url": "accessibility"
}
], - "pages": [
- {
- "_id": "page.start",
- "_type": "page.start",
- "body": "Blah blah",
- "lede": "",
- "steps": [
- "page.person-details--2",
- "page.email-address",
- "page.pba-number",
- "page.cop1",
- "page.upload-cop1a",
- "page.upload-cop3",
- "page.upload-cop4",
- "page.urgent-interim-order",
- "page.upload-cop9",
- "page.witness-statement-form",
- "page.upload-cop-24",
- "page.check-answers",
- "page.application-sent"
], - "url": "/"
}, - {
- "_id": "page.person-details--2",
- "_type": "page.form",
- "components": [
- {
- "_id": "page.person-details--2--text.auto_name__1",
- "_type": "text",
- "errors": {
- "required": {
- "any": "Enter the person's first name"
}
}, - "label": "First name",
- "name": "first-name"
}, - {
- "_id": "page.person-details--2--text.auto_name__2",
- "_type": "text",
- "errors": {
- "required": {
- "any": "Enter the person's last name"
}
}, - "label": "Last name",
- "name": "last-name"
}
], - "heading": "The person you're applying to be a deputy for",
- "lede": "The person who can't make decisions at the time they need to be made (they 'lack mental capacity').",
- "show": {
- "identifier": "auto_name__9",
- "operator": "is",
- "value": "Yes"
}, - "url": "name"
}, - {
- "_id": "page.upload-cop1a",
- "_type": "page.singlequestion",
- "components": [
- {
- "_id": "page.upload-cop1a--upload.auto_name__1",
- "_type": "upload",
- "errors": {
- "required": {
- "any": "Select your completed supporting information (COP1A)"
}
}, - "hint": "",
- "label": "Upload your completed supporting information (COP1A)",
- "name": "upload-cop1a"
}
], - "steps": [
- "page.upload-cop1a-check"
], - "url": "upload-cop1a"
}, - {
- "_id": "page.upload-cop1a-check",
- "_type": "page.uploadCheck",
- "heading": "Check your completed supporting information (COP1A) upload",
- "show": {
- "conditionsType": "exactly",
- "exactly": [
- {
- "all": [
- {
- "any": [
- {
- "identifier": "auto_name__37",
- "operator": "defined"
}, - {
- "identifier": "auto_name__27",
- "operator": "defined"
}, - {
- "identifier": "auto_name__30",
- "operator": "defined"
}
], - "conditionsType": "any"
}, - {
- "identifier": "auto_name__15",
- "operator": "is",
- "value": "auto_value__2"
}
], - "conditionsType": "all"
}, - {
- "all": [
- {
- "identifier": "auto_name__37",
- "negated": true,
- "operator": "defined"
}, - {
- "identifier": "auto_name__27",
- "negated": true,
- "operator": "defined"
}, - {
- "identifier": "auto_name__30",
- "negated": true,
- "operator": "defined"
}
]
}
]
}, - "url": "/check-cop1a"
}, - {
- "_id": "page.check-answers",
- "_type": "page.summary",
- "sendBody": "Something something something dark side",
- "sendHeading": "Send your application",
- "show": true,
- "url": "check-answers"
}
], - "locale": "en",
- "locales": [
- {
- "local": "cy",
- "version_id": "ac4b45c5-071e-4d07-b5a2-9f0196a5b267"
}
]
}
Gets all the versions for a Service ID
service_id required | string The Service ID that needs to be updated |
locale | string Optional. The locale of the metadata. Defaults to "en". Could be "cy" |
{- "service_name": "Service Name",
- "service_id": "634aa3d5-a3b3-4d0f-9078-bb754542a1d3",
- "versions": [
- {
- "version_id": "ac4b45c5-071e-4d07-b5a2-9f0196a5b267",
- "created_at": "2020-10-01"
}, - {
- "version_id": "06d18901-f0e2-409a-b2db-e323ce1a16db",
- "created_at": "2020-01-01"
}
]
}
Gets the latest metadata for a given Service ID
service_id required | string The Service ID that needs to be updated |
locale | string Optional. The locale of the metadata. Defaults to "en". Could be "cy" |
{- "service_id": "634aa3d5-a3b3-4d0f-9078-bb754542a1d3",
- "service_name": "Service Name",
- "version_id": "ac4b45c5-071e-4d07-b5a2-9f0196a5b267",
- "created_at": "2020-10-09T11:51:46",
- "created_by": "4634ec01-5618-45ec-a4e2-bb5aa587e751",
- "configuration": {
- "_id": "service",
- "_type": "config.service",
- "attachUserSubmission": true,
- "emailInputNameUser": "moj-online",
- "emailSubjectTeam": "MoJ Online",
- "emailSubjectUser": "MoJ Online",
- "pdfHeading": "Service Name Submission",
- "phase": "beta",
- "phaseText": "This is a new Service."
}, - "global": [
- {
- "_id": "upload.hint.maxsize",
- "_type": "string",
- "description": "Text description",
- "value": "Hello world"
}
], - "modules": {
- "_id": "config.modules",
- "_type": "config.modules",
- "modules": [
- {
- "_id": "config.module.savereturn",
- "_type": "config.module",
- "enabled": "off",
- "module": "savereturn",
- "title": "Save and return"
}
]
}, - "meta": {
- "_id": "config.meta",
- "_type": "config.meta",
- "items": [
- {
- "_id": "config.meta--link--3",
- "_type": "link",
- "href": "/accessibility",
- "text": "Accessibility"
}
]
}, - "standalone": [
- {
- "_id": "page.accessibility",
- "_type": "page.content",
- "body": "A Jedi and a farm boy walk into a cantina . . .",
- "heading": "Accessibility statement for this online form",
- "url": "accessibility"
}
], - "pages": [
- {
- "_id": "page.start",
- "_type": "page.start",
- "body": "Blah blah",
- "lede": "",
- "steps": [
- "page.person-details--2",
- "page.email-address",
- "page.pba-number",
- "page.cop1",
- "page.upload-cop1a",
- "page.upload-cop3",
- "page.upload-cop4",
- "page.urgent-interim-order",
- "page.upload-cop9",
- "page.witness-statement-form",
- "page.upload-cop-24",
- "page.check-answers",
- "page.application-sent"
], - "url": "/"
}, - {
- "_id": "page.person-details--2",
- "_type": "page.form",
- "components": [
- {
- "_id": "page.person-details--2--text.auto_name__1",
- "_type": "text",
- "errors": {
- "required": {
- "any": "Enter the person's first name"
}
}, - "label": "First name",
- "name": "first-name"
}, - {
- "_id": "page.person-details--2--text.auto_name__2",
- "_type": "text",
- "errors": {
- "required": {
- "any": "Enter the person's last name"
}
}, - "label": "Last name",
- "name": "last-name"
}
], - "heading": "The person you're applying to be a deputy for",
- "lede": "The person who can't make decisions at the time they need to be made (they 'lack mental capacity').",
- "show": {
- "identifier": "auto_name__9",
- "operator": "is",
- "value": "Yes"
}, - "url": "name"
}, - {
- "_id": "page.upload-cop1a",
- "_type": "page.singlequestion",
- "components": [
- {
- "_id": "page.upload-cop1a--upload.auto_name__1",
- "_type": "upload",
- "errors": {
- "required": {
- "any": "Select your completed supporting information (COP1A)"
}
}, - "hint": "",
- "label": "Upload your completed supporting information (COP1A)",
- "name": "upload-cop1a"
}
], - "steps": [
- "page.upload-cop1a-check"
], - "url": "upload-cop1a"
}, - {
- "_id": "page.upload-cop1a-check",
- "_type": "page.uploadCheck",
- "heading": "Check your completed supporting information (COP1A) upload",
- "show": {
- "conditionsType": "exactly",
- "exactly": [
- {
- "all": [
- {
- "any": [
- {
- "identifier": "auto_name__37",
- "operator": "defined"
}, - {
- "identifier": "auto_name__27",
- "operator": "defined"
}, - {
- "identifier": "auto_name__30",
- "operator": "defined"
}
], - "conditionsType": "any"
}, - {
- "identifier": "auto_name__15",
- "operator": "is",
- "value": "auto_value__2"
}
], - "conditionsType": "all"
}, - {
- "all": [
- {
- "identifier": "auto_name__37",
- "negated": true,
- "operator": "defined"
}, - {
- "identifier": "auto_name__27",
- "negated": true,
- "operator": "defined"
}, - {
- "identifier": "auto_name__30",
- "negated": true,
- "operator": "defined"
}
]
}
]
}, - "url": "/check-cop1a"
}, - {
- "_id": "page.check-answers",
- "_type": "page.summary",
- "sendBody": "Something something something dark side",
- "sendHeading": "Send your application",
- "show": true,
- "url": "check-answers"
}
], - "locale": "en",
- "locales": [
- {
- "local": "cy",
- "version_id": "ac4b45c5-071e-4d07-b5a2-9f0196a5b267"
}
]
}
Gets a specific version for version ID from a Service ID
service_id required | string The Service ID |
version_id required | string The Version ID |
{- "service_id": "634aa3d5-a3b3-4d0f-9078-bb754542a1d3",
- "service_name": "Service Name",
- "version_id": "ac4b45c5-071e-4d07-b5a2-9f0196a5b267",
- "created_at": "2020-10-09T11:51:46",
- "created_by": "4634ec01-5618-45ec-a4e2-bb5aa587e751",
- "configuration": {
- "_id": "service",
- "_type": "config.service",
- "attachUserSubmission": true,
- "emailInputNameUser": "moj-online",
- "emailSubjectTeam": "MoJ Online",
- "emailSubjectUser": "MoJ Online",
- "pdfHeading": "Service Name Submission",
- "phase": "beta",
- "phaseText": "This is a new Service."
}, - "global": [
- {
- "_id": "upload.hint.maxsize",
- "_type": "string",
- "description": "Text description",
- "value": "Hello world"
}
], - "modules": {
- "_id": "config.modules",
- "_type": "config.modules",
- "modules": [
- {
- "_id": "config.module.savereturn",
- "_type": "config.module",
- "enabled": "off",
- "module": "savereturn",
- "title": "Save and return"
}
]
}, - "meta": {
- "_id": "config.meta",
- "_type": "config.meta",
- "items": [
- {
- "_id": "config.meta--link--3",
- "_type": "link",
- "href": "/accessibility",
- "text": "Accessibility"
}
]
}, - "standalone": [
- {
- "_id": "page.accessibility",
- "_type": "page.content",
- "body": "A Jedi and a farm boy walk into a cantina . . .",
- "heading": "Accessibility statement for this online form",
- "url": "accessibility"
}
], - "pages": [
- {
- "_id": "page.start",
- "_type": "page.start",
- "body": "Blah blah",
- "lede": "",
- "steps": [
- "page.person-details--2",
- "page.email-address",
- "page.pba-number",
- "page.cop1",
- "page.upload-cop1a",
- "page.upload-cop3",
- "page.upload-cop4",
- "page.urgent-interim-order",
- "page.upload-cop9",
- "page.witness-statement-form",
- "page.upload-cop-24",
- "page.check-answers",
- "page.application-sent"
], - "url": "/"
}, - {
- "_id": "page.person-details--2",
- "_type": "page.form",
- "components": [
- {
- "_id": "page.person-details--2--text.auto_name__1",
- "_type": "text",
- "errors": {
- "required": {
- "any": "Enter the person's first name"
}
}, - "label": "First name",
- "name": "first-name"
}, - {
- "_id": "page.person-details--2--text.auto_name__2",
- "_type": "text",
- "errors": {
- "required": {
- "any": "Enter the person's last name"
}
}, - "label": "Last name",
- "name": "last-name"
}
], - "heading": "The person you're applying to be a deputy for",
- "lede": "The person who can't make decisions at the time they need to be made (they 'lack mental capacity').",
- "show": {
- "identifier": "auto_name__9",
- "operator": "is",
- "value": "Yes"
}, - "url": "name"
}, - {
- "_id": "page.upload-cop1a",
- "_type": "page.singlequestion",
- "components": [
- {
- "_id": "page.upload-cop1a--upload.auto_name__1",
- "_type": "upload",
- "errors": {
- "required": {
- "any": "Select your completed supporting information (COP1A)"
}
}, - "hint": "",
- "label": "Upload your completed supporting information (COP1A)",
- "name": "upload-cop1a"
}
], - "steps": [
- "page.upload-cop1a-check"
], - "url": "upload-cop1a"
}, - {
- "_id": "page.upload-cop1a-check",
- "_type": "page.uploadCheck",
- "heading": "Check your completed supporting information (COP1A) upload",
- "show": {
- "conditionsType": "exactly",
- "exactly": [
- {
- "all": [
- {
- "any": [
- {
- "identifier": "auto_name__37",
- "operator": "defined"
}, - {
- "identifier": "auto_name__27",
- "operator": "defined"
}, - {
- "identifier": "auto_name__30",
- "operator": "defined"
}
], - "conditionsType": "any"
}, - {
- "identifier": "auto_name__15",
- "operator": "is",
- "value": "auto_value__2"
}
], - "conditionsType": "all"
}, - {
- "all": [
- {
- "identifier": "auto_name__37",
- "negated": true,
- "operator": "defined"
}, - {
- "identifier": "auto_name__27",
- "negated": true,
- "operator": "defined"
}, - {
- "identifier": "auto_name__30",
- "negated": true,
- "operator": "defined"
}
]
}
]
}, - "url": "/check-cop1a"
}, - {
- "_id": "page.check-answers",
- "_type": "page.summary",
- "sendBody": "Something something something dark side",
- "sendHeading": "Send your application",
- "show": true,
- "url": "check-answers"
}
], - "locale": "en",
- "locales": [
- {
- "local": "cy",
- "version_id": "ac4b45c5-071e-4d07-b5a2-9f0196a5b267"
}
]
}
Gets the Services for a given user ID
user_id required | string The User ID |
{- "services": [
- {
- "service_name": "basset",
- "service_id": "634aa3d5-a3b3-4d0f-9078-bb754542a1d3"
}, - {
- "service_name": "starwars",
- "service_id": "634aa3d5-a3b3-4d0f-9078-bb7545423d1a"
}
]
}