Layero Organization Database API

The organization_database API from Layero — 15 operation(s) for organization_database.

GitHub OpenAPI

Operations 21

GET /organizations/{slug}/database Get Database #
POST /organizations/{slug}/database Create Database #
DELETE /organizations/{slug}/database Delete Database #
GET /organizations/{slug}/database/options Creation Options #
POST /organizations/{slug}/database/password Rotate Password #
GET /organizations/{slug}/database/projects List Connected #
POST /organizations/{slug}/database/projects Connect Project #
DELETE /organizations/{slug}/database/projects/{project_id} Disconnect Project #
GET /organizations/{slug}/database/schema Get Schema #
POST /organizations/{slug}/database/query Run Query #
GET /organizations/{slug}/database/queries List Saved Queries #
POST /organizations/{slug}/database/queries Save Query #
DELETE /organizations/{slug}/database/queries/{query_id} Delete Saved Query #
GET /organizations/{slug}/database/roles List Roles #
POST /organizations/{slug}/database/roles Create Role #
DELETE /organizations/{slug}/database/roles/{role_name} Drop Role #
GET /organizations/{slug}/database/network Get Network #
PUT /organizations/{slug}/database/network Put Network Settings #
POST /organizations/{slug}/database/network/rules Add Network Rule #
DELETE /organizations/{slug}/database/network/rules/{rule_id} Delete Network Rule #
DELETE /organizations/{slug}/database/network/bans/{addr} Delete Network Ban #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/layero-ru:layero-ru-organization-database-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

layero-ru-organization-database-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Layero Organization Database API
  version: 0.1.0
