> ## Documentation Index
> Fetch the complete documentation index at: https://docs.member.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Domain

> Register a domain for DNS-TXT verification.

Returns 201 with the row in ``status='pending'`` and the exact DNS TXT
record the admin must publish (``txt_record_host`` + ``txt_record_value``).
Once published, call ``POST /{id}/verify`` to confirm ownership.



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/teams/{team_id}/verified-domains
openapi: 3.1.0
info:
  description: >-
    Production API reference for Membership.io. Use the authored guides for
    workflows and the generated endpoint pages for exact parameters and schemas.
  title: Membership.io API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.member.dev
security:
  - bearerAuth: []
paths:
  /api/v1/teams/{team_id}/verified-domains:
    post:
      tags:
        - verified-domains
      summary: Create Domain
      description: >-
        Register a domain for DNS-TXT verification.


        Returns 201 with the row in ``status='pending'`` and the exact DNS TXT

        record the admin must publish (``txt_record_host`` +
        ``txt_record_value``).

        Once published, call ``POST /{id}/verify`` to confirm ownership.
      operationId: >-
        verified_domains.post_verified_domains_post_teams_by_team_id_verified_domains
      parameters:
        - in: path
          name: team_id
          required: true
          schema:
            title: Team Id
            type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/VerifiedDomainCreate'
        required: true
      responses:
        '201':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/JsonApiResponse_VerifiedDomainAttributes_'
          description: Successful Response
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    VerifiedDomainCreate:
      additionalProperties: false
      description: |-
        Request body for adding a verified domain to a hub.

        Accepts EITHER a flat body OR a full JSON:API envelope:
          Flat:     {"hub_id": "...", "domain": "acme.com"}
          Envelope: {"data": {"type": "verified_domains", "attributes": {...}}}

        Domain validation (normalization + public-suffix/public-email rejection)
        is performed in the router after parsing so the router can return rich
        JSON:API error responses.
      properties:
        domain:
          title: Domain
          type: string
        hub_id:
          title: Hub Id
          type: string
      required:
        - hub_id
        - domain
      title: VerifiedDomainCreate
      type: object
    JsonApiResponse_VerifiedDomainAttributes_:
      properties:
        data:
          $ref: '#/components/schemas/JsonApiResource_VerifiedDomainAttributes_'
        included:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Included
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiLinks'
            - type: 'null'
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      required:
        - data
      title: JsonApiResponse[VerifiedDomainAttributes]
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    JsonApiResource_VerifiedDomainAttributes_:
      properties:
        attributes:
          $ref: '#/components/schemas/VerifiedDomainAttributes'
        id:
          title: Id
          type: string
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiLinks'
            - type: 'null'
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        relationships:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Relationships
        type:
          title: Type
          type: string
      required:
        - id
        - type
        - attributes
      title: JsonApiResource[VerifiedDomainAttributes]
      type: object
    JsonApiLinks:
      properties:
        self:
          anyOf:
            - type: string
            - type: 'null'
          title: Self
      title: JsonApiLinks
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    VerifiedDomainAttributes:
      description: >-
        Read attributes for a ``verified_domains`` resource.


        Used in all read responses (list, retrieve, create-201, verify-200).


        ``txt_record_host`` and ``txt_record_value`` are computed from the
        stored

        domain + verification_token so the admin knows exactly what DNS record
        to

        publish without any extra client-side computation.
      properties:
        created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Created At
        domain:
          title: Domain
          type: string
        hub_id:
          title: Hub Id
          type: string
        last_checked_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Last Checked At
        status:
          title: Status
          type: string
        team_id:
          title: Team Id
          type: string
        txt_record_host:
          title: Txt Record Host
          type: string
        txt_record_value:
          title: Txt Record Value
          type: string
        updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Updated At
        verification_token:
          title: Verification Token
          type: string
        verified_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Verified At
      required:
        - domain
        - status
        - verification_token
        - txt_record_host
        - txt_record_value
        - hub_id
        - team_id
      title: VerifiedDomainAttributes
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT or mio_sk API key
      description: >-
        Send platform JWTs, contact JWTs, or team API keys as `Authorization:
        Bearer <token>`.
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````