Skip to content
Navigation

createRepoCustomField

Add a custom field to a custom model: a stored field, or a formula field computed from others.

POST
/repos/{repo_id}/branches/{branch}/custom-models/{model_api_name}/fields

Path parameters

  • repo_id
    string
    required
    pattern: ^repo_[0-7][0-9a-hjkmnp-tv-z]{25}$
  • branch
    string
    required
    minLength: 1
  • model_api_name
    string
    required
    minLength: 1

Request body JSON required

One of the following:

  • PlainFieldDeclaration
    • name
      string
      required
      minLength: 1
    • type
      text
      or
      rich_text
      or
      integer
      or
      decimal
      or
      currency
      or
      percent
      +11 more
      required
    • required
      optional
      boolean
    • unique
      optional
      boolean
    • options
      optional
      array of
      string
      minLength: 1
    • target_model
      optional
      string
      minLength: 1
    • on_delete
      optional

      One of the following:

      • string
    • default_value
      optional

      One of the following:

      • Option 1
      • null
    • formula
      optional
      unknown
    • target_repo
      optional
      string
      pattern: ^repo_[0-7][0-9a-hjkmnp-tv-z]{25}$
  • FormulaFieldDeclaration
    • name
      string
      required
      minLength: 1
    • formula
      string
      required
      minLength: 1
    • required
      optional
      boolean
    • unique
      optional
      boolean
    • type
      optional
      unknown
    • options
      optional
      unknown
    • target_model
      optional
      unknown
    • target_repo
      optional
      unknown
    • on_delete
      optional
      unknown
    • default_value
      optional
      unknown

Returns

201

CustomField

JSON
  • id
    string
    required
    pattern: ^field_[0-7][0-9a-hjkmnp-tv-z]{25}$
  • name
    string
    required
    minLength: 1
  • api_name
    string
    required
    minLength: 1
  • type
    text
    or
    rich_text
    or
    integer
    or
    decimal
    or
    currency
    or
    percent
    +11 more
    required
  • options
    required

    One of the following:

    • array<string>
    • null
  • required
    boolean
    required
  • unique
    boolean
    required
  • target_repo_id
    required

    One of the following:

    • RepoId
    • null
  • target_model_id
    required

    One of the following:

    • TypeId
    • null
  • on_delete
    required

    One of the following:

    • string
    • null
  • default_value
    required

    One of the following:

    • Option 1
    • null
  • formula
    required

    One of the following:

    • string
    • null
  • target_model
    required

    One of the following:

    • string
    • null
  • filter
    object
    required

    How a search takes this field: the operators its type takes, whether sort takes it, and the form its values are written in.

    • operators
      array of
      eq
      or
      ne
      or
      gt
      or
      gte
      or
      lt
      or
      lte
      +13 more
      required
    • sortable
      boolean
      required
    • value_format
      string
      required

400

InvalidRequest | RequestBodyTooDeep
JSON

One of the following:

  • InvalidRequestEncoded
    • _tag
      InvalidRequest
      required
    • part
      path
      or
      query
      or
      headers
      or
      body
      required
    • issues
      array of
      object
      required
      • path
        array of
        required

        One of the following:

        • string
        • integer
      • message
        string
        required
  • RequestBodyTooDeepEncoded
    • _tag
      RequestBodyTooDeep
      required
    • max_depth
      integer
      required
      maximum: 9007199254740991 · minimum: -9007199254740991

401

InvalidCredentials
JSON
  • _tag
    InvalidCredentials
    required

403

Forbidden | ForbiddenOrigin | RequiresPersonalSession | RunBranchRequired
JSON

One of the following:

  • ForbiddenEncoded
    • _tag
      Forbidden
      required
    • message
      string
      required
  • ForbiddenOriginEncoded
    • _tag
      ForbiddenOrigin
      required
  • RequiresPersonalSessionEncoded
    • _tag
      RequiresPersonalSession
      required
  • RunBranchRequiredEncoded
    • _tag
      RunBranchRequired
      required
    • branch
      string
      required
      minLength: 1
    • message
      string
      required

404

BranchNotFound | CustomModelNotFound | RepoNotFound
JSON

One of the following:

  • BranchNotFoundEncoded
    • _tag
      BranchNotFound
      required
    • branch
      string
      required
      minLength: 1
  • CustomModelNotFoundEncoded
    • _tag
      CustomModelNotFound
      required
    • api_name
      string
      required
      minLength: 1
  • RepoNotFoundEncoded
    • _tag
      RepoNotFound
      required

409

InstalledSchemaReadOnly | RepoArchived
JSON

One of the following:

  • InstalledSchemaReadOnlyEncoded
    • _tag
      InstalledSchemaReadOnly
      required
    • extension_installation_id
      string
      required
      pattern: ^extension_installation_[0-7][0-9a-hjkmnp-tv-z]{25}$
  • RepoArchivedEncoded
    • _tag
      RepoArchived
      required

413

WriteTooLarge | RequestBodyTooLarge
JSON

