basePath: /v1beta1
definitions:
  api.OpenApiCreateMspCustomerSignupUrlReq:
    properties:
      orgId:
        description: The ID of the MSP.
        example: "123456"
        type: string
    type: object
  api.OpenApiError:
    properties:
      code:
        type: string
      error: {}
      msgPrefix:
        type: string
      status:
        type: integer
    type: object
  api.OpenApiListMspCustomerRsp:
    properties:
      mspCustomers:
        description: The list of matching MSP Customers.
        items:
          $ref: '#/definitions/api.OpenApiMspCustomer'
        type: array
      nextPageToken:
        description: '`next_page_token` can be sent in a subsequent call to fetch
          more results'
        example: 498c7f44-656f-4944-b455-0695faa5d4f9
        type: string
    type: object
  api.OpenApiMspCustomer:
    properties:
      effectedTime:
        description: The effected time of the MSP customer.
        example: "2023-12-06 15:18:13"
        type: string
      email:
        description: The email of the MSP customer.
        example: 123@my.com
        type: string
      expiredTime:
        description: The expired time of the MSP customer.
        example: "2023-12-06 15:18:13"
        type: string
      id:
        description: The ID of the MSP customer.
        example: "123456"
        type: string
      orgId:
        description: The ID of the MSP customer.
        example: "123456"
        type: string
      orgName:
        description: The org name of the MSP customer.
        example: New Org
        type: string
      state:
        description: The state of the MSP customer.
        example: active
        type: string
    type: object
  api.OpenApiMspCustomerSignupUrl:
    properties:
      customerSignupUrl:
        description: The signup URL of the MSP customer.
        example: https://test.com/signup?msp=test&third_party_account_provider=test&third_party_account_token=test
        type: string
      expiredAt:
        description: The expired time of the MSP customer signup url.
        example: "2024-12-06 15:18:13"
        type: string
    type: object
host: msp.tidbapi.com
info:
  contact: {}
  description: This is a account system server for managed service provider (MSP)
    customer.
  title: MSP (Managed Service Provider) Customer OPENAPI
  version: v1beta1
paths:
  /msp/customerSignupUrl:
    post:
      consumes:
      - application/json
      description: This endpoint creates a new signup URL for an MSP customer.
      parameters:
      - description: The MSP customer org ID.
        in: body
        name: mspCustomerOrgId
        required: true
        schema:
          $ref: '#/definitions/api.OpenApiCreateMspCustomerSignupUrlReq'
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/api.OpenApiMspCustomerSignupUrl'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/api.OpenApiError'
      summary: Create a new signup URL for an MSP customer
      tags:
      - Account
  /msp/mspCustomers:
    get:
      consumes:
      - application/json
      description: This endpoint returns a list of MSP customers.
      parameters:
      - description: The page token of the next page.
        in: query
        name: pageToken
        type: string
      - description: The page size of the next page. If `pageSize` is set to 0, it
          returns all MSP customers in one page.
        in: query
        name: pageSize
        type: integer
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/api.OpenApiListMspCustomerRsp'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/api.OpenApiError'
      summary: Get a list of MSP customers
      tags:
      - Account
  /msp/mspCustomers/{customerOrgId}:
    delete:
      consumes:
      - application/json
      description: This endpoint deletes an existing MSP customer.
      parameters:
      - description: The MSP customer org ID.
        in: path
        name: customersOrgId
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/api.OpenApiError'
      summary: Delete an existing MSP customer
      tags:
      - Account
    get:
      consumes:
      - application/json
      description: This endpoint retrieves a single MSP customer by their customer
        org ID.
      parameters:
      - description: The MSP customer org ID.
        in: path
        name: customerOrgId
        required: true
        type: string
      produces:
      - application/json
      responses:
        "200":
          description: OK
          schema:
            $ref: '#/definitions/api.OpenApiMspCustomer'
        "400":
          description: Bad Request
          schema:
            $ref: '#/definitions/api.OpenApiError'
      summary: Retrieve a single MSP customer
      tags:
      - Account
swagger: "2.0"
