Teable
Quick Start
Create Records
Path
POST /table/{tableId}/record
Request
Path Parameters
- tableId (string): The unique identifier of the table.
Request Body
- records (required)
- Description: Array of records to create
- Type: Array
- Example:
- Note: Each record is an item containing a
fields
object. Thefields
object contains field names and their corresponding values. Each field type has a different value structure, see Record Field Value Types for details.
- fieldKeyType (optional)
- Description: Specifies the type of field key
- Type: String
- Possible values:
- “name”: Use field name as key
- “id”: Use field ID as key
- Example:
"name"
or"id"
- Note: If not specified, field name is used as key by default.
- Usage:
- When set to “name”:
- When set to “id”:
- When set to “name”:
- typecast (optional)
- Description: Whether to automatically convert field value types. By default, strict validation is enforced, requiring input values to match the current field’s data type. If enabled, the system will attempt automatic conversion.
- Type: Boolean
- Possible values: true or false
- Example:
true
- Note: If set to true, the system will attempt to convert input values to the correct field value type.
- Usage examples:
- Link field: Can directly use primary key text for linking
- Date field: Can use non-standard format date strings
- User field: Can directly use username
- Link field: Can directly use primary key text for linking
- order (optional)
- Description: Specifies the position of new records in a specific view
- Type: Object
- Properties:
- viewId
- Description: View ID (how to get)
- Type: String
- Example:
"viwABCDEFGHIJKLMN"
- anchorId
- Description: Anchor record ID (how to get)
- Type: String
- Example:
"rec123456789ABCDE"
- position
- Description: Position relative to the anchor record
- Type: String
- Possible values:
- “before”: Before the anchor record
- “after”: After the anchor record
- Example:
"after"
- viewId
- Complete example:
- Note: Using order allows precise control of new record positions in a specific view.
Response
Success Response
- Status code: 201 Created
- Response body: Returns the created record data.
Example Response Body
Error Responses
- Status code: 400 Bad Request: Request body format error or missing required fields.
- Status code: 404 Not Found: Specified tableId does not exist.