---
title: "Replace Access Rules on Data Sink"
method: POST
path: "/data_sinks/{data_sink_id}/accessors"
tags: ["Access Control"]
---

# Replace Access Rules on Data Sink

`POST /data_sinks/{data_sink_id}/accessors`

## Request

- Base URL: `https://dataops.nexla.io/nexla-api`
- URL: `https://dataops.nexla.io/nexla-api/data_sinks/{data_sink_id}/accessors`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/nexla/apis/nexla-rest-api/docs/data_sinks/:data_sink_id/accessors/post.ts> (a function with typed inputs; its response is checked against the schema)

Replaces the list of access-control rules set for this data sink. Existing rules will be removed from the data sink, and only these new rules will be applied.

## Path parameters

- `data_sink_id` integer, required

## Request body

- AccessorsRequestSchema
  - `accessors` AccessorsMutable[]
    - union
      - object
        - `type` 'USER': Choose this option if the access permissions should be granted to a user. > Note: Users can belong to multiple organizations. The platform allows granting access permission across organization boundaries only for Nexset `sharer` access role.
        - `id` integer: Unique ID of the user that should be granted this permission.
        - `email` string: `Optional`: Only user-id or email is required to identify the user who should be granted this access permission.
        - `org_id` integer: Users can belong to multiple organizations. Specify the org_id to explicitly set the organization context for this access permission. If this is not specified the platform will try to automatically assign the permission to the user's default organization (when granting sharer access on a Nexset) or to the current organization (for all other access roles).
        - `access_roles` string[]: This property reflects all the permissions the user/team/organization has to this resource. 1. `collaborator`: The user/team/organization can view the resource but not make any modifications to it. 2. `operator`: The user/team/organization can view the resource and can activate/pause it, but not make any other modifications to it. 3. `administrator`: The user/team/organization has complete administrative rights to this resource. 4. `owner`: This user created the resource and so has complete administrative rights to it.
      - object
        - `type` 'TEAM': Choose this option if the access permissions should be granted to a team.
        - `id` integer: Unique ID of the team that should be granted this permission.
        - `access_roles` string[]: This property reflects all the permissions the user/team/organization has to this resource. 1. `collaborator`: The user/team/organization can view the resource but not make any modifications to it. 2. `operator`: The user/team/organization can view the resource and can activate/pause it, but not make any other modifications to it. 3. `administrator`: The user/team/organization has complete administrative rights to this resource. 4. `owner`: This user created the resource and so has complete administrative rights to it.
      - object
        - `type` 'ORG': Choose this option if the access permissions should be granted to an entire organization.
        - `id` integer: Unique ID of the organization that should be granted this permission.
        - `access_roles` string[]: This property reflects all the permissions the user/team/organization has to this resource. 1. `collaborator`: The user/team/organization can view the resource but not make any modifications to it. 2. `operator`: The user/team/organization can view the resource and can activate/pause it, but not make any other modifications to it. 3. `administrator`: The user/team/organization has complete administrative rights to this resource. 4. `owner`: This user created the resource and so has complete administrative rights to it.

## Response `200`

Success

- AccessorsResponseSchema[]
  - union
    - object
      - `type` 'ORG'
      - `email_domain` string
      - `client_identifier` string, nullable
      - `access_roles` string[]: This property reflects all the permissions the user/team/organization has to this resource. 1. `collaborator`: The user/team/organization can view the resource but not make any modifications to it. 2. `operator`: The user/team/organization can view the resource and can activate/pause it, but not make any other modifications to it. 3. `administrator`: The user/team/organization has complete administrative rights to this resource. 4. `owner`: This user created the resource and so has complete administrative rights to it.
      - `created_at` string, date-time
      - `updated_at` string, date-time
    - object
      - `type` 'TEAM'
      - `name` string
      - `access_roles` string[]: This property reflects all the permissions the user/team/organization has to this resource. 1. `collaborator`: The user/team/organization can view the resource but not make any modifications to it. 2. `operator`: The user/team/organization can view the resource and can activate/pause it, but not make any other modifications to it. 3. `administrator`: The user/team/organization has complete administrative rights to this resource. 4. `owner`: This user created the resource and so has complete administrative rights to it.
      - `created_at` string, date-time
      - `updated_at` string, date-time
    - object
      - `type` 'USER'
      - `email` string
      - `access_roles` string[]: This property reflects all the permissions the user/team/organization has to this resource. 1. `collaborator`: The user/team/organization can view the resource but not make any modifications to it. 2. `operator`: The user/team/organization can view the resource and can activate/pause it, but not make any other modifications to it. 3. `administrator`: The user/team/organization has complete administrative rights to this resource. 4. `owner`: This user created the resource and so has complete administrative rights to it.
      - `created_at` string, date-time
      - `updated_at` string, date-time

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found

---

[API](https://skmtc.dev/nexla/apis/nexla-rest-api.md) - [All operations](https://skmtc.dev/nexla/apis/nexla-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nexla/apis/nexla-rest-api/revisions/ef02be92fe7b?raw)
