---
title: "PUT /tables/{table_pk}/datasets"
method: PUT
path: "/tables/{table_pk}/datasets"
tags: ["Planning Table"]
---

# PUT /tables/{table_pk}/datasets

`PUT /tables/{table_pk}/datasets`

Table-anchored nested resource for a Planning Table's datasets.

A dataset is never addressed by its own id here: the route is keyed on the parent table
(`table_pk`) and a dataset is identified by (table, scenario_id from the request). Hence
`get_queryset`/`get_object` return the parent `PlanningTable` (access control -- sharing
scheme and `created_by` -- lives on the table), while the actions query `PlanningTableDataset`
rows directly.

Consequence for `permission_classes`: model-derived primitives (`ModelPermissions`,
`UserHasModelShared`) resolve `model_name` from the queryset, so they check `*_planningtable`
perms, NOT `*_planningtabledataset`. Only the hardcoded `SpecificModelPermissions` /
`EditSharedPermissions` target the dataset model. That is why the expression below mixes
table-level and dataset-level permissions.

## Path parameters

- `table_pk` integer, required

## Headers

- `X-Company-ID` string, required

## Response `200`

No response body

---

[API](https://skmtc.net/cubesoftware/apis/cube-api.md) · [All operations](https://skmtc.net/cubesoftware/apis/cube-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cubesoftware/cube-api/revisions/67d9f45bb99b/schema)
