Treasure Data API v3

The provider-published Treasure Data API v3 — 79 operations across databases, tables, query jobs, schedules, result connections, access-control policies and policy groups, users and delegated admins. Harvested verbatim from the OpenAPI description Treasure AI publishes on its documentation site.

OpenAPI Specification

treasure-data-td-api-v3-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Treasure Data API
  version: '3'
servers:
  - url: https://api.treasuredata.com/v3
  - url: https://api.treasuredata.co.jp/v3
  - url: https://api.ap02.treasuredata.com/v3
  - url: https://api.eu01.treasuredata.com/v3
security:
  - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: TD1
  schemas:
    AnyValue:
      description: Can be any value, including `null`.
      anyOf:
        - type: string
          nullable: true
        - type: number
        - type: integer
        - type: boolean
        - type: array
          items:
            $ref: '#/components/schemas/AnyValue'
        - type: object
    EmptyObject:
      type: object
      additionalProperties: false
    EmptyString:
      type: string
      pattern: ^$
    HexValue:
      type: string
      pattern: '[0-9a-f]+'
      example: 2ac30b788fd813e9ac7a3af9d395e109
    DomainKey:
      type: string
      example: domain_key_123
    IdempotentKey:
      type: string
    DateTimeISO8601:
      description: >-
        Datetime in ISO 8601 format (`2020-12-31T11:22:33-05:00` or
        `2020-12-31T11:22:33Z` for UTC)
      type: string
      pattern: \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(([+-]\d{2}:\d{2})|Z)
      example: '2020-12-31T11:22:33Z'
    DateTimeAsString:
      description: >-
        Datetime in custom format (`2020-12-31 11:22:33 -0500` or `2020-12-31
        11:22:33 UTC` for UTC)
      type: string
      pattern: \d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}\s(([+-]\d{2}\d{2})|UTC)
      example: 2020-12-31 11:22:33 UTC
    Timestamp:
      type: integer
      example: 1356998400
    ErrorResponse:
      title: Error Response
      description: A generic error response
      type: object
      additionalProperties: false
      required:
        - error
        - message
        - text
        - severity
        - status_code
      properties:
        error:
          type: string
          example: error
        message:
          type: string
          example: message
        severity:
          type: string
          example: error
        text:
          type: string
          example: text
        status_code:
          type: integer
          example: 422
    PaginatedResult:
      description: Paginated records and pagination metadata.
      type: object
      additionalProperties: false
      required:
        - data
        - pagination
      properties:
        data:
          description: Array of paginated records.
          type: array
          items:
            type: object
        pagination:
          description: Pagination metadata.
          type: object
          additionalProperties: false
          required:
            - next_page
          properties:
            next_page:
              description: URL to the next page. `null` means there is no next page.
              type: string
              nullable: true
              example: /resources?page[after]=eyJpZCI6IjEyMyJ9
    Timezone:
      type: string
      example: UTC
    AccessControlProfileOptions:
      title: Access Control Profile Options
      description: >-
        A map of profile option keys to their resolved values. A value is null
        when the option is unset and has no default. Returned both by the list
        endpoint (all keys) and by the single-option endpoint (one key).
      type: object
      additionalProperties:
        type: string
        nullable: true
    AccessControlProfileOptionUpdateRequest:
      title: Access Control Profile Option Update Request
      description: >-
        The value to set for the profile option (e.g. "full_access" for
        treasure_ai_studio).
      type: object
      required:
        - value
      properties:
        value:
          type: string
    AccessControlColumnPermission:
      type: object
      additionalProperties: false
      required:
        - tags
      properties:
        tags:
          type: array
          items:
            type: string
        except:
          type: boolean
          nullable: true
        masking:
          type: string
          enum:
            - hash
          nullable: true
    AccessControlPermission:
      type: object
      additionalProperties: false
      required:
        - id
        - permission_set_id
        - resource_type
        - filter_expression
        - filter_operator
        - filter_value
        - can_create
        - can_read
        - can_update
        - can_delete
        - can_execute
        - custom_operation
      properties:
        id:
          type: integer
        permission_set_id:
          type: integer
        resource_type:
          type: string
        filter_expression:
          type: string
        filter_operator:
          type: string
        filter_value:
          type: string
        can_create:
          type: boolean
        can_read:
          type: boolean
        can_update:
          type: boolean
        can_delete:
          type: boolean
        can_execute:
          type: boolean
        custom_operation:
          type: string
    CreateAccessControlPolicyRequest:
      type: object
      additionalProperties: false
      required:
        - policy
      properties:
        policy:
          type: object
          additionalProperties: false
          required:
            - name
          properties:
            name:
              $ref: '#/components/schemas/AccessControlPolicy/properties/name'
            description:
              $ref: '#/components/schemas/AccessControlPolicy/properties/description'
    CreateAccessControlPolicyGroupRequest:
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        name:
          $ref: '#/components/schemas/AccessControlPolicyGroup/properties/name'
    UpdateAccessControlPolicyRequest:
      type: object
      additionalProperties: false
      required:
        - policy
      properties:
        policy:
          type: object
          additionalProperties: false
          properties:
            name:
              $ref: '#/components/schemas/AccessControlPolicy/properties/name'
            description:
              $ref: '#/components/schemas/AccessControlPolicy/properties/description'
    UpdateAccessControlPolicyGroupRequest:
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        name:
          $ref: '#/components/schemas/AccessControlPolicyGroup/properties/name'
        description:
          $ref: '#/components/schemas/AccessControlPolicyGroup/properties/description'
    UpdateAccessControlPolicyGroupPoliciesRequest:
      type: object
      additionalProperties: false
      required:
        - policy_ids
      properties:
        policy_ids:
          $ref: >-
            #/components/schemas/AccessControlPolicyGroupPolicies/properties/policy_ids
    UpdateAccessControlPoliciesRequest:
      type: object
      additionalProperties: false
      required:
        - policy_ids
      properties:
        policy_ids:
          type: array
          items:
            type: string
          example:
            - '1'
            - '2'
            - '42'
    UpdateAccessControlPolicyUsersRequest:
      type: object
      additionalProperties: false
      required:
        - user_ids
      properties:
        user_ids:
          type: array
          items:
            $ref: '#/components/schemas/UserId'
    AccessControlUnpaidPermissions:
      title: Access Control Permissions
      type: object
      additionalProperties: false
      properties:
        WorkflowProject:
          description: Permissions on resource
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - view
                  - run
                  - edit
        Segmentation:
          description: Permissions on resource
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - full
        MasterSegmentConfigs:
          description: Permissions on resource
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - view
                  - edit
        MasterSegmentConfig:
          description: Permissions on resource
          type: array
          items:
            type: object
            required:
              - operation
              - id
            properties:
              operation:
                type: string
                enum:
                  - view
                  - edit
              id:
                type: string
                example: '42'
        SegmentAllFolders:
          description: Permissions on resource
          type: array
          items:
            type: object
            required:
              - operation
              - audience_id
            properties:
              operation:
                type: string
                enum:
                  - view
                  - edit
              audience_id:
                type: string
                example: '42'
        SegmentFolder:
          description: Permissions on resource
          type: array
          items:
            type: object
            required:
              - operation
              - id
            properties:
              operation:
                type: string
                enum:
                  - view
                  - edit
              id:
                type: string
                example: '42'
        ActivationTemplate:
          description: Permissions on ActivationTemplate
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - view
                  - full
                  - template_access
    AccessControlPermissions:
      title: Access Control Permissions
      type: object
      additionalProperties: false
      properties:
        WorkflowProject:
          description: Permissions on resource
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - view
                  - run
                  - edit
        WorkflowProjectLevel:
          description: Permissions on resource
          type: array
          items:
            type: object
            required:
              - operation
              - name
            properties:
              operation:
                type: string
                enum:
                  - view
                  - run
                  - edit
              name:
                type: string
                example: my_wf
        WorkflowRestrictedOperators:
          description: Permissions on resource
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - edit
        Segmentation:
          description: Permissions on resource
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - full
        PersonalizationStudio:
          description: Permissions on resource
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - full
        MasterSegmentConfigs:
          description: Permissions on resource
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - view
                  - edit
                  - owner_manage
        MasterSegmentConfig:
          description: Permissions on resource
          type: array
          items:
            type: object
            required:
              - operation
              - id
            properties:
              operation:
                type: string
                enum:
                  - view
                  - edit
              id:
                type: string
                example: '42'
        MasterSegmentColumn:
          description: Permissions on MasterSegmentColumn
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - view_clear
                  - view_pii
                  - blocked
              column_identifiers:
                type: string
                description: comma-separated audience_id and column_name
                example: 1$attribute.customers.age,1$attribute.customers.first_name
        MasterSegmentAllColumns:
          description: Permissions on MasterSegmentAllColumns
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - view_clear
                  - view_pii
                  - blocked_only_for_migration_purpose
              audience_id:
                type: string
                description: audience_id
                example: '1'
        CookieConsent:
          description: Permissions on CookieConsent
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - view
                  - edit
                  - full
        SegmentAllFolders:
          description: Permissions on resource
          type: array
          items:
            type: object
            required:
              - operation
              - audience_id
            properties:
              operation:
                type: string
                enum:
                  - view
                  - edit
              audience_id:
                type: string
                example: '42'
        SegmentFolder:
          description: Permissions on resource
          type: array
          items:
            type: object
            required:
              - operation
              - id
            properties:
              operation:
                type: string
                enum:
                  - view
                  - edit
              id:
                type: string
                example: '42'
        Profiles:
          description: Permissions on resource
          type: array
          items:
            type: object
            required:
              - operation
              - audience_id
            properties:
              operation:
                type: string
                enum:
                  - view
              audience_id:
                type: string
                example: '42'
        ProfilesApiToken:
          description: Permissions on resource
          type: array
          items:
            type: object
            required:
              - operation
              - audience_id
            properties:
              operation:
                type: string
                enum:
                  - full
              audience_id:
                type: string
                example: '42'
        ActivationTemplate:
          description: Permissions on ActivationTemplate
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - view
                  - full
                  - template_access
        Authentications:
          description: Permissions on resource
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - use_limited
                  - use
                  - full
                  - owner_manage
              ids:
                type: string
                description: >-
                  comma-separated IDs of authentications, required when
                  `operation = 'use_limited'`
                example: 1,2,3
        Sources:
          description: Permissions on resource
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - restricted
                  - full
        Destinations:
          description: Permissions on resource
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - restricted
                  - full
        Databases:
          description: Permissions on databases
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - query
                  - edit
                  - import
                  - manage
                  - owner_manage
                  - download
              ids:
                type: string
                description: >-
                  comma-separated IDs of databases, required when operation is
                  `query`, `edit`, and `import`
                example: 1,2,3
        UniversalConsent:
          description: Permissions on UniversalConsent
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - full
        TrafficControls:
          description: Permissions on TrafficControl
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - full
                  - view
        TrafficControl:
          description: Permissions on TrafficControl
          type: array
          items:
            type: object
            required:
              - operation
              - audience_id
            properties:
              operation:
                type: string
                enum:
                  - full
                  - view
              audience_id:
                type: string
                example: '42'
        Journeys:
          description: Permissions on Journeys
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - full
                  - edit
                  - view
        Journey:
          description: Permissions on Journeys in the audience
          type: array
          items:
            type: object
            required:
              - operation
              - audience_id
            properties:
              operation:
                type: string
                enum:
                  - full
                  - edit
                  - view
              audience_id:
                type: string
                example: '42'
        LlmProject:
          description: Permissions on LLM Projects
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - full
                  - edit
                  - chat
                  - publish_internal_integration
                  - publish_external_integration
              project_id:
                type: string
                description: >-
                  IDs of LLM Project, required when operation is `edit`, `chat`,
                  `publish_internal_integration` and
                  `publish_external_integration`
                example: '1'
        RawDataAccess:
          description: Permissions on Raw Data Access for Audience Studio
          type: array
          items:
            type: object
            required:
              - operation
            properties:
              operation:
                type: string
                enum:
                  - query
              audience_id:
                type: string
                description: >-
                  ID of the Audience (MasterSegmentConfig) to grant raw data
                  access
                example: '123'
    AccessControlPolicyId:
      type: integer
      example: 67
    AccessControlPolicyGroupId:
      type: integer
      example: 10
    AccessControlPolicyGroupTaggableName:
      type: string
      description: Policy Group's taggable name
      example: some_policy_group
    AccessControlPolicy:
      title: Access Control Policy
      type: object
      additionalProperties: false
      required:
        - id
        - account_id
        - name
      properties:
        id:
          $ref: '#/components/schemas/AccessControlPolicyId'
        account_id:
          $ref: '#/components/schemas/AccountId'
        name:
          description: Policy's name
          type: string
          example: some_policy
        description:
          description: Policy's description
          type: string
          example: written about the policy
        user_count:
          description: The number of users which the policy attaches to
          type: integer
          example: 3
    AccessControlPolicyGroup:
      title: Access Control Policy Group
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        id:
          $ref: '#/components/schemas/AccessControlPolicyGroupId'
        account_id:
          $ref: '#/components/schemas/AccountId'
        name:
          description: Policy Group's name
          type: string
          example: some_policy_group
        taggable_name:
          $ref: '#/components/schemas/AccessControlPolicyGroupTaggableName'
        description:
          description: Policy Group's description
          type: string
          example: some_policy_group_description
          nullable: true
        policy_count:
          description: Policy Group's policy count
          type: integer
          example: 1
        created_at:
          description: when the policy group was created
          type: string
          format: date-time
          example: '2012-01-01T12:00:00Z'
        updated_at:
          description: when policy group was updated
          type: string
          format: date-time
          example: '2012-01-01T12:00:00Z'
    AccessControlPolicyGroupPolicies:
      title: Access Control Policy Group Policies
      type: object
      additionalProperties: false
      required:
        - policy_ids
      properties:
        policy_ids:
          description: Policy Group's Policies
          type: array
          items:
            $ref: '#/components/schemas/AccessControlPolicyId'
    AccessControlUser:
      title: Access Control User
      type: object
      additionalProperties: false
      required:
        - user_id
        - account_id
        - permissions
      properties:
        user_id:
          $ref: '#/components/schemas/UserId'
        account_id:
          $ref: '#/components/schemas/AccountId'
        permissions:
          $ref: '#/components/schemas/AccessControlPermissions'
        policies:
          type: array
          items:
            $ref: '#/components/schemas/AccessControlPolicy'
    AccessControlUserReference:
      title: Access Control User Reference
      type: object
      additionalProperties: false
      required:
        - user_id
        - account_id
        - email
        - name
      properties:
        user_id:
          $ref: '#/components/schemas/UserId'
        account_id:
          $ref: '#/components/schemas/AccountId'
        email:
          $ref: '#/components/schemas/User/properties/email'
        name:
          $ref: '#/components/schemas/User/properties/name'
    PayingAccount:
      title: Account
      description: account
      type: object
      additionalProperties: false
      required:
        - id
        - plan_id
        - guaranteed_maps
        - max_maps
        - guaranteed_reduces
        - max_reduces
        - max_queued_tasks
        - max_concurrent_jobs
        - resource_pools
      properties:
        id:
          $ref: '#/components/schemas/AccountId'
        plan_id:
          description: the plan id
          type: integer
          example: 123
        guaranteed_maps:
          description: the guaranteed number of maps
          type: integer
          example: 3
        max_maps:
          description: the max number of maps
          type: integer
          example: 5
        guaranteed_reduces:
          description: the guaranteed number of reduces
          type: integer
          example: 3
        max_reduces:
          description: the max number of reduces
          type: integer
          example: 5
        max_queued_tasks:
          description: the max number of queued tasks
          type: integer
          example: 10
        max_concurrent_jobs:
          description: the max number of concurrent jobs
          type: integer
          example: 5
        resource_pools:
          type: array
          items:
            type: object
    AccountId:
      type: integer
      example: 123
    Account:
      title: Account
      description: account
      type: object
      additionalProperties: false
      required:
        - id
        - created_at
        - encrypt_start_at
        - guaranteed_cores
        - maximum_cores
        - plan
        - presto_plan
        - storage_size
      properties:
        id:
          $ref: '#/components/schemas/AccountId'
        created_at:
          $ref: '#/components/schemas/DateTimeISO8601'
        encrypt_start_at:
          anyOf:
            - nullable: true
              type: string
            - $ref: '#/components/schemas/DateTimeISO8601'
        guaranteed_cores:
          description: the guaranteed number of maps
          type: integer
          example: 3
        maximum_cores:
          description: the max number of maps
          type: integer
          example: 5
        plan:
          description: the plan id
          type: integer
          example: 123
        presto_plan:
          description: the presto plan id
          type: integer
          example: 123
        storage_size:
          description: the storage size
          type: integer
          nullable: true
          example: 1000
    ClusterType:
      description: the cluster type
      type: string
      example: hdp2
    ApiKey:
      title: Api Key
      description: api key
      type: object
      required:
        - type
        - name
        - value
      properties:
        type:
          description: Api Key type
          type: string
          enum:
            - master
            - write
            - write-only
          example: master
        name:
          description: Api Key name
          type: string
          nullable: true
          example: ABC Key
        value:
          description: the actual Api key value
          type: string
          example: 123/456789xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    BulkImportPartName:
      type: string
      example: part_1
    BulkImportReference:
      type: object
      required:
        - bulk_import
        - name
      properties:
        bulk_import:
          $ref: '#/components/schemas/BulkImport/properties/name'
        name:
          $ref: '#/components/schemas/BulkImport/properties/name'
        job_id:
          $ref: '#/components/schemas/JobId'
    BulkImport:
      type: object
      additionalProperties: false
      required:
        - database
        - error_parts
        - error_records
        - name
        - status
        - table
        - upload_frozen
        - valid_parts
        - valid_records
      properties:
        database:
          anyOf:
            - $ref: '#/components/schemas/Database/properties/name'
            - nullable: true
              type: string
        error_parts:
          type: integer
          nullable: true
        error_records:
          type: integer
          nullable: true
        name:
          type: string
        status:
          type: string
        table:
          anyOf:
            - $ref: '#/components/schemas/Table/properties/name'
            - nullable: true
              type: string
        upload_frozen:
          type: boolean
          nullable: true
          example: true
        valid_parts:
          type: integer
          nullable: true
        valid_records:
          type: integer
          nullable: true
    CreateBulkLoadRequest:
      title: CreateBulkLoadRequest
      allOf:
        - $ref: '#/components/schemas/CreateOrUpdateJobRequest'
        - type: object
          additionalProperties: false
          required:
            - in_settings
          properties:
            in_settings:
              anyOf:
                - type: string
                - type: object
                  additionalProperties: false
                  required:
                    - bucket
                    - path_prefix
                  properties:
                    bucket:
                      description: bucket name
                      type: string
                      example: bucket_A
                    path_prefix:
                      type: string
                      example: /logs
                    parser:
                      type: object
                      additionalProperties: false
                      properties:
                        type:
                          type: string
                          enum:
                            - csv
                        columns:
                          type: array
                          items:
                            type: object
                            additionalProperties: false
                            required:
                              - name
                              - type
                            properties:
                              name:
                                type: string
                                example: user
                              type:
                                type: string
                                example: string
            out_settings:
              anyOf:
                - type: string
                - type: object
                  properties:
                    mode:
                      type: string
                      enum:
                        - append
                        - replace
            filter_settings:
              anyOf:
                - type: string
                - type: array
                  items:
                    type: object
                    additionalProperties: true
                    required:
                      - type
                    properties:
                      type:
                        type: string
                        description: The filter plugin type
                        example: rename
                    example:
                      type: add_time
                      to_column: 

# --- truncated at 32 KB (137 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/treasure-data/refs/heads/main/openapi/treasure-data-td-api-v3-openapi.yml