Tradeshift Admin API

The Admin API from Tradeshift — 11 operation(s) for admin.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

tradeshift-admin-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: MCP HTTP Bridge & Management Admin API
  version: 0.1.0
tags:
- name: Admin
paths:
  /api/admin/auth/config:
    get:
      summary: Auth Config
      description: 'Public endpoint returning Okta configuration for the frontend SPA.

        No authentication required — these are public OIDC public-client (PKCE)

        values that are necessarily exposed in the browser to begin the login flow.

        The redirect URI is intentionally NOT returned: the SPA derives it from

        its own origin, so it never needs to be served to unauthenticated callers.'
      operationId: auth_config_api_admin_auth_config_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
      tags:
      - Admin
  /api/admin/me:
    get:
      summary: Admin Me
      operationId: admin_me_api_admin_me_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
      tags:
      - Admin
  /api/admin/keys:
    get:
      summary: List Keys
      operationId: list_keys_api_admin_keys_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
      tags:
      - Admin
    post:
      summary: Create Key
      operationId: create_key_api_admin_keys_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiKeyCreate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Admin
  /api/admin/keys/{key_id}:
    patch:
      summary: Update Key
      operationId: update_key_api_admin_keys__key_id__patch
      parameters:
      - name: key_id
        in: path
        required: true
        schema:
          type: string
          title: Key Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ApiKeyUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Admin
    delete:
      summary: Deactivate Key
      operationId: deactivate_key_api_admin_keys__key_id__delete
      parameters:
      - name: key_id
        in: path
        required: true
        schema:
          type: string
          title: Key Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Admin
  /api/admin/logs:
    get:
      summary: List Logs
      operationId: list_logs_api_admin_logs_get
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          default: 30
          title: Limit
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          default: 0
          title: Offset
      - name: key_name
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Key Name
      - name: tool_name
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Tool Name
      - name: tenant_id
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant Id
      - name: auth_type
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Auth Type
      - name: date_from
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Date From
      - name: date_to
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Date To
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Admin
  /api/admin/action-logs:
    get:
      summary: List Admin Action Logs
      description: List admin action audit logs (who changed what on API keys and OAuth clients).
      operationId: list_admin_action_logs_api_admin_action_logs_get
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          default: 50
          title: Limit
      - name: offset
        in: query
        required: false
        schema:
          type: integer
          default: 0
          title: Offset
      - name: user_email
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: User Email
      - name: action
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Action
      - name: resource_type
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Resource Type
      - name: date_from
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Date From
      - name: date_to
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Date To
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Admin
  /api/admin/oauth-clients:
    get:
      summary: List Oauth Clients
      description: List all OAuth clients.
      operationId: list_oauth_clients_api_admin_oauth_clients_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
      tags:
      - Admin
    post:
      summary: Create Oauth Client
      description: Create new OAuth client.
      operationId: create_oauth_client_api_admin_oauth_clients_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OAuthClientCreate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Admin
  /api/admin/oauth-clients/{client_id}:
    patch:
      summary: Update Oauth Client
      description: Update an OAuth client's configuration.
      operationId: update_oauth_client_api_admin_oauth_clients__client_id__patch
      parameters:
      - name: client_id
        in: path
        required: true
        schema:
          type: string
          title: Client Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OAuthClientUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Admin
    delete:
      summary: Deactivate Oauth Client
      description: Deactivate an OAuth client.
      operationId: deactivate_oauth_client_api_admin_oauth_clients__client_id__delete
      parameters:
      - name: client_id
        in: path
        required: true
        schema:
          type: string
          title: Client Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Admin
  /api/admin/tenant-credentials/{tenant_id}/rotate:
    put:
      summary: Rotate Tenant Credentials
      description: Rotate OAuth1 credentials for a tenant.
      operationId: rotate_tenant_credentials_api_admin_tenant_credentials__tenant_id__rotate_put
      parameters:
      - name: tenant_id
        in: path
        required: true
        schema:
          type: string
          title: Tenant Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TenantCredentialRotate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Admin
  /api/admin/tenant-credentials/validate:
    post:
      summary: Validate Credentials
      description: Validate OAuth1 credentials without storing them.
      operationId: validate_credentials_api_admin_tenant_credentials_validate_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TenantCredentialValidate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Admin
  /api/admin/session:
    post:
      summary: Create Session
      description: Create a UI session. Validates an Okta token (or dev-mode flag) and sets a session
        cookie.
      operationId: create_session_api_admin_session_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SessionCreate'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
      - Admin
    delete:
      summary: Destroy Session
      description: Clear the UI session cookie.
      operationId: destroy_session_api_admin_session_delete
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
      tags:
      - Admin
