Create record

POST /v1/organisations/{organisation_id}/spaces/{space_id}/collections/{name}/records

Creates a record.

Authentication

Send an API key, or an access token from your organisation’s identity provider, in the Authorization header. How API keys work

Scope the API key needs: records:write

Security schemes in the OpenAPI document: session_cookie (cookie __Host-ivy_session)bearer (bearer)api_key (bearer)

Parameters

  • organisation_id path string required
  • space_id path string required
  • name path string required

Request body

application/json CreateRecord required

  • fields object required

    Values by field key; fields left out get their default.

  • place RecordPlace | null

Responses

  • 201 application/json RecordView

    The record

  • 401 application/json ErrorBody

    unauthenticated

  • 403 application/json ErrorBody

    forbidden: the collection's access.create decides who creates; workspace_content_restricted, invalid_origin, insufficient_scope

  • 404 application/json ErrorBody

    No such space, collection_missing, or collections are off

  • 409 application/json ErrorBody

    collection_full, key_taken: another record has the collection's key value (details.record_id), key_busy, collection_detached, workspace_archived

  • 422 application/json ErrorBody

    validation_failed, per field in field: field_missing, read_only, required, invalid_type, value_unknown, not_a_space_member, file_missing, record_missing, record_too_large, …

  • 429 application/json ErrorBody

    rate_limited: the collection takes 50 writes a second, 200 at once

  • 500 application/json ErrorBody

    internal

  • 503 application/json ErrorBody

    unavailable: the database is briefly unavailable; retry after Retry-After seconds

Error codes

Errors come back as an ErrorBody whose code is one of these.

  • 401 unauthenticated
  • 403 forbiddenworkspace_content_restrictedinvalid_origininsufficient_scope
  • 404 collection_missing
  • 409 collection_fullkey_takenkey_busycollection_detachedworkspace_archived
  • 422 validation_failedread_onlyrequiredinvalid_typevalue_unknownnot_a_space_memberfile_missingrecord_missingrecord_too_large
  • 429 rate_limited
  • 500 internal
  • 503 unavailable

Examples

curl
curl -X POST "$IVY_API_URL/v1/organisations/$ORGANISATION_ID/spaces/$SPACE_ID/collections/$NAME/records" \
  -H "Authorization: Bearer $IVY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"fields":{}}'
JavaScript SDK
import { client, createRecord } from "@spacivapp/ivy-sdk";

client.setConfig({
  baseUrl: process.env.IVY_API_URL,
  headers: { Authorization: `Bearer ${process.env.IVY_API_KEY}` },
});

const { data, error, response } = await createRecord({
  path: { organisation_id: organisationId, space_id: spaceId, name },
  body: {
    fields: {}
  },
});
Example request body
{
  "fields": {},
  "place": {
    "column": "string",
    "view": "string"
  }
}
Example response (201)
{
  "collection": "string",
  "collection_id": "collection_123",
  "created_at": "2026-01-15T09:30:00Z",
  "created_by": {
    "id": "id_123",
    "type": "user"
  },
  "fields": {},
  "id": "id_123",
  "origin": {
    "ask_id": "ask_123",
    "index": 0,
    "kind": "ask",
    "run_id": "run_123"
  },
  "problems": [
    {
      "code": "not_found",
      "field": "string"
    }
  ],
  "ranks": {},
  "revision": 0,
  "schema": "string",
  "source": {
    "provider": "ivy"
  },
  "sync": {
    "conflict": {
      "at": "2026-01-15T09:30:00Z",
      "by": {},
      "fields": []
    },
    "error": {
      "at": "2026-01-15T09:30:00Z",
      "code": "not_found"
    },
    "pending": {
      "at": "2026-01-15T09:30:00Z",
      "base_remote_updated_at": "2026-01-15T09:30:00Z",
      "before": {},
      "by": {},
      "fields": {},
      "write_id": "write_123"
    },
    "remote_updated_at": "2026-01-15T09:30:00Z"
  },
  "updated_at": "2026-01-15T09:30:00Z",
  "updated_by": {
    "id": "id_123",
    "type": "user"
  }
}