Treasure Data Users API

User management

OpenAPI Specification

treasure-data-users-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Treasure Data TD Bulk Import Users API
  description: 'Core REST API for managing databases, tables, jobs, bulk imports, connectors, and users within the Treasure Data Customer Data Platform. Supports Presto and Hive query execution on big data warehouses.

    '
  version: v3
  contact:
    url: https://docs.treasure.ai/apis/td-api
  license:
    name: Treasure Data Terms of Service
    url: https://www.treasure.ai/
servers:
- url: https://api.treasuredata.com/v3
  description: Treasure Data API v3
security:
- TDAuth: []
tags:
- name: Users
  description: User management
paths:
  /user/list:
    get:
      operationId: listUsers
      summary: List users
      description: Returns the list of users in the account.
      tags:
      - Users
      responses:
        '200':
          description: List of users
          content:
            application/json:
              schema:
                type: object
                properties:
                  users:
                    type: array
                    items:
                      $ref: '#/components/schemas/User'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /user/show:
    get:
      operationId: showCurrentUser
      summary: Show current user
      description: Returns information about the currently authenticated user.
      tags:
      - Users
      responses:
        '200':
          description: Current user details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /user/remove/{user_email}:
    post:
      operationId: removeUser
      summary: Remove a user
      description: Deletes the specified user account.
      tags:
      - Users
      parameters:
      - name: user_email
        in: path
        required: true
        schema:
          type: string
          format: email
        description: Email address of the user to remove
      responses:
        '200':
          description: User removed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  email:
                    type: string
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /user/create_with_sso/{user_first_name}:
    post:
      operationId: createUserWithSSO
      summary: Create user with SSO
      description: Allows the admin to create a user with SSO authentication.
      tags:
      - Users
      parameters:
      - name: user_first_name
        in: path
        required: true
        schema:
          type: string
        description: First name of the new user
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - email
              - identifier
              properties:
                email:
                  type: string
                  format: email
                identifier:
                  type: string
      responses:
        '200':
          description: User created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SSOUserResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /user/enforce_sso/{user_email}:
    post:
      operationId: enforceSSOForUser
      summary: Enforce SSO for user
      description: Allows admin to make it mandatory for a user to login with SSO.
      tags:
      - Users
      parameters:
      - name: user_email
        in: path
        required: true
        schema:
          type: string
          format: email
        description: Email address of the user
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SSOUserRequest'
      responses:
        '200':
          description: SSO enforced
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SSOUserResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /user/enable_sso/{user_email}:
    post:
      operationId: enableSSOForUser
      summary: Enable SSO for user
      description: Allows admin to permit a user to login with SSO.
      tags:
      - Users
      parameters:
      - name: user_email
        in: path
        required: true
        schema:
          type: string
          format: email
        description: Email address of the user
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SSOUserRequest'
      responses:
        '200':
          description: SSO enabled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SSOUserResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /user/disable_sso/{user_email}:
    post:
      operationId: disableSSOForUser
      summary: Disable SSO for user
      description: Allows admin to prohibit a user from logging in with SSO.
      tags:
      - Users
      parameters:
      - name: user_email
        in: path
        required: true
        schema:
          type: string
          format: email
        description: Email address of the user
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sso_setting:
                  type: object
                  properties:
                    user_email:
                      type: string
      responses:
        '200':
          description: SSO disabled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SSOUserResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    User:
      type: object
      properties:
        id:
          type: integer
        email:
          type: string
          format: email
        first_name:
          type: string
        last_name:
          type: string
        name:
          type: string
        account_owner:
          type: boolean
        administrator:
          type: boolean
        organization:
          type: string
        roles:
          type: array
          items:
            type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        gravatar_url:
          type: string
        phone:
          type: string
        identifier:
          type: string
    SSOUserResponse:
      type: object
      properties:
        first_name:
          type: string
        email:
          type: string
        identifier:
          type: string
    SSOUserRequest:
      type: object
      properties:
        sso_setting:
          type: object
          properties:
            user_email:
              type: string
            identifier:
              type: string
  responses:
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Resource not found
    Unauthorized:
      description: Authentication required or API key invalid
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
  securitySchemes:
    TDAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Treasure Data API key authentication. Set header value to "TD1 <your-api-key>".

        '