> ## 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

> Creates a custom object, filled by Statisfy: its `key`, its `name`, and whether its records belong to an account or a contact (`belongs_to`). It starts with no fields: add them with POST /v1/fields?object=<key>. The key can't be a standard object's name (a 422) or one another object has, in any case (a 409). Its records are then at /v1/objects/<key>/records. Deleting an object is done in the app.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/objects
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:
    post:
      tags:
        - objects
      summary: Create a custom object
      description: >-
        Creates a custom object, filled by Statisfy: its `key`, its `name`, and
        whether its records belong to an account or a contact (`belongs_to`). It
        starts with no fields: add them with POST /v1/fields?object=<key>. The
        key can't be a standard object's name (a 422) or one another object has,
        in any case (a 409). Its records are then at /v1/objects/<key>/records.
        Deleting an object is done in the app.
      operationId: objects_create
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                belongs_to:
                  description: What each of its records belongs to
                  enum:
                    - account
                    - contact
                  title: Belongs To
                  type: string
                key:
                  description: >-
                    Its key: lowercase letters, digits and underscores, starting
                    with a letter, at most 50 characters. It names the object in
                    every path and prefixes its fields' keys (`<key>__<field>`),
                    so it can't be changed
                  maxLength: 200
                  minLength: 1
                  title: Key
                  type: string
                name:
                  description: The name people see
                  maxLength: 50
                  minLength: 1
                  title: Name
                  type: string
              required:
                - key
                - name
                - belongs_to
              type: object
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectDetail'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    ObjectDetail:
      properties:
        belongs_to:
          anyOf:
            - enum:
                - account
                - contact
              type: string
            - type: 'null'
          description: >-
            A custom object's records each belong to one account, or to one
            contact
          title: Belongs To
        custom:
          description: True for the tenant's own objects, false for the standard ones
          title: Custom
          type: boolean
        fields:
          description: >-
            Its fields, as GET /v1/fields?object=<key> lists them: standard
            first, each kind by key
          items:
            $ref: '#/components/schemas/FieldDef'
          title: Fields
          type: array
        key:
          description: 'Its name on the API: the {object} in /v1/objects/{object}/records'
          title: Key
          type: string
        label:
          title: Label
          type: string
        operations:
          description: >-
            What the API does with its records: list, search and get, and the
            writes it offers
          items:
            type: string
          title: Operations
          type: array
        records:
          description: The path of its records
          title: Records
          type: string
        source:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Who fills a custom object's records: statisfy, or the system it
            syncs from (salesforce, redshift, netsuite …)
          title: Source
      required:
        - key
        - label
        - custom
        - records
        - operations
        - fields
      title: ObjectDetail
      type: object
    FieldDef:
      properties:
        currency_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency Code
        formula:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          description: >-
            Set on a formula field: how its value is computed, in the shape
            `formula` takes on POST /v1/fields
          title: Formula
        hidden:
          default: false
          title: Hidden
          type: boolean
        key:
          title: Key
          type: string
        kind:
          enum:
            - standard
            - custom
          title: Kind
          type: string
        label:
          title: Label
          type: string
        mandatory:
          default: false
          title: Mandatory
          type: boolean
        object:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The object whose id(s) the value holds: set on reference fields (one
            id) and on id lists such as a contact's accounts (type text_list)
          title: Object
        option_labels:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Option Labels
        options:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Options
        owner:
          default: statisfy
          enum:
            - statisfy
            - crm
            - warehouse
            - integration
            - ai
            - computed
          title: Owner
          type: string
        syncs_to_crm:
          default: false
          title: Syncs To Crm
          type: boolean
        type:
          title: Type
          type: string
        writable:
          default: false
          title: Writable
          type: boolean
      required:
        - key
        - label
        - type
        - kind
      title: FieldDef
      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.