One of the following:

  • WriteTooLargeEncoded
    • _tag
      WriteTooLarge
      required
    • message
      string
      required
  • RequestBodyTooLargeEncoded
    • _tag
      RequestBodyTooLarge
      required
    • max_bytes
      integer
      required
      maximum: 9007199254740991 · minimum: -9007199254740991

422

InvalidCustomModel | WriteRefused
JSON

One of the following:

  • InvalidCustomModelEncoded
    • _tag
      InvalidCustomModel
      required
    • reason
      string
      required
      minLength: 1
  • WriteRefusedEncoded
    • _tag
      WriteRefused
      required
    • violations
      array of
      required

      One of the following:

      • object
        • kind
          required

          One of the following:

          • string
        • model
          string
          required
          minLength: 1
        • field
          string
          required
          minLength: 1
        • reason
          string
          required
          minLength: 1
        • record_ids
          array of
          string
          required
          pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
      • object
        • kind
          required

          One of the following:

          • string
        • model
          string
          required
          minLength: 1
        • field
          string
          required
          minLength: 1
        • reason
          string
          required
          minLength: 1
        • record_ids
          array of
          string
          required
          pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
      • object
        • kind
          required

          One of the following:

          • string
        • model
          string
          required
          minLength: 1
        • field
          string
          required
          minLength: 1
        • record_id
          string
          required
          pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
        • written_by
          ours
          or
          theirs
          required
        • value
          unknown
          required
        • reason
          string
          required
          minLength: 1
      • object
        • kind
          required

          One of the following:

          • string
        • model
          string
          required
          minLength: 1
        • field
          string
          required
          minLength: 1
        • record_id
          string
          required
          pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
        • referenced_model
          required

          One of the following:

          • string
          • null
        • referenced_record_id
          string
          required
          pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
      • object
        • kind
          required

          One of the following:

          • string
        • model
          string
          required
          minLength: 1
        • field
          string
          required
          minLength: 1
        • target_model
          required

          One of the following:

          • string
          • null
        • record_ids
          array of
          string
          required
          pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
      • object
        • kind
          required

          One of the following:

          • string
        • model
          string
          required
          minLength: 1
        • field
          string
          required
          minLength: 1
        • target_model
          required

          One of the following:

          • string
          • null
        • record_ids
          array of
          string
          required
          pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
      • object
        • kind
          required

          One of the following:

          • string
        • model
          string
          required
          minLength: 1
        • field
          string
          required
          minLength: 1
        • record_ids
          array of
          string
          required
          pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
      • object
        • kind
          required

          One of the following:

          • string
        • model
          string
          required
          minLength: 1
        • field
          string
          required
          minLength: 1
        • record_ids
          array of
          string
          required
          pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
      • object
        • kind
          required

          One of the following:

          • string
        • model
          string
          required
          minLength: 1
        • field
          string
          required
          minLength: 1
        • api_name
          string
          required
          minLength: 1
        • record_ids
          array of
          string
          required
          pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
      • object
        • kind
          required

          One of the following:

          • string
        • model
          string
          required
          minLength: 1
        • field
          string
          required
          minLength: 1
        • api_name
          string
          required
          minLength: 1
        • record_ids
          array of
          string
          required
          pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
      • object
        • kind
          required

          One of the following:

          • string
        • model
          string
          required
          minLength: 1
        • field
          string
          required
          minLength: 1
        • name
          string
          required
          minLength: 1
        • record_ids
          array of
          string
          required
          pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
      • object
        • kind
          required

          One of the following:

          • string
        • model
          string
          required
          minLength: 1
        • field
          string
          required
          minLength: 1
        • name
          string
          required
          minLength: 1
        • version
          string
          required
          minLength: 1
        • peer
          string
          required
          minLength: 1
        • range
          string
          required
          minLength: 1
        • peer_version
          required

          One of the following:

          • string
          • null
        • record_ids
          array of
          string
          required
          pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
      • object
        • kind
          required

          One of the following:

          • string
        • model
          string
          required
          minLength: 1
        • field
          string
          required
          minLength: 1
        • record_id
          string
          required
          pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
        • attachment_blob_id
          string
          required
          pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
      • object
        • kind
          required

          One of the following:

          • string
        • model
          string
          required
          minLength: 1
        • field
          string
          required
          minLength: 1
        • reason
          string
          required
          minLength: 1
        • record_ids
          array of
          string
          required
          pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
      • object
        • kind
          required

          One of the following:

          • string
        • reason
          string
          required
          minLength: 1
        • record_ids
          array of
          string
          required
          pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
        • field
          string
          required
          minLength: 1

429

RateLimited
JSON
  • _tag
    RateLimited
    required

500

RepoFailure
JSON
  • _tag
    RepoFailure
    required
  • reason
    string
    required

503

RepoBusy | SessionUnavailable | RateLimitUnavailable
JSON

One of the following:

  • RepoBusyEncoded
    • _tag
      RepoBusy
      required
    • message
      string
      required
  • SessionUnavailableEncoded
    • _tag
      SessionUnavailable
      required
  • RateLimitUnavailableEncoded
    • _tag
      RateLimitUnavailable
      required

Type to search…

↑↓ navigate↵ selectEsc close