Baserow Admin API

The Admin API from Baserow — 14 operation(s) for admin.

OpenAPI Specification

baserow-admin-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Baserow API spec Admin API
  version: 2.2.2
  description: 'For more information about our REST API, please visit [this page](https://baserow.io/docs/apis%2Frest-api).


    For more information about our deprecation policy, please visit [this page](https://baserow.io/docs/apis%2Fdeprecations).'
  contact:
    url: https://baserow.io/contact
  license:
    name: MIT
    url: https://github.com/baserow/baserow/blob/develop/LICENSE
tags:
- name: Admin
paths:
  /api/admin/dashboard/:
    get:
      operationId: admin_dashboard
      description: Returns the new and active users for the last 24 hours, 7 days and 30 days. The `previous_` values are the values of the period before, so for example `previous_new_users_last_24_hours` are the new users that signed up from 48 to 24 hours ago. It can be used to calculate an increase or decrease in the amount of signups. A list of the new and active users for every day for the last 30 days is also included.
      tags:
      - Admin
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdminDashboard'
          description: ''
        '401':
          description: No response body
  /api/admin/users/:
    get:
      operationId: admin_list_users
      description: Returns all users with detailed information on each user, if the requesting user is staff.
      parameters:
      - in: query
        name: ids
        schema:
          type: string
        description: A comma-separated list of users IDs to filter by. When provided, only users with those IDs are returned.
      - in: query
        name: page
        schema:
          type: integer
        description: Defines which page should be returned.
      - in: query
        name: search
        schema:
          type: string
        description: If provided only users with id or username or first_name that match the query will be returned.
      - in: query
        name: size
        schema:
          type: integer
        description: Defines how many users should be returned per page.
      - in: query
        name: sorts
        schema:
          type: string
        description: 'A comma separated string of attributes to sort by, each attribute must be prefixed with `+` for a descending sort or a `-` for an ascending sort. The accepted attribute names are: `id, is_active, name, username, date_joined, last_login`. For example `sorts=-id,-is_active` will sort the users first by descending id and then ascending is_active. A sortparameter with multiple instances of the same sort attribute will respond with the ERROR_INVALID_SORT_ATTRIBUTE error.'
      tags:
      - Admin
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginationSerializerUserAdminResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_PAGE_SIZE_LIMIT
                    - ERROR_INVALID_SORT_DIRECTION
                    - ERROR_INVALID_SORT_ATTRIBUTE
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
        '401':
          description: No response body
    post:
      operationId: admin_create_user
      description: Creates and returns a new user if the requesting user is staff. This works even if new signups are disabled.
      tags:
      - Admin
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserAdminCreate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/UserAdminCreate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/UserAdminCreate'
        required: true
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserAdminResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_REQUEST_BODY_VALIDATION
                    - ERROR_FEATURE_NOT_AVAILABLE
                    - USER_ADMIN_ALREADY_EXISTS
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
  /api/admin/users/{user_id}/:
    patch:
      operationId: admin_edit_user
      description: Updates specified user attributes and returns the updated user if the requesting user is staff. You cannot update yourself to no longer be an admin or active.
      parameters:
      - in: path
        name: user_id
        schema:
          type: integer
        description: The id of the user to edit
        required: true
      tags:
      - Admin
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedUserAdminUpdate'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedUserAdminUpdate'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedUserAdminUpdate'
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserAdminResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_REQUEST_BODY_VALIDATION
                    - USER_ADMIN_CANNOT_DEACTIVATE_SELF
                    - USER_ADMIN_UNKNOWN_USER
                    - USER_ADMIN_ALREADY_EXISTS
                    - ERROR_FEATURE_NOT_AVAILABLE
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
        '401':
          description: No response body
    delete:
      operationId: admin_delete_user
      description: Deletes the specified user, if the requesting user has admin permissions. You cannot delete yourself.
      parameters:
      - in: path
        name: user_id
        schema:
          type: integer
        description: The id of the user to delete
        required: true
      tags:
      - Admin
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '200':
          description: No response body
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - USER_ADMIN_CANNOT_DELETE_SELF
                    - USER_ADMIN_UNKNOWN_USER
                    - ERROR_FEATURE_NOT_AVAILABLE
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
        '401':
          description: No response body
  /api/admin/users/impersonate/:
    post:
      operationId: admin_impersonate_user
      description: This endpoint allows staff to impersonate another user by requesting a JWT token and user object. The requesting user must have staff access in order to do this. It's not possible to impersonate a superuser or staff.
      tags:
      - Admin
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BaserowImpersonateAuthToken'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/BaserowImpersonateAuthToken'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/BaserowImpersonateAuthToken'
        required: true
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: object
                properties:
                  user:
                    type: object
                    description: An object containing information related to the user.
                    properties:
                      first_name:
                        type: string
                        description: The first name of related user.
                      username:
                        type: string
                        format: email
                        description: The username of the related user. This is always an email address.
                      language:
                        type: string
                        description: 'An ISO 639 language code (with optional variant) selected by the user. Ex: en-GB.'
                  token:
                    type: string
                    deprecated: true
                    description: Deprecated. Use the `access_token` instead.
                  access_token:
                    type: string
                    description: '''access_token'' can be used to authorize for other endpoints that require authorization. This token will be valid for 10 minutes.'
          description: ''
  /api/admin/workspaces/:
    get:
      operationId: admin_list_workspaces
      description: Returns all workspaces with detailed information on each workspace, if the requesting user is staff.
      parameters:
      - in: query
        name: ids
        schema:
          type: string
        description: A comma-separated list of workspaces IDs to filter by. When provided, only workspaces with those IDs are returned.
      - in: query
        name: page
        schema:
          type: integer
        description: Defines which page should be returned.
      - in: query
        name: search
        schema:
          type: string
        description: If provided only workspaces with id or name that match the query will be returned.
      - in: query
        name: size
        schema:
          type: integer
        description: Defines how many workspaces should be returned per page.
      - in: query
        name: sorts
        schema:
          type: string
        description: 'A comma separated string of attributes to sort by, each attribute must be prefixed with `+` for a descending sort or a `-` for an ascending sort. The accepted attribute names are: `id, name, application_count, created_on, row_count, storage_usage`. For example `sorts=-id,-name` will sort the workspaces first by descending id and then ascending name. A sortparameter with multiple instances of the same sort attribute will respond with the ERROR_INVALID_SORT_ATTRIBUTE error.'
      tags:
      - Admin
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginationSerializerWorkspacesAdminResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_PAGE_SIZE_LIMIT
                    - ERROR_INVALID_SORT_DIRECTION
                    - ERROR_INVALID_SORT_ATTRIBUTE
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
        '401':
          description: No response body
  /api/admin/workspaces/{workspace_id}/:
    delete:
      operationId: admin_delete_workspace
      description: Deletes the specified workspace and the applications inside that workspace, if the requesting user is staff.
      parameters:
      - in: path
        name: workspace_id
        schema:
          type: integer
        description: The id of the workspace to delete
        required: true
      tags:
      - Admin
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '204':
          description: No response body
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_GROUP_DOES_NOT_EXIST
                    - ERROR_FEATURE_NOT_AVAILABLE
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
        '401':
          description: No response body
  /api/admin/workspaces/options/:
    get:
      operationId: admin_list_workspaces_as_options
      description: Lists all workspaces. This endpoint is intended for admin-level features that need a workspace dropdown.
      parameters:
      - in: query
        name: ids
        schema:
          type: string
        description: A comma-separated list of workspaces IDs to filter by. When provided, only workspaces with those IDs are returned.
      - in: query
        name: page
        schema:
          type: integer
        description: Defines which page should be returned.
      - in: query
        name: search
        schema:
          type: string
        description: If provided only workspaces with name that match the query will be returned.
      - in: query
        name: size
        schema:
          type: integer
        description: Defines how many workspaces should be returned per page.
      tags:
      - Admin
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginationSerializerAdminWorkspaceOptions'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_PAGE_SIZE_LIMIT
                    - ERROR_INVALID_SORT_DIRECTION
                    - ERROR_INVALID_SORT_ATTRIBUTE
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
        '401':
          description: No response body
  /api/licenses/:
    get:
      operationId: admin_licenses
      description: Lists all the valid licenses that are registered to this instance. A premium license can be used to unlock the premium features for a fixed amount of users. An enterprise license can similarly be used to unlock enterprise features. More information about self hosted licenses can be found on our pricing page https://baserow.io/pricing.
      tags:
      - Admin
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/License'
          description: ''
    post:
      operationId: admin_register_license
      description: Registers a new license. After registering you can assign users to the license that will be able to use the license's features while the license is active. If an existing license with the same `license_id` already exists and the provided license has been issued later than that one, the existing one will be upgraded.
      tags:
      - Admin
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterLicense'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/RegisterLicense'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/RegisterLicense'
        required: true
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/License'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_INVALID_LICENSE
                    - ERROR_UNSUPPORTED_LICENSE
                    - ERROR_PREMIUM_LICENSE_INSTANCE_ID_MISMATCH
                    - ERROR_LICENSE_HAS_EXPIRED
                    - ERROR_LICENSE_ALREADY_EXISTS
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
  /api/licenses/{id}/:
    get:
      operationId: admin_get_license
      description: Responds with detailed information about the license related to the provided parameter.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: The internal identifier of the license.
        required: true
      tags:
      - Admin
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LicenseWithUsers'
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_LICENSE_DOES_NOT_EXIST
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
    delete:
      operationId: admin_remove_license
      description: Removes the existing license related to the provided parameter. If the license is active, then all the users that are using the license will lose access to the features granted by that license.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: The internal identifier of the license, this is `id` and not `license_id`.
        required: true
      tags:
      - Admin
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '204':
          description: No response body
        '404':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_LICENSE_DOES_NOT_EXIST
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
  /api/licenses/{id}/{user_id}/:
    post:
      operationId: admin_add_user_to_license
      description: Adds the user related to the provided parameter and to the license related to the parameter. This only happens if there are enough seats left on the license and if the user is not already on the license.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: The internal identifier of the license, this is `id` and not `license_id`.
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        description: The ID of the user that must be added to the license.
        required: true
      tags:
      - Admin
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LicenseUser'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_USER_ALREADY_ON_LICENSE
                    - ERROR_NO_SEATS_LEFT_IN_LICENSE
                    - ERROR_CANT_MANUALLY_CHANGE_SEATS
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_LICENSE_DOES_NOT_EXIST
                    - ERROR_USER_NOT_FOUND
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
    delete:
      operationId: admin_remove_user_from_license
      description: Removes the user related to the provided parameter and to the license related to the parameter. This only happens if the user is on the license, otherwise nothing will happen.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: The internal identifier of the license, this is `id` and not `license_id`.
        required: true
      - in: path
        name: user_id
        schema:
          type: integer
        description: The ID of the user that must be removed from the license.
        required: true
      tags:
      - Admin
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '204':
          description: No response body
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_CANT_MANUALLY_CHANGE_SEATS
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_LICENSE_DOES_NOT_EXIST
                    - ERROR_USER_NOT_FOUND
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
  /api/licenses/{id}/check/:
    get:
      operationId: admin_license_check
      description: This endpoint checks with the authority if the license needs to be updated. It also checks if the license is operating within its limits and might take action on that. It could also happen that the license has been deleted because there is an instance id mismatch or because it's invalid. In that case a `204` status code is returned.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: The internal identifier of the license, this is `id` and not `license_id`.
        required: true
      tags:
      - Admin
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LicenseWithUsers'
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_LICENSE_DOES_NOT_EXIST
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
  /api/licenses/{id}/fill-seats/:
    post:
      operationId: admin_fill_remaining_seats_of_license
      description: Fills the remaining empty seats of the license with the first users that are found.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: The internal identifier of the license, this is `id` and not `license_id`.
        required: true
      tags:
      - Admin
      security:
      - UserSource JWT: []
      - JWT: []
      responses:
        '200':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LicenseUser'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_CANT_MANUALLY_CHANGE_SEATS
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
        '404':
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Machine readable error indicating what went wrong.
                    enum:
                    - ERROR_LICENSE_DOES_NOT_EXIST
                  detail:
                    oneOf:
                    - type: string
                      format: string
                      description: Human readable details about what went wrong.
                    - type: object
                      format: object
                      description: Machine readable object about what went wrong.
          description: ''
  /api/licenses/{id}/lookup-users/:
    get:
      operationId: admin_license_lookup_users
      description: This endpoint can be used to lookup users that can be added to a  license. Users that are already in the license are not returned here. Optionally a `search` query parameter can be provided to filter the results.
      parameters:
      - in: path
        name: id
        schema:
          type: integer
        description: The internal identifier of the license, this is `id` and not `license_id`.
        required: true
      - in: query
        name: page
        schema:
          type: integer
        description: Defines which page of users should be returned.
      - in: query
        name: search
        schema:
          type: string
        description: If provided, only users where the name or email contains the value are returned.
      - in: query
     

# --- truncated at 32 KB (50 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/baserow/refs/heads/main/openapi/baserow-admin-api-openapi.yml