---
title: "Update Domain by ID"
url: "https://developer.yukisoftware.com/apis/yuki-platform-api-prod-1/versions/1237fe18-1f8f-477a-8f52-b3546dd409bf/operations/updateDomainById"
---

> Full API specification: https://developer.yukisoftware.com/apis/yuki-platform-api-prod-1/versions/1237fe18-1f8f-477a-8f52-b3546dd409bf.md

# Update Domain by ID

`PUT` `/portals/{portal-id}/domains/{domain-id}`

Operation ID: `updateDomainById`

This endpoint allows the modification of an existing domain's details by its ID. Ensure you have the necessary permissions before attempting to update a domain. You should have yukiapi:domain:domains:write and yukiapi:domain:domains:update scopes to access this endpoint. <!-- authorization:start --> **Authorization** Called with a **Portal User** token - an employee of an accounting portal. The caller must hold at least one role from **each** of the following groups: - In the portal: `AccountantManagement`, `Accountant` - `BackofficeManager`, `BackofficeController`, `AccountantManagement` - Enforced at the back-office security level and back-office functions layer. <!-- authorization:end -->

## Path parameters

- `portal-id` (string, required) - The portal id
- `domain-id` (string, required) - The domain name

## Header parameters

- `Authorization` (string, required) - Bearer token for authentication
- `Content-Type` (string, required) - Content type of the request body

## Request body (required)

Content types: `application/json`

## Responses

- `204` - Domain updated successfully.
- `400` - Bad Request
- `401` - Unauthorized
- `403` - Forbidden
- `404` - Not Found
- `500` - Internal Server Error

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Yuki Platform API Prod
  version: 1.0.52
servers:
  - url: https://apirest.yukiworks.com/api/v1
paths:
  /portals/{portal-id}/domains/{domain-id}:
    put:
      x-environments:
        - development
        - pilot
        - production
      x-portal-visibility:
        - internal
        - trusted
        - prod
      x-required-roles:
        - any-of:
            - AccountantManagement
            - Accountant
          scope: portal
        - any-of:
            - BackofficeManager
            - BackofficeController
            - AccountantManagement
          note: Enforced at the back-office security level and back-office functions
            layer.
      summary: Update Domain by ID
      description: >-
        This endpoint allows the modification of an existing domain's details by
        its ID. Ensure you have the necessary permissions before attempting to
        update a domain. You should have yukiapi:domain:domains:write and
        yukiapi:domain:domains:update scopes to access this endpoint.


        <!-- authorization:start -->


        **Authorization**


        Called with a **Portal User** token - an employee of an accounting
        portal.


        The caller must hold at least one role from **each** of the following
        groups:


        - In the portal: `AccountantManagement`, `Accountant`

        - `BackofficeManager`, `BackofficeController`, `AccountantManagement` -
        Enforced at the back-office security level and back-office functions
        layer.


        <!-- authorization:end -->
      operationId: updateDomainById
      tags:
        - Domain
      parameters:
        - $ref: "#/components/parameters/AuthorizationHeader"
        - $ref: "#/components/parameters/ContentTypeHeader"
        - $ref: "#/components/parameters/PortalIdPath"
        - $ref: "#/components/parameters/DomainIdPath"
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateDomain"
      security:
        - vismaConnectPortalUser:
            - yukiapi:domain:domains:write
            - yukiapi:domain:domains:update
      responses:
        "204":
          description: Domain updated successfully.
        "400":
          $ref: "#/components/responses/BadRequestResponse"
        "401":
          $ref: "#/components/responses/UnauthorizedResponse"
        "403":
          $ref: "#/components/responses/ForbiddenResponse"
        "404":
          $ref: "#/components/responses/NotFoundResponse"
        "500":
          $ref: "#/components/responses/InternalServerErrorResponse"
security:
  - vismaConnectPortalUser:
      - yukiapi:domain:domains:write
      - yukiapi:domain:domains:update
