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

# Update an accounting dimension

> Turn a dimension on or off, rename it, or set the default value new entries are coded with. Required dimensions can't be turned off, and neither they nor `account` can be renamed.



## OpenAPI

````yaml /openapi-v2.json patch /v2/accounting/dimensions/{dimensionKey}
openapi: 3.1.0
info:
  title: Slash Public API V2
  description: >-
    Send money for a Slash legal entity. Every request uses an API key. Transfer
    creation returns a Transfer that links its resulting transactions.
  version: 0.0.1
servers:
  - url: https://api.slash.com
    description: production
security:
  - api_key: []
paths:
  /v2/accounting/dimensions/{dimensionKey}:
    parameters:
      - name: x-legal-entity
        in: header
        required: true
        description: >-
          The legal entity to act on. Required on every request; a user API key
          can act on any legal entity its user has access to.
        schema:
          type: string
          pattern: ^le_[a-zA-Z0-9]+$
      - name: dimensionKey
        in: path
        required: true
        description: A dimension `key` from `GET /v2/accounting/dimensions`.
        schema:
          type: string
    patch:
      summary: Update an accounting dimension
      description: >-
        Turn a dimension on or off, rename it, or set the default value new
        entries are coded with. Required dimensions can't be turned off, and
        neither they nor `account` can be renamed.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/accounting-dimension-update'
            example:
              enabled: false
      responses:
        '200':
          description: The dimension as updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/accounting-dimension'
        '400':
          $ref: '#/components/responses/PublicApiV2Error400AccountingDimensionsUpdate'
        '401':
          $ref: '#/components/responses/PublicApiV2Error401Unauthorized'
        '403':
          $ref: >-
            #/components/responses/PublicApiV2Error403ForbiddenForbiddenLegalEntityNotAvailableUserApiKeyRequired
        '404':
          $ref: '#/components/responses/PublicApiV2Error404AccountingDimensionsUpdate'
        '429':
          $ref: '#/components/responses/PublicApiV2RateLimited'
        '500':
          $ref: '#/components/responses/PublicApiV2Error500Internal'
      security:
        - api_key: []