tags:
- name: organization_database
paths:
  /organizations/{slug}/database:
    get:
      tags:
      - organization_database
      summary: Get Database
      operationId: get_database_organizations__slug__database_get
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/DatabaseOut'
                - type: 'null'
                title: Response Get Database Organizations  Slug  Database Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - organization_database
      summary: Create Database
      operationId: create_database_organizations__slug__database_post
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
              - $ref: '#/components/schemas/CreateIn'
              - type: 'null'
              title: Payload
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecretOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - organization_database
      summary: Delete Database
      description: 'Удалить базу организации. НЕМЕДЛЕННО, как и её близнец по id.


        ⚠️ ТРЕТЬЯ ТОЧКА, И ОНА ОБЯЗАНА ВЕСТИ СЕБЯ ТАК ЖЕ. Ручка в единственном

        числе публичная и живая; оставить её со старым поведением значило бы

        «поправил одну точку из двух» — тот же класс, что уже ловили на пресете и

        на автовключении Data API.'
      operationId: delete_database_organizations__slug__database_delete
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatabaseOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /organizations/{slug}/database/options:
    get:
      tags:
      - organization_database
      summary: Creation Options
      description: См. `_creation_options` — ручка не держит коннект пула на время сети.
      operationId: creation_options_organizations__slug__database_options_get
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /organizations/{slug}/database/password:
    post:
      tags:
      - organization_database
      summary: Rotate Password
      operationId: rotate_password_organizations__slug__database_password_post
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecretOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /organizations/{slug}/database/projects:
    get:
      tags:
      - organization_database
      summary: List Connected
      description: 'Кто получает строку подключения и кого ещё можно подключить.


        Оба списка сразу: выбирать проект из выпадающего списка, не видя уже

        подключённых, значит подключать один и тот же дважды.'
      operationId: list_connected_organizations__slug__database_projects_get
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - organization_database
      summary: Connect Project
      operationId: connect_project_organizations__slug__database_projects_post
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/app__api__routes__organization_databases__ConnectIn'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /organizations/{slug}/database/projects/{project_id}:
    delete:
      tags:
      - organization_database
      summary: Disconnect Project
      operationId: disconnect_project_organizations__slug__database_projects__project_id__delete
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: project_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Project Id
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /organizations/{slug}/database/schema:
    get:
      tags:
      - organization_database
      summary: Get Schema
      operationId: get_schema_organizations__slug__database_schema_get
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /organizations/{slug}/database/query:
    post:
      tags:
      - organization_database
      summary: Run Query
      description: 'Запрос из панели. Имя базы от клиента НЕ принимается — только слаг

        организации, остальное берётся из справочника, иначе подбором

        идентификатора можно было бы дотянуться до чужой базы.'
      operationId: run_query_organizations__slug__database_query_post
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryIn'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /organizations/{slug}/database/queries:
    get:
      tags:
      - organization_database
      summary: List Saved Queries
      operationId: list_saved_queries_organizations__slug__database_queries_get
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - organization_database
      summary: Save Query
      description: 'Сохранить запрос в общую библиотеку организации.


        ⚠️ Права ADMIN, а не MEMBER. Сохранённый запрос видит вся команда и

        запускает его в один клик — то есть это не заметка, а кнопка, которую

        нажмёт кто-то другой. Право писать такие кнопки не должно быть у роли,

        которой не доверено выполнение запросов.'
      operationId: save_query_organizations__slug__database_queries_post
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SavedQueryIn'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /organizations/{slug}/database/queries/{query_id}:
    delete:
      tags:
      - organization_database
      summary: Delete Saved Query
      operationId: delete_saved_query_organizations__slug__database_queries__query_id__delete
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: query_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Query Id
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /organizations/{slug}/database/roles:
    get:
      tags:
      - organization_database
      summary: List Roles
      operationId: list_roles_organizations__slug__database_roles_get
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    post:
      tags:
      - organization_database
      summary: Create Role
      operationId: create_role_organizations__slug__database_roles_post
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RoleIn'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SecretOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /organizations/{slug}/database/roles/{role_name}:
    delete:
      tags:
      - organization_database
      summary: Drop Role
      operationId: drop_role_organizations__slug__database_roles__role_name__delete
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: role_name
        in: path
        required: true
        schema:
          type: string
          title: Role Name
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /organizations/{slug}/database/network:
    get:
      tags:
      - organization_database
      summary: Get Network
      description: 'Режим, список адресов, баны — и адрес самого спрашивающего.


        Свой адрес отдаём вместе с остальным сознательно: без него кнопка

        «добавить мой IP» превращается в задачу «найдите свой адрес сами», а это

        ровно тот момент, когда человек бросает настройку и оставляет базу

        открытой.'
      operationId: get_network_organizations__slug__database_network_get
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    put:
      tags:
      - organization_database
      summary: Put Network Settings
      description: 'Режим TLS. Режимов доступа больше нет — доступ задаёт список адресов.


        ⚠️ `mode` из тела ИГНОРИРУЕТСЯ, и молча. Ручку зовёт панель предыдущей

        версии, и отвечать ей ошибкой значило бы сломать экран сети ровно на то

        время, пока фронтенд догоняет бэкенд. Ответ при этом честный: возвращаем

        `allowlist` — то единственное состояние, которое теперь существует.'
      operationId: put_network_settings_organizations__slug__database_network_put
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NetworkModeIn'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /organizations/{slug}/database/network/rules:
    post:
      tags:
      - organization_database
      summary: Add Network Rule
      operationId: add_network_rule_organizations__slug__database_network_rules_post
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NetworkRuleIn'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /organizations/{slug}/database/network/rules/{rule_id}:
    delete:
      tags:
      - organization_database
      summary: Delete Network Rule
      operationId: delete_network_rule_organizations__slug__database_network_rules__rule_id__delete
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: rule_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Rule Id
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /organizations/{slug}/database/network/bans/{addr}:
    delete:
      tags:
      - organization_database
      summary: Delete Network Ban
      operationId: delete_network_ban_organizations__slug__database_network_bans__addr__delete
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
          title: Slug
      - name: addr
        in: path
        required: true
        schema:
          type: string
          title: Addr
      - name: authorization
        in: header
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Authorization
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SavedQueryIn:
      properties:
        name:
          type: string
          maxLength: 80
          minLength: 1
          title: Name
        sql:
          type: string
          maxLength: 20000
          minLength: 1
          title: Sql
      type: object
      required:
      - name
      - sql
      title: SavedQueryIn
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CreateIn:
      properties:
        name:
          type: string
          maxLength: 60
          minLength: 1
          title: Name
          default: База данных
        extensions:
          items:
            type: string
          type: array
          maxItems: 10
          title: Extensions
        preset:
          type: boolean
          title: Preset
          default: true
      type: object
      title: CreateIn
      description: 'Что именно создаём. Сейчас выбор небольшой, но он есть — молча решать за

        пользователя, какие расширения ему нужны, значит заставить его потом

        просить их через поддержку.'
    DatabaseOut:
      properties:
        id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Id
        name:
          type: string
          title: Name
          default: База данных
        status:
          type: string
          title: Status
        purge_after:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Purge After
        db_name:
          type: string
          title: Db Name
        role_name:
          type: string
          title: Role Name
        quota_bytes:
          type: integer
          title: Quota Bytes
        synchronous_commit:
          type: string
          title: Synchronous Commit
        size_bytes:
          anyOf:
          - type: integer
          - type: 'null'
          title: Size Bytes
        connection_string:
          type: string
          title: Connection String
      type: object
      required:
      - status
      - db_name
      - role_name
      - quota_bytes
      - synchronous_commit
      - connection_string
      title: DatabaseOut
    app__api__routes__organization_databases__ConnectIn:
      properties:
        project_id:
          type: string
          format: uuid
          title: Project Id
      type: object
      required:
      - project_id
      title: ConnectIn
    NetworkRuleIn:
      properties:
        cidr:
          type: string
          maxLength: 43
          minLength: 7
          title: Cidr
        comment:
          anyOf:
          - type: string
            maxLength: 200
          - type: 'null'
          title: Comment
        expires_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Expires At
      type: object
      required:
      - cidr
      title: NetworkRuleIn
    RoleIn:
      properties:
        name:
          type: string
          maxLength: 12
          minLength: 2
          title: Name
        level:
          type: string
          title: Level
          default: read
      type: object
      required:
      - name
      title: RoleIn
    NetworkModeIn:
      properties:
        mode:
          anyOf:
          - type: string
          - type: 'null'
          title: Mode
        ssl_mode:
          anyOf:
          - type: string
          - type: 'null'
          title: Ssl Mode
      type: object
      title: NetworkModeIn
    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
    QueryIn:
      properties:
        sql:
          type: string
          maxLength: 200000
          title: Sql
        read_only:
          type: boolean
          title: Read Only
          default: false
        role:
          anyOf:
          - type: string
          - type: 'null'
          title: Role
          description: 'не поддерживается: пробу от роли исполняет /api/probe'
      type: object
      required:
      - sql
      title: QueryIn
    SecretOut:
      properties:
        connection_string:
          type: string
          title: Connection String
        password:
          type: string
          title: Password
        env_var_name:
          type: string
          title: Env Var Name
          default: LAYERO_DATABASE_URL
        note:
          type: string
          title: Note
          default: Пароль показывается один раз. Сохраните его — восстановить нельзя, только сменить.
        allowed_address:
          anyOf:
          - type: string
          - type: 'null'
          title: Allowed Address
      type: object
      required:
      - connection_string
      - password
      title: SecretOut