> ## Documentation Index
> Fetch the complete documentation index at: https://help.statisfy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a custom object record

> Creates a record of a Statisfy object (one whose `source` is statisfy in GET /v1/objects). It needs what it belongs to, `account_id` or `contact_id` as the object's `belongs_to` says, and a value for every mandatory field; `external_id` is optional. An `external_id` another record of the object holds on the same account or contact is a 409. What each field takes is in GET /v1/fields?object=<object>: its type, its options, and whether the API may write it (`writable`). A field your CRM fills is written only while Salesforce writeback is on for the object, and can't be cleared here; an object a warehouse or another system fills is read only. Every problem with the body comes back at once, in one 422. Returns the new record.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/objects/{object}/records
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/objects/{object}/records:
    post:
      tags:
        - custom_objects
      summary: Create a custom object record
      description: >-
        Creates a record of a Statisfy object (one whose `source` is statisfy in
        GET /v1/objects). It needs what it belongs to, `account_id` or
        `contact_id` as the object's `belongs_to` says, and a value for every
        mandatory field; `external_id` is optional. An `external_id` another
        record of the object holds on the same account or contact is a 409. What
        each field takes is in GET /v1/fields?object=<object>: its type, its
        options, and whether the API may write it (`writable`). A field your CRM
        fills is written only while Salesforce writeback is on for the object,
        and can't be cleared here; an object a warehouse or another system fills
        is read only. Every problem with the body comes back at once, in one
        422. Returns the new record.
      operationId: custom_objects_create
      parameters:
        - description: The custom object's key, as GET /v1/objects lists it
          in: path
          name: object
          required: true
          schema:
            maxLength: 200
            minLength: 1
            type: string
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: true
              description: >-
                The values plus what only a create sets: what the record belongs
                to, and its id upstream.
              properties:
                account_id:
                  default: null
                  description: >-
                    The account it belongs to, for an object whose records
                    belong to accounts
                  title: Account Id
                  type: string
                contact_id:
                  default: null
                  description: >-
                    The contact it belongs to, for an object whose records
                    belong to contacts
                  title: Contact Id
                  type: string
                external_id:
                  default: null
                  description: >-
                    Its id in your system, unique on its account or contact:
                    what an upsert matches on
                  title: External Id
                  type: string
                fields:
                  anyOf:
                    - additionalProperties: true
                      type: object
                    - type: 'null'
                  default: null
                  description: >-
                    Field keys to values, keyed as GET
                    /v1/fields?object=<object> lists them
                  title: Fields
              type: object
        required: false
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomObjectRecord'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    CustomObjectRecord:
      properties:
        account_id:
          anyOf:
            - type: string
            - type: 'null'
          description: The account it belongs to; null when it belongs to a contact
          title: Account Id
        contact_id:
          anyOf:
            - type: string
            - type: 'null'
          description: The contact it belongs to; null when it belongs to an account
          title: Contact Id
        created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Created At
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Its id in the system that fills the object, such as a Salesforce
            record id
          title: External Id
        fields:
          additionalProperties: true
          description: Its values, keyed as GET /v1/fields?object=<object> lists them
          title: Fields
          type: object
        id:
          title: Id
          type: string
        object:
          description: The custom object's key
          title: Object
          type: string
        updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Updated At
      required:
        - id
        - object
      title: CustomObjectRecord
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.