You are reading the documentation for an outdated Corteza release. 2024.9 is the latest stable Corteza release.

Create a record

We omit most of the data returned by these endpoints.

We replace the important data with variables, such as $RECORD_ID.

To create a new record, use the POST $ComposeAPI/namespace/$NAMESPACE_ID/module/$MODULE_ID/record API endpoint.

Example request

curl "$ComposeAPI/namespace/$NAMESPACE_ID/module/$MODULE_ID/record/" \
  -H "Authorization: Bearer $JWT" \
  -H 'Content-Type: application/json' \
  --data-binary "{
    \"values\": [
      { \"name\": \"$FIELD1\", \"value\": \"$VALUE1\" },
      { \"name\": \"$FIELD2\", \"value\": \"$VALUE2\" }
    ]
  }";

Example response

{
  "response": {
    "recordID": "$RECORD_ID",
    "moduleID": "$MODULE_ID",
    "namespaceID": "$NAMESPACE_ID",
    "values": [
      { "name": "$FIELD1", "value": "$$VALUE1" },
      { "name": "$FIELD2", "value": "$$VALUE2" },
    ]
  }
}