Layero Domains API
The domains API from Layero — 8 operation(s) for domains.
The domains API from Layero — 8 operation(s) for domains.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
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.curl "https://apis.io/api/v1/apis/layero-ru:layero-ru-domains-api"
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.
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: 3.2.0
info:
title: Layero Domains API
version: 0.1.0
tags:
- name: Domains
paths:
/projects/{project_id}/domains:
get:
tags:
- Domains
summary: List Domains
operationId: list_domains_projects__project_id__domains_get
parameters:
- 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:
type: array
items:
$ref: '#/components/schemas/DomainOut'
title: Response List Domains Projects Project Id Domains Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
post:
tags:
- Domains
summary: Add Domain
operationId: add_domain_projects__project_id__domains_post
parameters:
- 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
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DomainCreate'
responses:
'201':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/DomainOut'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/projects/{project_id}/domains/{domain_id}/www:
post:
tags:
- Domains
summary: Set Domain Www
description: 'Подключить или отключить адрес с www рядом с доменом.
Включение заводит вторую строку `www.` со ссылкой на эту; дальше
она идёт обычным путём — DNS-проверка, ACME, продление. Выключение удаляет
спутника; если основным был именно www, флаг возвращается домену.
Возвращаем сам домен, а не спутника: интерфейсу нужно обновить карточку,
а список он и так перечитывает.'
operationId: set_domain_www_projects__project_id__domains__domain_id__www_post
parameters:
- name: project_id
in: path
required: true
schema:
type: string
format: uuid
title: Project Id
- name: domain_id
in: path
required: true
schema:
type: string
format: uuid
title: Domain Id
- name: authorization
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Authorization
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DomainWwwUpdate'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/DomainOut'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/projects/{project_id}/domains/{domain_id}/instructions:
get:
tags:
- Domains
summary: Get Domain Instructions
operationId: get_domain_instructions_projects__project_id__domains__domain_id__instructions_get
parameters:
- name: project_id
in: path
required: true
schema:
type: string
format: uuid
title: Project Id
- name: domain_id
in: path
required: true
schema:
type: string
format: uuid
title: Domain Id
- 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/DomainInstructionsOut'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/projects/{project_id}/domains/{domain_id}/verify:
post:
tags:
- Domains
summary: Verify Domain
description: 'Validate DNS + ownership, then kick off ACME issuance.
Returns immediately with `ssl_status=''cert_requested''`. The actual
Let''s Encrypt round-trip (~30-60s including HTTP-01 challenge fetch
+ finalize + cert download) runs in a background asyncio task that
upserts the cert into `domain_certs` and NOTIFYs the materialiser
when done. Frontend polls /domains and sees the flip to
`ssl_status=''issued''` once the cert is live in nginx.'
operationId: verify_domain_projects__project_id__domains__domain_id__verify_post
parameters:
- name: project_id
in: path
required: true
schema:
type: string
format: uuid
title: Project Id
- name: domain_id
in: path
required: true
schema:
type: string
format: uuid
title: Domain Id
- 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/DomainOut'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/projects/{project_id}/domains/{domain_id}/byoc:
post:
tags:
- Domains
summary: Upload Byoc Certificate
description: 'Bring-your-own-cert: user pastes a CA-issued cert + private key
(e.g. an EV cert from their own provider, or a paid wildcard from
GlobalSign). We validate the pair (key matches cert, not expired,
covers the domain) and store it straight in domain_certs with
source=''imported''; the materialiser picks it up like an ACME cert.
Trades the DNS-validation round-trip for an instant "issued" state —
useful when the user doesn''t want to expose their domain via Let''s
Encrypt at all, or when they already have a long-lived cert and
don''t want to wait for the LE flow.
We still require the ownership_token TXT to be in place before
accepting the cert — the user must prove they own the domain even
if they''re skipping LE''s own check.'
operationId: upload_byoc_certificate_projects__project_id__domains__domain_id__byoc_post
parameters:
- name: project_id
in: path
required: true
schema:
type: string
format: uuid
title: Project Id
- name: domain_id
in: path
required: true
schema:
type: string
format: uuid
title: Domain Id
- name: authorization
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Authorization
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DomainByocUpload'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/DomainOut'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/projects/{project_id}/domains/{domain_id}/primary:
post:
tags:
- Domains
summary: Make Domain Primary
description: 'Сделать домен основным: платформенный апекс `*.layero.ru` начнёт
301-редиректить на него, чтобы сайт не конкурировал сам с собой в поиске.
Основным можно назначить только домен, который реально обслуживается —
подтверждён, с выпущенным сертификатом и не приостановлен. Иначе редирект
увёл бы посетителей в никуда. Домен, закреплённый за отдельным окружением
(`staging.example.com` → ветка staging), тоже не подходит: он показывает
другой контент, а не то, что отдаёт production-апекс.'
operationId: make_domain_primary_projects__project_id__domains__domain_id__primary_post
parameters:
- name: project_id
in: path
required: true
schema:
type: string
format: uuid
title: Project Id
- name: domain_id
in: path
required: true
schema:
type: string
format: uuid
title: Domain Id
- 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/DomainOut'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/projects/{project_id}/domains/{domain_id}/routing:
patch:
tags:
- Domains
summary: Update Domain Routing
operationId: update_domain_routing_projects__project_id__domains__domain_id__routing_patch
parameters:
- name: project_id
in: path
required: true
schema:
type: string
format: uuid
title: Project Id
- name: domain_id
in: path
required: true
schema:
type: string
format: uuid
title: Domain Id
- name: authorization
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Authorization
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DomainRoutingUpdate'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/DomainOut'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/projects/{project_id}/domains/{domain_id}:
delete:
tags:
- Domains
summary: Remove Domain
operationId: remove_domain_projects__project_id__domains__domain_id__delete
parameters:
- name: project_id
in: path
required: true
schema:
type: string
format: uuid
title: Project Id
- name: domain_id
in: path
required: true
schema:
type: string
format: uuid
title: Domain Id
- name: authorization
in: header
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Authorization
responses:
'204':
description: Successful Response
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
components:
schemas:
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
DomainWwwUpdate:
properties:
enabled:
type: boolean
title: Enabled
type: object
required:
- enabled
title: DomainWwwUpdate
DomainByocUpload:
properties:
certificate_pem:
type: string
minLength: 20
title: Certificate Pem
private_key_pem:
type: string
minLength: 20
title: Private Key Pem
type: object
required:
- certificate_pem
- private_key_pem
title: DomainByocUpload
description: 'Bring-your-own-certificate: user pastes a CA-issued cert + key.'
DomainOut:
properties:
id:
type: string
format: uuid
title: Id
project_id:
type: string
format: uuid
title: Project Id
domain:
type: string
title: Domain
kind:
type: string
title: Kind
verified:
type: boolean
title: Verified
ssl_status:
type: string
title: Ssl Status
expected_a_ip:
anyOf:
- type: string
- type: 'null'
title: Expected A Ip
expected_cname_target:
anyOf:
- type: string
- type: 'null'
title: Expected Cname Target
acme_challenge_token:
anyOf:
- type: string
- type: 'null'
title: Acme Challenge Token
ownership_token:
anyOf:
- type: string
- type: 'null'
title: Ownership Token
last_verification_error:
anyOf:
- type: string
- type: 'null'
title: Last Verification Error
next_check_at:
anyOf:
- type: string
format: date-time
- type: 'null'
title: Next Check At
target_environment_id:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Target Environment Id
is_primary:
type: boolean
title: Is Primary
default: false
redirect_to_domain_id:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Redirect To Domain Id
www_dangling:
type: boolean
title: Www Dangling
default: false
type: object
required:
- id
- project_id
- domain
- kind
- verified
- ssl_status
title: DomainOut
DNSRecordInstruction:
properties:
type:
type: string
title: Type
name:
type: string
title: Name
values:
items:
type: string
type: array
title: Values
optional:
type: boolean
title: Optional
default: false
ok:
anyOf:
- type: boolean
- type: 'null'
title: Ok
type: object
required:
- type
- name
- values
title: DNSRecordInstruction
DNSCheckStatus:
properties:
a_ok:
anyOf:
- type: boolean
- type: 'null'
title: A Ok
cname_ok:
anyOf:
- type: boolean
- type: 'null'
title: Cname Ok
txt_ok:
type: boolean
title: Txt Ok
ownership_ok:
type: boolean
title: Ownership Ok
type: object
required:
- a_ok
- cname_ok
- txt_ok
- ownership_ok
title: DNSCheckStatus
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
DomainCreate:
properties:
domain:
type: string
maxLength: 253
minLength: 3
title: Domain
kind:
type: string
pattern: ^(apex|subdomain)$
title: Kind
default: subdomain
with_www:
type: boolean
title: With Www
default: false
type: object
required:
- domain
title: DomainCreate
DomainRoutingUpdate:
properties:
target_environment_id:
anyOf:
- type: string
format: uuid
- type: 'null'
title: Target Environment Id
type: object
title: DomainRoutingUpdate
DomainInstructionsOut:
properties:
domain_id:
type: string
format: uuid
title: Domain Id
domain:
type: string
title: Domain
kind:
type: string
title: Kind
checks:
$ref: '#/components/schemas/DNSCheckStatus'
records:
items:
$ref: '#/components/schemas/DNSRecordInstruction'
type: array
title: Records
type: object
required:
- domain_id
- domain
- kind
- checks
- records
title: DomainInstructionsOut