Records Management

Create a new record

Creates a new record for the specified object type.

You can also create one or more child records in the same request, in either of two ways:

  1. Nest the child in the request body — alongside the parent's fields, include a key named after the child object (its singular name, e.g. contact) whose value is an object of that child's fields. The parent link field is populated automatically, and each nested child is validated alongside the parent. For example, a POST /api/accounts body of {"Name": "Acme", "contact": {"First": "Jane", "Last": "Doe", "email": "jane@acme.com"}} creates the account and its contact in a single request. Several different child objects may be nested at once.

  2. Address the parent in the URL — POST /api/{objectNames}/{recordId}/{childObjectName} (e.g. /api/accounts/95/contacts) creates a child record under an existing parent record.

When nested children are supplied, any child validation failure returns a 422 with the errors keyed by the child object name, and no records are persisted.

post/api/{objectNames}/{recordId}/{childObjectName}

Request

  • Base URL: https://api.reallysimplesystems.com
  • URL: https://api.reallysimplesystems.com/api/{objectNames}/{recordId}/{childObjectName}
  • Auth: HTTP bearer

Request body

datastring required

The record data to be created, as a flat object of field names and values.

{childObject}object

Optional. To create a child record together with the parent, include a key named after the child object (its singular name — for example, replace {childObject} with contact) whose value is an object of that child's fields. The parent link is set for you. Multiple different child objects may be nested in the same request.

Example request

{
  "data": "{\"salutation\": \"Mr\", \"first\": \"Test Contact API\", \"last\": \"Test\", \"email\": \"test@example.com\", \"accountid\": 95}",
  "{childObject}": {
    "First": "Jane",
    "Last": "Doe",
    "email": "jane@acme.com"
  }
}

Response

statusstring
messagestring

Example response

{
  "status": "success",
  "message": "Contact created successfully.",
  "data": {
    "metadata": {
      "url": "https://local.reallysimplesystems.com/api/contact/1",
      "list_url": "https://local.reallysimplesystems.com/api/contacts",
      "parent": null,
      "object_type": "record",
      "record_type": "contact"
    },
    "record": {
      "salutation": "Mr",
      "accountid": "95",
      "first": "Test Contact API",
      "last": "Test",
      "email": "test@test.com"
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.