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

# Update a data point type

> Updates a data point type. Only the fields sent are changed. Renaming the slug also rewrites it in the active model versions and node expressions that reference it. `PUT` behaves the same. Requires the `read:project` and `write:data_point_type` token scopes.



## OpenAPI

````yaml PATCH /projects/{project_id}/data_point_types/{data_point_type_id}
openapi: 3.1.0
info:
  title: Mangrove - API
  version: 1.1.0
  description: >
    ## Filtering and sorting


    List endpoints that accept `filter` take one query parameter per condition,
    written `filter[field][comparator]=value`, for example
    `filter[name][contains]=North`. The comparators are `eq`, `neq`, `gt`,
    `geq`, `lt`, `leq` and `contains`, and `filter[field]=value` is short for
    `eq`. Conditions combine with AND. `contains` matches part of the value, is
    case-sensitive, and applies only to text fields. An unknown field or
    comparator, a value that doesn't fit the field's type, or a list or object
    as the value returns 400 with a message naming the problem. Each list
    operation names its filterable fields; some take only `eq`, and say so.


    `sort` takes a comma-separated list of fields, for example
    `sort=-created_at,name`. Each field sorts ascending, or descending with a
    `-` prefix. Unknown sort fields are ignored. Sorting by `id` orders by the
    record's internal ID, not its friendly ID. Each list operation names its
    sortable fields.
servers:
  - url: https://app.gomangrove.com/api/v1
security:
  - sec0: []
