kintone developer network

Add Record (POST)

Follow

Add RecordPOST /record.json

Adds 1 record to an app.
URI
https://{subdomain}.kintone.com/k/v1/record.json
URI for Guest Space Apps
https://{subdomain}.kintone.com/k/guest/{SpaceID}/v1/record.json

Request Parameters

PARAMETER VALUE REQUIRED DESCRIPTION
app Integer Yes The app ID.
record Object Optional Field codes and values are specified in this object.
If ignored, the record will be added with default field values.
If field codes that don't exist are specified, these will be ignored.
For field type specs, check the Field Types page. 

Request Body

For an app with 2 fields

{
    "app": (APP ID),
    "record": {
        "(FIELD CODE 1)": {
            "value": (FIELD VALUE)
        },
        "(FIELD CODE 2)": {
            "value": (FIELD VALUE)
        }
    }
}

For an app that includes a table

{
    "app": (APP ID),
    "record": {
        "(FIELD CODE)": {
            "value": (FIELD VALUE)
        },
        "(FIELD CODE OF TABLE)": {
            "value": [
                {
                    "value": {
                        "(FIELD CODE)": {
                            "value": (FIELD VALUE)
                        }
                    }               
                }
            ]
        }
    }
}

Sample Request

Request Header

POST /k/v1/record.json HTTP/1.1
Host: example.kintone.com:443
X-Cybozu-Authorization: a2ludG9uZTpkZXZlbG9wZXI=
Content-Type: application/json

Body

When adding a record to an app with an app number of 777:

FIELD TYPE FIELD CODE VALUE
Single-line text singletext test
Multi-line text multitext kintone\ntest
Number num 7
Date and time datetime 2015-04-15T07:22:00Z
Check box check check1, check2
User selection user john-d (*the log in name)
Drop-down dropdown Choice 1
Link link_web https://www.kintone.com
Table table  
Single-line text within the table table_singletext Chocolate Pudding
{
    "app": 777,
    "record": {
        "singletext": {
            "value": "test"
        },
        "multitext": {
            "value": "kintone\ntest"
        },
        "num": {
            "value": "7"
        },
        "datetime": {
            "value": "2015-04-15T07:22:00Z"
        },
        "check": {
            "value": [
                "check1",
                "check2"
            ]
        },
        "user": {
            "value": [
                {
                    "code": "john-d"
                }
            ]
        },
        "dropdown": {
            "value": "Choice 1"
        },
        "link_web": {
            "value": "https://www.kintone.com"
        },
        "table": {
            "value": [
                {
                    "value": {
                        "table_singletext": {
                            "value": "Chocolate Pudding"
                    }
                }
            ]
        }
    }
}

Sample Response

The Record ID and the revision will be returned.

{
    "id": "100"
    "revision": "1"
}

Add RecordsPOST /records.json

Adds multiple records to an app.
URI
https://{subdomain}.kintone.com/k/v1/records.json
URI for Guest Space Apps
https://{subdomain}.kintone.com/k/guest/{SpaceID}/v1/records.json

Request Parameters

PARAMETER VALUE REQUIRED DESCRIPTION
app Integer Yes The app ID.
records Array Yes Holds an array of record objects.
record Object Optional Field codes and values are specified in this object.
If ignored, the record will be added with default field values.
If field codes that don't exist are specified, these will be ignored.
For field type specs, check the Field Types page. 
{
    "app": (APP ID),
    "records": [
        {   // First record data
            "(FIELD CODE 1)": {
                "value": (FIELD VALUE)
            },
            "(FIELD CODE 2)": {
                "value": (FIELD VALUE)
            },
            :
        },
        {   // Second record data
            "(FIELD CODE 1)": {
                "value": (FIELD VALUE)
            },
            "(FIELD CODE 2)": {
                "value": (FIELD VALUE)
            },
            :
        },
        :
        {   // nth record data
            :
        }
    ]
}

Sample Request

When adding 2 records to an app with an app number of 777:

1st record

FIELD TYPE FIELD CODE VALUE
Rich text rich_editor test1
User selection user_select john-d

2nd record

FIELD TYPE FIELD CODE VALUE
Rich text rich_editor test2
User selection user_select jane-r
{
    "app": 777,
    "records": [
        {
            "rich_editor": {
                "value": "test1"
            },
            "user_select": {
                "value": [
                    {
                        "code": "john-d"
                    }
                ]
            }
        },
        {
            "rich_editor": {
                "value": "test2"
            },
            "user_select": {
                "value": [
                    {
                        "code": "jane-r"
                    }
                ]
            }
        }
    ]
}

Sample Response

The Record IDs and revisions will be returned.

{
	"ids": ["77","78"]
    "revisions": ["1","1"]
}

Limitations

You must have permission to add records to the app.
You must have permission to Edit values of the fields of the app.
To add values to the following fields, you must be the admin of the app:

  • Created by
  • Updated by
  • Created datetime
  • Updated datetime

If there are fields with the "Required field" option turned on, those fields must be included in the request.

Values cannot be added to the following fields.

  • The Field Mappings targets of the Lookup field
  • Status
  • Categories
  • Calculated
  • Assignee

For other limitations, please check the Limitations on this page.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request
Comments