components:
  schemas:
    accounting-dimension-update:
      title: AccountingDimensionUpdate
      description: >-
        Switch a dimension on or off for coding, rename it, or set the value new
        entries are coded with. Provide any combination of `enabled`, `name` and
        `defaultValueId`; omitted fields keep their current value.
      type: object
      properties:
        connectionId:
          type: string
          description: >-
            The connection the dimension belongs to. Optional when the legal
            entity has exactly one connection; required when it has several.
          example: accounting_connection_2rj4l7hmrrrcv
        enabled:
          type: boolean
          description: >-
            Whether line items can be coded on this dimension. `required`
            dimensions cannot be disabled.
        name:
          type: string
          description: >-
            New display name, shown in the dashboard. `required` dimensions and
            `account` cannot be renamed, and `Account` is reserved as a name.
          minLength: 1
          maxLength: 100
          example: Cost Center
        defaultValueId:
          type: string
          nullable: true
          minLength: 1
          maxLength: 255
          description: >-
            The value entries are coded with when nothing else applies, or
            `null` to stop defaulting. Must be an enabled value of this
            dimension; disabling that value later clears the default.
            `custom_field` dimensions take no default.
          example: accounting_class_2rj4l7hmrrrcv
      additionalProperties: false
    accounting-dimension:
      title: AccountingDimension
      description: >-
        One axis a line item can be coded on: the general-ledger account, a
        vendor, a class, a custom field, and so on. Which dimensions exist
        depends on the connection's platform and settings. Every dimension has
        values, listed at `GET /v2/accounting/dimensions/{dimensionKey}/values`.
      type: object
      properties:
        key:
          type: string
          description: >-
            Stable identifier used in every other accounting endpoint. Platform
            dimensions use fixed keys (`account`, `vendor`, `customer`, `class`,
            `department`, `location`, `project`, `subsidiary`); custom fields
            use `customField:` followed by the field's key; generic dimensions
            use the key defined on the connection.
          example: account
        connectionId:
          type: string
          description: The connection this dimension belongs to.
          example: accounting_connection_2rj4l7hmrrrcv
        name:
          type: string
          description: Display name shown in the dashboard.
          example: Account
        type:
          type: string
          description: >-
            `platform` dimensions are the platform's own objects and their
            values carry that object's id prefix (`accounting_account_`,
            `accounting_vendor_`, ...). `generic` dimensions are stored on the
            connection itself and their values use the `acc_dim_val_` prefix.
            `custom_field` dimensions are platform custom fields exposed through
            the same interface; their values are the field's options, each
            identified by the option value itself.
          enum:
            - platform
            - generic
            - custom_field
        parentKey:
          type: string
          description: >-
            Key of the dimension whose value narrows this one, when the platform
            nests dimensions (for example `cost_code` under `project` on
            Procore). Values can then be filtered by `parentValueId`.
            Hierarchies inside a single dimension, such as sub-accounts or
            sub-classes, are not nesting: those values report their parent in
            `metadata.parentExternalId`.
          example: project
        required:
          type: boolean
          description: >-
            Every editable line item must carry a value for this dimension
            before the entry can sync.
        mappable:
          type: boolean
          description: Whether accounting rules can set this dimension automatically.
        enabled:
          type: boolean
          description: >-
            Whether the dimension is switched on for coding. Disabled dimensions
            are still listed so you can recognize keys that appear on older
            entries.
        defaultValueId:
          type: string
          description: The value new line items receive when none is provided.
          example: accounting_account_2rj4l7hmrrrcv
        customField:
          type: object
          description: >-
            Present on `custom_field` dimensions. Custom fields are not coded
            with value ids: their raw values live in `customFields` on the entry
            (for `entry` level fields) or on each line item (for `line_item`
            level fields), keyed by `fieldKey`. `select` and `multiselect`
            fields list their allowed options as this dimension's values.
          properties:
            fieldKey:
              type: string
              description: The key to use in `customFields`.
              example: cf_cost_center
            fieldType:
              type: string
              description: The type of value the field accepts.
              enum:
                - boolean
                - select
                - string
                - number
                - multiselect
            level:
              type: string
              description: Whether the value is set once per entry or per line item.
              enum:
                - entry
                - line_item
          required:
            - fieldKey
            - fieldType
            - level
          additionalProperties: false
      required:
        - key
        - connectionId
        - name
        - type
        - required
        - mappable
        - enabled
      additionalProperties: false
    PublicApiV2ErrorConnectionIdRequired:
      title: PublicApiV2ErrorConnectionIdRequired
      description: >-
        The legal entity has several accounting connections, so the request must
        say which one with `connectionId`. List them with `GET
        /v2/accounting/connections`.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - connection_id_required
            details:
              type: object
              properties:
                field:
                  type: string
                  description: Dot path of the request field at fault.
                id:
                  type: string
                  description: The identifier that field carried, when it is one.
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorCustomFieldOptionsReadOnly:
      title: PublicApiV2ErrorCustomFieldOptionsReadOnly
      description: >-
        Custom field options are defined on the accounting platform, so they
        cannot be turned on or off or set as a default here. Change them there
        and resync the connection.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - custom_field_options_read_only
            details:
              type: object
              properties:
                dimension:
                  type: string
                  description: The dimension’s name.
                  example: Cost Center
                field:
                  type: string
                  description: Dot path of the request field at fault.
                id:
                  type: string
                  description: The identifier that field carried, when it is one.
              required:
                - dimension
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorDimensionNameReserved:
      title: PublicApiV2ErrorDimensionNameReserved
      description: The name belongs to a built-in dimension.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - dimension_name_reserved
            details:
              type: object
              properties:
                name:
                  type: string
                  description: The name sent.
                  example: account
                field:
                  type: string
                  description: Dot path of the request field at fault.
                id:
                  type: string
                  description: The identifier that field carried, when it is one.
              required:
                - name
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorDimensionNotRenamable:
      title: PublicApiV2ErrorDimensionNotRenamable
      description: >-
        Required dimensions and `account` keep the name the connection gives
        them. Any other optional dimension can be renamed.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - dimension_not_renamable
            details:
              type: object
              properties:
                dimension:
                  type: string
                  description: The dimension’s name.
                  example: Account
                field:
                  type: string
                  description: Dot path of the request field at fault.
                id:
                  type: string
                  description: The identifier that field carried, when it is one.
              required:
                - dimension
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorDimensionRequired:
      title: PublicApiV2ErrorDimensionRequired
      description: Required dimensions are always on.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - dimension_required
            details:
              type: object
              properties:
                dimension:
                  type: string
                  description: The dimension’s name.
                  example: Account
                field:
                  type: string
                  description: Dot path of the request field at fault.
                id:
                  type: string
                  description: The identifier that field carried, when it is one.
              required:
                - dimension
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorDimensionValueDisabled:
      title: PublicApiV2ErrorDimensionValueDisabled
      description: >-
        The value is turned off for coding. Turn it on with `PATCH
        /v2/accounting/dimensions/{dimensionKey}/values/{valueId}`.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - dimension_value_disabled
            details:
              type: object
              properties:
                dimension:
                  type: string
                  description: The dimension’s name.
                  example: Account
                value:
                  type: string
                  description: The value’s name.
                  example: 6100 Software Subscriptions
                field:
                  type: string
                  description: Dot path of the request field at fault.
                id:
                  type: string
                  description: The identifier that field carried, when it is one.
              required:
                - dimension
                - value
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorInvalidRequestShape:
      title: PublicApiV2ErrorInvalidRequestShape
      description: >-
        The body, query, or headers failed validation, or a required header is
        missing. `details` has one entry per failing location, keyed by JSON
        pointer or header name.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - invalid_request
            details:
              type: object
              properties: {}
              additionalProperties:
                type: string
          required:
            - code
            - details
    PublicApiV2ErrorUnauthorized:
      title: PublicApiV2ErrorUnauthorized
      description: API key authentication is missing or invalid.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - unauthorized
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorForbidden:
      title: PublicApiV2ErrorForbidden
      description: >-
        The credential is not permitted to perform this action on the resource.
        When the resource is a field of the request, `details` names that
        `field` and the `id` it received.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - forbidden
            details:
              type: object
              properties:
                field:
                  type: string
                  description: Dot path of the request field at fault.
                id:
                  type: string
                  description: The identifier that field carried, when it is one.
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorForbiddenLegalEntity:
      title: PublicApiV2ErrorForbiddenLegalEntity
      description: The credential is not permitted to act for the selected legal entity.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - forbidden
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorNotAvailable:
      title: PublicApiV2ErrorNotAvailable
      description: >-
        Public API v2 is not yet available. Use [Public API
        v1](https://docs.slash.com/introduction) in the meantime.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - not_available
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorUserApiKeyRequired:
      title: PublicApiV2ErrorUserApiKeyRequired
      description: >-
        The API key is scoped to a legal entity rather than a user. Every v2
        request needs a user API key, created under Settings → API keys in the
        Slash dashboard, together with the `x-legal-entity` header.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - user_api_key_required
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorNotFound:
      title: PublicApiV2ErrorNotFound
      description: >-
        No resource matches the identifier. When the identifier is a field of
        the request, `details` names that `field` and the `id` it received.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - not_found
            details:
              type: object
              properties:
                field:
                  type: string
                  description: Dot path of the request field at fault.
                id:
                  type: string
                  description: The identifier that field carried, when it is one.
              additionalProperties: false
          required:
            - code
            - details
    PublicApiV2ErrorInternal:
      title: PublicApiV2ErrorInternal
      description: >-
        Slash could not complete the request. Quote `referenceId` when
        contacting Slash support.
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            code:
              type: string
              enum:
                - internal
            details:
              type: object
              properties: {}
              additionalProperties: false
          required:
            - code
            - details
    Error:
      type: object
      properties:
        code:
          type: string
          description: >-
            Machine-readable reason; branch on this, not on `message`. Every
            code an endpoint can return is listed on its reference page; the
            ones shared by all endpoints are explained in the Errors guide.
          example: invalid_request
        message:
          type: string
          description: >-
            Human-readable explanation, safe to show to an operator. Wording may
            change; use `code` and `details` programmatically.
        details:
          type: object
          description: >-
            The values behind `message`, keyed per `code`. For example
            `insufficient_funds` carries `available` and `requested`;
            `invalid_request` from contract validation carries one entry per
            failing field, keyed by JSON pointer. Empty when the code has no
            variable data.
          additionalProperties:
            type: string
          example:
            available: $120.00
            requested: $500.00
        referenceId:
          type: string
          description: Unique id of this failure. Quote it when contacting Slash support.
          example: 4001-2alj5if
      required:
        - code
        - message
        - details
        - referenceId
      additionalProperties: false
      title: Error
  responses:
    PublicApiV2Error400AccountingDimensionsUpdate:
      description: >-
        - `connection_id_required` — The legal entity has several accounting
        connections, so the request must say which one with `connectionId`. List
        them with `GET /v2/accounting/connections`.

        - `custom_field_options_read_only` — Custom field options are defined on
        the accounting platform, so they cannot be turned on or off or set as a
        default here. Change them there and resync the connection.

        - `dimension_name_reserved` — The name belongs to a built-in dimension.

        - `dimension_not_renamable` — Required dimensions and `account` keep the
        name the connection gives them. Any other optional dimension can be
        renamed.

        - `dimension_required` — Required dimensions are always on.

        - `dimension_value_disabled` — The value is turned off for coding. Turn
        it on with `PATCH
        /v2/accounting/dimensions/{dimensionKey}/values/{valueId}`.

        - `invalid_request (request shape)` — The body, query, or headers failed
        validation, or a required header is missing. `details` has one entry per
        failing location, keyed by JSON pointer or header name.
      content:
        application/json:
          schema:
            anyOf:
              - title: connection_id_required
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorConnectionIdRequired'
              - title: custom_field_options_read_only
                allOf:
                  - $ref: >-
                      #/components/schemas/PublicApiV2ErrorCustomFieldOptionsReadOnly
              - title: dimension_name_reserved
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorDimensionNameReserved'
              - title: dimension_not_renamable
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorDimensionNotRenamable'
              - title: dimension_required
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorDimensionRequired'
              - title: dimension_value_disabled
                allOf:
                  - $ref: >-
                      #/components/schemas/PublicApiV2ErrorDimensionValueDisabled
              - title: invalid_request (request shape)
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorInvalidRequestShape'
          examples:
            connection_id_required_connection_id:
              summary: connection_id_required (connectionId)
              value:
                code: connection_id_required
                message: >-
                  connectionId is required because this legal entity has more
                  than one accounting connection.
                details:
                  field: connectionId
                  id: accounting_connection_2rj4l7hmrrrcv
                referenceId: 4001-2alj5if
            custom_field_options_read_only_default_value_id:
              summary: custom_field_options_read_only (defaultValueId)
              value:
                code: custom_field_options_read_only
                message: >-
                  Cost Center is a custom field; its options come from the
                  accounting platform and cannot be changed here.
                details:
                  dimension: Cost Center
                  field: defaultValueId
                referenceId: 4001-2alj5if
            dimension_name_reserved_name:
              summary: dimension_name_reserved (name)
              value:
                code: dimension_name_reserved
                message: '"account" is a reserved dimension name.'
                details:
                  name: account
                  field: name
                referenceId: 4001-2alj5if
            dimension_not_renamable_name:
              summary: dimension_not_renamable (name)
              value:
                code: dimension_not_renamable
                message: Account cannot be renamed.
                details:
                  dimension: Account
                  field: name
                referenceId: 4001-2alj5if
            dimension_required_enabled:
              summary: dimension_required (enabled)
              value:
                code: dimension_required
                message: Account is required on this connection and cannot be disabled.
                details:
                  dimension: Account
                  field: enabled
                referenceId: 4001-2alj5if
            dimension_value_disabled_default_value_id:
              summary: dimension_value_disabled (defaultValueId)
              value:
                code: dimension_value_disabled
                message: >-
                  Account value "6100 Software Subscriptions" is disabled on
                  this connection.
                details:
                  dimension: Account
                  value: 6100 Software Subscriptions
                  field: defaultValueId
                referenceId: 4001-2alj5if
            invalid_request_request_shape:
              summary: invalid_request (request shape)
              value:
                code: invalid_request
                message: >-
                  Invalid `connectionId`: Expected a valid ID beginning with
                  "accounting_connection_".
                details:
                  /connectionId: Expected a valid ID beginning with "accounting_connection_".
                referenceId: 4001-2alj5if
    PublicApiV2Error401Unauthorized:
      description: '- `unauthorized` — API key authentication is missing or invalid.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiV2ErrorUnauthorized'
          examples:
            unauthorized:
              summary: unauthorized
              value:
                code: unauthorized
                message: API key authentication is missing or invalid.
                details: {}
                referenceId: 4011-2alj5if
    PublicApiV2Error403ForbiddenForbiddenLegalEntityNotAvailableUserApiKeyRequired:
      description: >-
        - `forbidden` — The credential is not permitted to perform this action
        on the resource. When the resource is a field of the request, `details`
        names that `field` and the `id` it received.

        - `forbidden (legal entity)` — The credential is not permitted to act
        for the selected legal entity.

        - `not_available` — Public API v2 is not yet available. Use [Public API
        v1](https://docs.slash.com/introduction) in the meantime.

        - `user_api_key_required` — The API key is scoped to a legal entity
        rather than a user. Every v2 request needs a user API key, created under
        Settings → API keys in the Slash dashboard, together with the
        `x-legal-entity` header.
      content:
        application/json:
          schema:
            anyOf:
              - title: forbidden
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorForbidden'
              - title: forbidden (legal entity)
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorForbiddenLegalEntity'
              - title: not_available
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorNotAvailable'
              - title: user_api_key_required
                allOf:
                  - $ref: '#/components/schemas/PublicApiV2ErrorUserApiKeyRequired'
          examples:
            forbidden:
              summary: forbidden
              value:
                code: forbidden
                message: This credential is not permitted to do that.
                details: {}
                referenceId: 4031-2alj5if
            forbidden_legal_entity:
              summary: forbidden (legal entity)
              value:
                code: forbidden
                message: This credential is not permitted to do that.
                details: {}
                referenceId: 4031-2alj5if
            not_available:
              summary: not_available
              value:
                code: not_available
                message: >-
                  Public API v2 is not yet available. Use Public API v1
                  (https://docs.slash.com/introduction) in the meantime.
                details: {}
                referenceId: 4031-2alj5if
            user_api_key_required:
              summary: user_api_key_required
              value:
                code: user_api_key_required
                message: >-
                  Public API v2 requires a user API key. Create one under
                  Settings → API keys in the Slash dashboard.
                details: {}
                referenceId: 4031-2alj5if
    PublicApiV2Error404AccountingDimensionsUpdate:
      description: >-
        - `not_found` — No resource matches the identifier. When the identifier
        is a field of the request, `details` names that `field` and the `id` it
        received.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiV2ErrorNotFound'
          examples:
            not_found_connection_id:
              summary: not_found (connectionId)
              value:
                code: not_found
                message: >-
                  `connectionId` accounting_connection_2rj4l7hmrrrcv was not
                  found.
                details:
                  field: connectionId
                  id: accounting_connection_2rj4l7hmrrrcv
                referenceId: 4041-2alj5if
            not_found_dimension_key:
              summary: not_found (dimensionKey)
              value:
                code: not_found
                message: '`dimensionKey` was not found.'
                details:
                  field: dimensionKey
                referenceId: 4041-2alj5if
            not_found_default_value_id:
              summary: not_found (defaultValueId)
              value:
                code: not_found
                message: '`defaultValueId` was not found.'
                details:
                  field: defaultValueId
                referenceId: 4041-2alj5if
    PublicApiV2RateLimited:
      description: >-
        The request exceeded the applicable rate limit. The response body is
        plain text, not the error object; clients must not depend on its
        wording.
      content:
        text/plain:
          schema:
            type: string
          example: You are rate limited
    PublicApiV2Error500Internal:
      description: >-
        - `internal` — Slash could not complete the request. Quote `referenceId`
        when contacting Slash support.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiV2ErrorInternal'
          examples:
            internal:
              summary: internal
              value:
                code: internal
                message: >-
                  An unexpected error occurred. If this keeps happening, contact
                  Slash support with the reference id below.
                details: {}
                referenceId: 5001-2alj5if
  securitySchemes:
    api_key:
      type: apiKey
      name: X-API-Key
      in: header
      description: >-
        User API key authentication. Create a key under Settings → API keys in
        the Slash dashboard (https://app.slash.com/global-settings/api-keys) and
        send the `x-legal-entity` header naming the legal entity to act on with
        every request. Keys scoped to a legal entity are rejected with `403
        user_api_key_required`.

````

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