paths:
  /projects/{project_id}/data_point_types/{data_point_type_id}:
    patch:
      summary: Update a data point type
      description: >-
        Updates a data point type. Only the fields sent are changed. Renaming
        the slug also rewrites it in the active model versions and node
        expressions that reference it. `PUT` behaves the same. Requires the
        `read:project` and `write:data_point_type` token scopes.
      operationId: update-data-point-type
      parameters:
        - $ref: '#/components/parameters/ProjectId'
        - $ref: '#/components/parameters/DataPointTypeId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - data_point_type
              properties:
                data_point_type:
                  type: object
                  properties:
                    name:
                      type: string
                    slug:
                      type: string
                      description: >-
                        Lowercase letters, digits, `-` and `_`, unique within
                        the project.
                    description:
                      type: string
                    value_type:
                      type: string
                      enum:
                        - number
                        - string
                        - boolean
                        - enumeration
                      description: '`enumeration` needs an event type.'
                    unit:
                      type: string
                      description: >-
                        Kept only for the `number` type and cleared for any
                        other.
                    nexus_event_type_id:
                      type: string
                      description: >-
                        The friendly ID of the event type to move this data
                        point type to (e.g. `et_aBcD1234eFgH5678`). An ID
                        outside the project returns 422.
                    is_required:
                      type: boolean
                      description: >-
                        Must be omitted when the data point type has no event
                        type.
                    evidence_check_enabled:
                      type: boolean
                    order:
                      type: integer
                      description: Position among the event type's data point types.
                    reusable_in_batches:
                      type: boolean
                    enumeration_options:
                      type: array
                      items:
                        type: string
                      description: >-
                        Full replacement of the allowed values (enumeration type
                        only). Options still used by existing data points cannot
                        be removed.
                    uncertainty_attributes:
                      type: object
                      description: >-
                        Uncertainty applied to this data point type's values in
                        model runs. Send the existing uncertainty's `id` to
                        change it, or `_destroy` with it to remove it. Not
                        returned in the response.
                      properties:
                        id:
                          type: integer
                        value:
                          type: number
                          description: Must be greater than 0.
                        value_type:
                          type: string
                          enum:
                            - percentage
                            - absolute
                        conservative_direction:
                          type:
                            - string
                            - 'null'
                          enum:
                            - plus
                            - minus
                            - null
                        _destroy:
                          type: boolean
            examples:
              Request Example:
                value:
                  data_point_type:
                    name: Mass of Feedstock Delivered
                    unit: t
      responses:
        '200':
          description: The updated data point type.
          content:
            application/json:
              example:
                id: dpt_aBcD1234eFgH5678
                slug: feedstock-delivery-mass
                name: Mass of Feedstock Delivered
                description: null
                value_type: number
                unit: t
                is_static: false
                nexus_event_type_id: et_aBcD1234eFgH5678
                is_required: true
                evidence_check_enabled: false
                reusable_in_batches: true
                enumeration_options: null
                rules: []
                created_at: '2025-02-03T14:19:11.787Z'
                updated_at: '2025-02-04T09:00:00.000Z'
              schema:
                $ref: '#/components/schemas/DataPointType'
        '400':
          $ref: '#/components/responses/MissingParameter'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          description: >-
            Validation failed, or the event type is not in this project.
            Messages only, with no `field` or `code`.
          content:
            application/json:
              examples:
                Unknown event type:
                  value:
                    errors:
                      - message: >-
                          nexus_event_type_id is invalid or does not belong to
                          this project
                Option in use:
                  value:
                    errors:
                      - message: >-
                          Enumeration options cannot remove options that are in
                          use by existing datapoints: Grade C
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    ProjectId:
      name: project_id
      in: path
      required: true
      description: The project's friendly ID (e.g. `prj_aBcD1234eFgH5678`).
      schema:
        type: string
    DataPointTypeId:
      name: data_point_type_id
      in: path
      required: true
      description: The data point type's friendly ID (e.g. `dpt_aBcD1234eFgH5678`).
      schema:
        type: string
  schemas:
    DataPointType:
      type: object
      properties:
        id:
          type: string
          description: The data point type's friendly ID (e.g. `dpt_aBcD1234eFgH5678`).
          example: dpt_aBcD1234eFgH5678
        slug:
          type:
            - string
            - 'null'
        name:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        value_type:
          type: string
          enum:
            - number
            - string
            - boolean
            - enumeration
        unit:
          type:
            - string
            - 'null'
        is_static:
          type: boolean
        nexus_event_type_id:
          type:
            - string
            - 'null'
          description: The friendly ID of the event type this data point type belongs to.
          example: et_aBcD1234eFgH5678
        is_required:
          type:
            - boolean
            - 'null'
          description: Null for a data point type with no event type.
        evidence_check_enabled:
          type: boolean
        reusable_in_batches:
          type: boolean
        enumeration_options:
          type:
            - array
            - 'null'
          items:
            type: string
        rules:
          type: array
          description: >-
            Rules whose active version references this data point type's slug,
            ordered by name.
          items:
            type: object
            properties:
              id:
                type: string
                example: rule_aBcD1234eFgH5678
              name:
                type: string
              rule_type:
                type: string
                enum:
                  - alert
                  - substitution
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      required:
        - errors
      properties:
        errors:
          type: array
          items:
            type: object
            required:
              - message
            properties:
              message:
                type: string
                description: Human-readable error message
              field:
                type: string
                description: Attribute the error applies to (validation errors only)
              code:
                type: string
                description: Machine-readable error code (validation errors only)
              blocking:
                type: array
                description: >-
                  Bounded preview of the records blocking a destroy
                  (blocked-destroy errors only)
                items:
                  $ref: '#/components/schemas/DeletionBlockingRecord'
              blocking_count:
                type: integer
                description: >-
                  Total count of records blocking a destroy (blocked-destroy
                  errors only)
              config_key:
                type: string
                description: >-
                  The data feed source config setting to fix, when the error is
                  on `config` (data feed source validation errors only)
              count:
                type: number
                description: >-
                  The limit or comparison value the failed validation checked
                  against, e.g. a maximum length or a numeric bound (validation
                  errors only, when the validation has one)
              value:
                description: >-
                  The rejected value, e.g. on an inclusion or uniqueness failure
                  (validation errors only, when the validation reports one)
    DeletionBlockingRecord:
      type: object
      required:
        - type
      properties:
        type:
          type: string
        friendly_id:
          type: string
        name:
          type:
            - string
            - 'null'
          description: >-
            Display label, and the only identifier for records that have no
            friendly_id
  responses:
    MissingParameter:
      description: >-
        A required parameter or body object is missing or empty. The message
        names it.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            errors:
              - message: 'param is missing or the value is empty or invalid: project'
    Unauthorized:
      description: >-
        The API token is missing, invalid or expired. The body is empty, except
        for an expired token, which returns the error below.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            errors:
              - message: API token has expired
    Forbidden:
      description: >-
        The token lacks the scope the operation's description names, or a
        condition the description states applies, such as a feature that isn't
        enabled for your account.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            errors:
              - message: You are not authorized to perform this action
    NotFound:
      description: >-
        A resource named in the path doesn't exist in your account, or the token
        can't see it.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            errors:
              - message: Record not found
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: Authorization
      x-bearer-format: ''

````

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