components:
  parameters:
    AuthorizationHeader:
      name: Authorization
      in: header
      required: true
      description: Bearer token for authentication
      schema:
        type: string
    ContentTypeHeader:
      name: Content-Type
      in: header
      required: true
      description: Content type of the request body
      schema:
        type: string
        default: application/json
    PortalIdPath:
      name: portal-id
      in: path
      required: true
      description: The portal id
      example: 3afb7b54-6144-4561-9a29-1148006f2375
      schema:
        type: string
    DomainIdPath:
      name: domain-id
      in: path
      required: true
      description: The domain name
      example: 3afb7b54-6144-4561-9a29-1148006f2375
      schema:
        type: string
  schemas:
    UpdateDomain:
      type: object
      properties:
        backOffice:
          $ref: "#/components/schemas/UpdateBackOffice"
      required:
        - backOffice
      additionalProperties: false
      title: UpdateDomain
      description: Schema for updating an existing domain.
    UpdateBackOffice:
      type: object
      description: >
        Back office configuration settings for updating a domain. All fields are
        optional; only the fields that are supplied are updated.
      properties:
        access:
          type: string
          enum:
            - AllEmployees
            - EmployeesBODomain
            - AllEmployeesSupport
            - EmployeesBODomainSupport
          description: >
            Access level for the back office. Determines who can access the back
            office. If omitted, the access level is left unchanged. Possible
            values: - AllEmployees: All employees have access. -
            EmployeesBODomain: Only employees of the BO domain have access. -
            AllEmployeesSupport: All employees have access, including support. -
            EmployeesBODomainSupport: Only employees of the BO domain and
            support have access.
          example: AllEmployees
        responsible:
          type: string
          nullable: true
          description: >
            BO Responsible user ID.

            If value is filled it will be updated, if empty string it will be
            disassociated, and if null no value will be created.
          example: user123
        backup:
          type: string
          nullable: true
          description: >
            BO Backup user ID.

            If value is filled it will be updated, if empty string it will be
            disassociated, and if null no value will be created.
          example: user456
        controller:
          type: string
          nullable: true
          description: >
            BO Controller user ID.

            If value is filled it will be updated, if empty string it will be
            disassociated, and if null no value will be created.
          example: user789
        accountManager:
          type: string
          nullable: true
          description: >
            BO Account manager user ID.

            If value is filled it will be updated, if empty string it will be
            disassociated, and if null no value will be created.
          example: user012
    BadRequestError:
      allOf:
        - $ref: "#/components/schemas/ProblemDetails"
      example:
        type: https://example.com/errors/bad-request
        title: Bad Request
        status: 400
        detail: The request is invalid or malformed.
        instance: /example/bad-request
    UnauthorizedError:
      allOf:
        - $ref: "#/components/schemas/ProblemDetails"
      example:
        type: https://example.com/errors/unauthorized
        title: Unauthorized
        status: 401
        detail: Authentication is required.
        instance: /example/unauthorized
    ForbiddenError:
      allOf:
        - $ref: "#/components/schemas/ProblemDetails"
      example:
        type: https://example.com/errors/forbidden
        title: Forbidden
        status: 403
        detail: You do not have permission to access this resource.
        instance: /example/forbidden
    NotFoundError:
      allOf:
        - $ref: "#/components/schemas/ProblemDetails"
      example:
        type: https://example.com/errors/not-found
        title: Not Found
        status: 404
        detail: The requested resource could not be found.
        instance: /example/not-found
    InternalServerError:
      allOf:
        - $ref: "#/components/schemas/ProblemDetails"
      example:
        type: https://example.com/errors/internal-server-error
        title: Internal Server Error
        status: 500
        detail: An unexpected error occurred.
        instance: /example/internal-server-error
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          example: https://dev.yuki.nl/errors/problem
        title:
          type: string
          example: Problem
        status:
          type: integer
          example: 500
        detail:
          type: string
          example: An unexpected error occurred.
        instance:
          type: string
          example: /example/endpoint
  responses:
    BadRequestResponse:
      description: Bad Request
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/BadRequestError"
    UnauthorizedResponse:
      description: Unauthorized
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/UnauthorizedError"
    ForbiddenResponse:
      description: Forbidden
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/ForbiddenError"
    NotFoundResponse:
      description: Not Found
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/NotFoundError"
    InternalServerErrorResponse:
      description: Internal Server Error
      content:
        application/problem+json:
          schema:
            $ref: "#/components/schemas/InternalServerError"
  securitySchemes:
    vismaConnectPortalUser:
      type: oauth2
      description: >
        Visma Connect token belonging to a **Portal User** - an employee of an
        accounting portal. The token carries a `portal-id` claim, and the portal
        it identifies must match the portal in the route. Unless an endpoint
        says otherwise, the caller's roles are resolved against the portal.
      flows:
        authorizationCode:
          authorizationUrl: https://connect.identity.stagaws.visma.com/connect/authorize
          tokenUrl: https://connect.identity.stagaws.visma.com/connect/token
          scopes:
            yukiapi:domain:companies:read: Allows reading information of a Company
            yukiapi:domain:companies:update: Allows the update of a Company
            yukiapi:portal:portals:read: Allows reading portal information
            yukiapi:domain:domains:read: Allows reading domains information
            yukiapi:domain:domains:write: Allows modifications of domain information, may
              include create/update
            yukiapi:domain:domains:create: Allows the creation of new domains
            yukiapi:domain:domains:update: Allows updating existing domain information
            yukiapi:domain:domains:delete: Allows the deletion of domain data
            yukiapi:domain:users:read: Allows reading of domain user data
            yukiapi:domain:users:write: Allows the update of domain user data, may include create/update
            yukiapi:domain:users:update: Allows updating a Domain User
            yukiapi:domain:users:delete: Allows the deletion of Domain Users
            yukiapi:portal:portals:write: Allows updating existing portal information
            yukiapi:portal:users:read: Allows reading Portal user data
            yukiapi:portal:users:write: Allows the update of Portal user, may include create/update
            yukiapi:portal:users:update: Allows updating an existing Portal User
            yukiapi:portal:users:delete: Allows the deletion of a Portal User
```
