Treasure Data API (3)

Access Control - Policies

get Access Control Policies

Retrieves a list of policies.

Request
Security:
ApiKeyAuth
query Parameters
column_permission_tag
string

Return only policies that refer to the specified tag

Responses
200

OK

get/access_control/policies
Request samples
curl -i -X GET \
  https://api.treasuredata.com/v3/access_control/policies \
  -H 'Authorization: TD1 <YOUR_TOKEN_HERE>'
Response samples
application/json
[
  • {
    }
]

Create

Creates a policy.

Request
Security:
ApiKeyAuth
Request Body schema: application/json
required
object
Responses
200

OK

post/access_control/policies
Request samples
application/json
{
  • "policy": {
    }
}
Response samples
application/json
{
  • "id": 67,
  • "account_id": 123,
  • "name": "some_policy",
  • "description": "written about the policy",
  • "user_count": 3
}

Info

Retrieves information about the specified policy.

Request
Security:
ApiKeyAuth
path Parameters
policy_id
required
integer (AccessControlPolicyId)
Example: 67
Responses
200

OK

get/access_control/policies/{policy_id}
Request samples
curl -i -X GET \
  https://api.treasuredata.com/v3/access_control/policies/:policy_id \
  -H 'Authorization: TD1 <YOUR_TOKEN_HERE>'
Response samples
application/json
{
  • "id": 67,
  • "account_id": 123,
  • "name": "some_policy",
  • "description": "written about the policy",
  • "user_count": 3
}

Update

Updates information related to a policy.

Request
Security:
ApiKeyAuth
path Parameters
policy_id
required
integer (AccessControlPolicyId)
Example: 67
Request Body schema: application/json
required
object
Responses
200

OK

patch/access_control/policies/{policy_id}
Request samples
application/json
{
  • "policy": {
    }
}
Response samples
application/json
{
  • "id": 67,
  • "account_id": 123,
  • "name": "some_policy",
  • "description": "written about the policy",
  • "user_count": 3
}

Delete

Deletes a policy.

Request
Security:
ApiKeyAuth
path Parameters
policy_id
required
integer (AccessControlPolicyId)
Example: 67
Responses
200

OK

delete/access_control/policies/{policy_id}
Request samples
curl -i -X DELETE \
  https://api.treasuredata.com/v3/access_control/policies/:policy_id \
  -H 'Authorization: TD1 <YOUR_TOKEN_HERE>'
Response samples
application/json
{
  • "id": 67,
  • "account_id": 123,
  • "name": "some_policy",
  • "description": "written about the policy",
  • "user_count": 3
}

get User Policies

Retrieves a list of policies by user.

Request
Security:
ApiKeyAuth
path Parameters
user_id
required
integer (UserId)
Example: 123
Responses
200

OK

get/access_control/users/{user_id}/policies
Request samples
curl -i -X GET \
  https://api.treasuredata.com/v3/access_control/users/:user_id/policies \
  -H 'Authorization: TD1 <YOUR_TOKEN_HERE>'
Response samples
application/json
[
  • {
    }
]

Update User Policies

Updates policies by user ID.

Request
Security:
ApiKeyAuth
path Parameters
user_id
required
integer (UserId)
Example: 123
Request Body schema: application/json
policy_ids
required
Array of strings
Responses
200

OK

patch/access_control/users/{user_id}/policies
Request samples
application/json
{
  • "policy_ids": [
    ]
}
Response samples
application/json
[
  • {
    }
]

Attach

This operation attaches a policy to a user.

Request
Security:
ApiKeyAuth
path Parameters
user_id
required
integer (UserId)
Example: 123
policy_id
required
integer (AccessControlPolicyId)
Example: 67
Responses
200

OK

post/access_control/users/{user_id}/policies/{policy_id}
Request samples
curl -i -X POST \
  https://api.treasuredata.com/v3/access_control/users/:user_id/policies/:policy_id \
  -H 'Authorization: TD1 <YOUR_TOKEN_HERE>'
Response samples
application/json
{
  • "id": 67,
  • "account_id": 123,
  • "name": "some_policy",
  • "description": "written about the policy",
  • "user_count": 3
}

Detach

Detaches a policy from a user.

Request
Security:
ApiKeyAuth
path Parameters
user_id
required
integer (UserId)
Example: 123
policy_id
required
integer (AccessControlPolicyId)
Example: 67
Responses
200

OK

delete/access_control/users/{user_id}/policies/{policy_id}
Request samples
curl -i -X DELETE \
  https://api.treasuredata.com/v3/access_control/users/:user_id/policies/:policy_id \
  -H 'Authorization: TD1 <YOUR_TOKEN_HERE>'
Response samples
application/json
{
  • "id": 67,
  • "account_id": 123,
  • "name": "some_policy",
  • "description": "written about the policy",
  • "user_count": 3
}

Attach

This operation attaches a policy to a user.

Request
Security:
ApiKeyAuth
path Parameters
policy_id
required
integer (AccessControlPolicyId)
Example: 67
user_id
required
integer (UserId)
Example: 123
Responses
200

OK

post/access_control/policies/{policy_id}/users/{user_id}
Request samples
curl -i -X POST \
  https://api.treasuredata.com/v3/access_control/policies/:policy_id/users/:user_id \
  -H 'Authorization: TD1 <YOUR_TOKEN_HERE>'
Response samples
application/json
{
  • "id": 67,
  • "account_id": 123,
  • "name": "some_policy",
  • "description": "written about the policy",
  • "user_count": 3
}

Detach

Detaches a user from a policy.

Request
Security:
ApiKeyAuth
path Parameters
policy_id
required
integer (AccessControlPolicyId)
Example: 67
user_id
required
integer (UserId)
Example: 123
Responses
200

OK

delete/access_control/policies/{policy_id}/users/{user_id}
Request samples
curl -i -X DELETE \
  https://api.treasuredata.com/v3/access_control/policies/:policy_id/users/:user_id \
  -H 'Authorization: TD1 <YOUR_TOKEN_HERE>'
Response samples
application/json
{
  • "id": 67,
  • "account_id": 123,
  • "name": "some_policy",
  • "description": "written about the policy",
  • "user_count": 3
}
Support
Copyright © 2021 Treasure Data, Inc. (or its affiliates). All rights reserved.