Request
POST https://app.datumforms.com/api/developer-api
Operation: responses.create
Permissions: responses:create.
Import ordinary responses with group_id, data.reason and data.answers.
Send operation as a query parameter for GET, or a top-level JSON member for POST. Every POST also needs idempotency_key (8–100 permitted characters). Fields marked data belong inside the JSON data object.
| Parameter | Location | Type | Required | Meaning |
|---|---|---|---|---|
group_id |
top level | integer | Yes | Published ordinary collection. |
reason |
data | string | Yes | Nonblank audit reason, up to 1000 characters. |
answers |
data | array | Yes | 1–2000 answer cells with questionRef, value and optional row/col. |
display_name |
data | string | No | Optional display name, up to 255 characters. |
Response
Successful results contain success: true plus these operation fields. Fields returned by shared form and resource services retain their normal definitions.
| Field | Type or shape |
|---|---|
response_id |
integer |
revision |
integer |
See schemas for answer cells, responses and collection details. Use IDs from your project: groups.list returns group IDs, surveys.get returns page/question IDs, and responses.list returns response IDs and revisions.
Examples
Set DATUMFORMS_API_KEY. Replace example IDs with IDs returned by the preceding reads. Replace docs-run-001 with your persisted job identity. Write examples perform the named operation; keep the exact request and identity unchanged when retrying. JavaScript and Python examples use the downloadable clients.
cURL
curl --fail-with-body 'https://app.datumforms.com/api/developer-api' \
-H "Authorization: Bearer $DATUMFORMS_API_KEY" \
-H 'Content-Type: application/json' \
--data '{"operation":"responses.create","group_id":123,"data":{"reason":"Load approved item master","answers":[{"questionRef":456,"value":"ITEM-001"}]},"idempotency_key":"docs-run-001:responses-create"}'
JavaScript
import { request } from './client.mjs';
const result = await request("POST", {
"operation": "responses.create",
"group_id": 123,
"data": {
"reason": "Load approved item master",
"answers": [
{
"questionRef": 456,
"value": "ITEM-001"
}
]
},
"idempotency_key": "docs-run-001:responses-create"
});
console.log(JSON.stringify(result, null, 2));
Python
import json
from client import request
payload = json.loads('{"operation": "responses.create", "group_id": 123, "data": {"reason": "Load approved item master", "answers": [{"questionRef": 456, "value": "ITEM-001"}]}, "idempotency_key": "docs-run-001:responses-create"}')
result = request('POST', payload)
print(json.dumps(result, indent=2))
Pagination and errors
This operation does not use cursor pagination. For 400, check required values and types; for 401, check authentication; for 403, check permissions and project scope; for 404, check the resource ID. For 409, resolve the current revision or review conflict. Retry uncertain writes with the identical request and original key. Managed recruitment responses are protected; use these data-writing operations for ordinary surveys. See error recovery and the operation index.