Replace a form
const url = 'https://api.ebitex.io/forms/management/v1/forms/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"externalId":"example","name":"example","actions":["example"],"steps":["example"],"rowVersion":1,"saveSubmissionEnabled":true,"submitterFieldKey":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.ebitex.io/forms/management/v1/forms/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "externalId": "example", "name": "example", "actions": [ "example" ], "steps": [ "example" ], "rowVersion": 1, "saveSubmissionEnabled": true, "submitterFieldKey": "example" }'Replaces a form with a whole new definition, sending back the rowVersion of your last read. Changing a form that is Active or Archived is a publish and needs the publish scope; the externalId of a form that is not a draft cannot change.
Call it from your own server with a Forms management key (Settings > Management keys in the Forms app); it has no CORS policy, so a browser page cannot use it, and a key restricted to origins is refused. To render a form in an application, or to submit one, use @ebitex/forms-sdk and the public submit URL: this API builds, publishes and reads forms and never submits. A key has one access level, and each includes the one below: read reads forms, their versions and the grammar (GET /describe); write also creates, updates and restores draft forms; publish also changes a form’s status and changes a form that is live or archived. Two more scopes are chosen on their own: submissions reads what respondents submitted (personal data) and erase deletes forms and submissions. A key is bound to a role when it is made and acts as that role: what it may do is its scopes AND that role’s permissions, and a form the role’s access rules deny it is not visible to the key. A role that can administer form access cannot be bound. A form has no draft copy, so changing the content of a form that is not a draft is a publish and needs the publish scope. A form’s externalId is part of its public address and cannot change once the form is not a draft. Every update must send the rowVersion of your last read of the form. Each key’s budget is 300 requests a minute. Writes count against the organization’s plan limits exactly as a person’s do.
Key: a Forms management key with write or publish access (forms.management.write). A form that is not a draft also needs forms.management.publish.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Examplegenerated
{ "externalId": "example", "name": "example", "actions": [ "example" ], "steps": [ "example" ], "rowVersion": 1, "saveSubmissionEnabled": true, "submitterFieldKey": "example"}Responses
Section titled “ Responses ”OK
validation_failed.
missing_api_key or invalid_api_key: no key was sent, or it is unknown, revoked or expired.
scope_denied: the key’s scopes do not admit the route. permission_denied: the key’s role lacks the permission the action needs. role_bypasses_access_rules: the role the key is bound to can administer form access. scope_denied (naming forms.management.publish): the form is not a draft. quota_exceeded.
scope_denied: the key lacks this route’s scope. origin_denied or ip_denied: a browser-safe key was used from an origin or address outside its restrictions. app_not_available: Content is not enabled for the organization.
No such form, or one the key’s role may not see.
concurrency_conflict: the rowVersion is stale. external_id_locked. duplicate_external_id.
row_version_required: the body has no rowVersion.
Quota exceeded; Retry-After says how long to wait. too_many_failed_authentications: too many bad keys from this address.