components:
  schemas:
    SessionCreate:
      properties:
        token:
          anyOf:
          - type: string
          - type: 'null'
          title: Token
        dev_mode:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Dev Mode
          default: false
      type: object
      title: SessionCreate
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    OAuthClientUpdate:
      properties:
        allowed_domains:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Allowed Domains
        token_lifetime:
          anyOf:
          - type: integer
          - type: 'null'
          title: Token Lifetime
      type: object
      title: OAuthClientUpdate
    OAuthClientCreate:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
          - type: string
          - type: 'null'
          title: Description
        allowed_domains:
          items:
            type: string
          type: array
          title: Allowed Domains
        token_lifetime:
          anyOf:
          - type: integer
          - type: 'null'
          title: Token Lifetime
          default: 3600
        tenant_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant Id
        ts_consumer_key:
          anyOf:
          - type: string
          - type: 'null'
          title: Ts Consumer Key
        ts_consumer_secret:
          anyOf:
          - type: string
          - type: 'null'
          title: Ts Consumer Secret
        ts_access_token:
          anyOf:
          - type: string
          - type: 'null'
          title: Ts Access Token
        ts_token_secret:
          anyOf:
          - type: string
          - type: 'null'
          title: Ts Token Secret
      type: object
      required:
      - name
      - allowed_domains
      title: OAuthClientCreate
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ApiKeyUpdate:
      properties:
        allowed_domains:
          anyOf:
          - items:
              type: string
            type: array
          - type: 'null'
          title: Allowed Domains
      type: object
      title: ApiKeyUpdate
    ApiKeyCreate:
      properties:
        name:
          type: string
          title: Name
        agent_name:
          type: string
          title: Agent Name
        allowed_domains:
          items:
            type: string
          type: array
          title: Allowed Domains
        rate_limit:
          anyOf:
          - type: integer
          - type: 'null'
          title: Rate Limit
          default: 100
        tenant_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Tenant Id
        ts_consumer_key:
          anyOf:
          - type: string
          - type: 'null'
          title: Ts Consumer Key
        ts_consumer_secret:
          anyOf:
          - type: string
          - type: 'null'
          title: Ts Consumer Secret
        ts_access_token:
          anyOf:
          - type: string
          - type: 'null'
          title: Ts Access Token
        ts_token_secret:
          anyOf:
          - type: string
          - type: 'null'
          title: Ts Token Secret
      type: object
      required:
      - name
      - agent_name
      - allowed_domains
      title: ApiKeyCreate
    TenantCredentialValidate:
      properties:
        tenant_id:
          type: string
          title: Tenant Id
        consumer_key:
          type: string
          title: Consumer Key
        consumer_secret:
          type: string
          title: Consumer Secret
        access_token:
          type: string
          title: Access Token
        token_secret:
          type: string
          title: Token Secret
      type: object
      required:
      - tenant_id
      - consumer_key
      - consumer_secret
      - access_token
      - token_secret
      title: TenantCredentialValidate
    TenantCredentialRotate:
      properties:
        ts_consumer_key:
          type: string
          title: Ts Consumer Key
        ts_consumer_secret:
          type: string
          title: Ts Consumer Secret
        ts_access_token:
          type: string
          title: Ts Access Token
        ts_token_secret:
          type: string
          title: Ts Token Secret
      type: object
      required:
      - ts_consumer_key
      - ts_consumer_secret
      - ts_access_token
      - ts_token_secret
      title: TenantCredentialRotate
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key