> ## 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 Contact

> Create (or idempotently attach) a team contact.

Dual rate limit: the outer `_create_rate_limit` always fires via
`dependencies=[...]`. If `send_invite=True`, we ALSO consume the tighter
10/hour `_invite_rate_limit` bucket so invite spam is hard-capped
independently of the 60/hour create quota.

Email validation (§13.1):
- Layer 1 (syntax + MX) always runs, no external calls.
- Layer 2 (Emailable real-time API) runs when EMAILABLE_API_KEY is set.
- On reject: 400 (syntax) or 422 (mx/undeliverable), contact NOT created.
- On accept: contact created; typo_hint surfaced in meta.email_validation.
- Emailable outage → fail-open (contact created, emailable_status='skipped').



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/teams/{team_id}/contacts/
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}/contacts/:
    post:
      tags:
        - contacts-admin
      summary: Create Contact
      description: >-
        Create (or idempotently attach) a team contact.


        Dual rate limit: the outer `_create_rate_limit` always fires via

        `dependencies=[...]`. If `send_invite=True`, we ALSO consume the tighter

        10/hour `_invite_rate_limit` bucket so invite spam is hard-capped

        independently of the 60/hour create quota.


        Email validation (§13.1):

        - Layer 1 (syntax + MX) always runs, no external calls.

        - Layer 2 (Emailable real-time API) runs when EMAILABLE_API_KEY is set.

        - On reject: 400 (syntax) or 422 (mx/undeliverable), contact NOT
        created.

        - On accept: contact created; typo_hint surfaced in
        meta.email_validation.

        - Emailable outage → fail-open (contact created,
        emailable_status='skipped').
      operationId: contacts_admin.post_contacts_admin_post_teams_by_team_id_contacts
      parameters:
        - in: path
          name: team_id
          required: true
          schema:
            title: Team Id
            type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/CreateEnvelope'
        required: true
      responses:
        '201':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/TeamContactResponse'
          description: Successful Response
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    CreateEnvelope:
      additionalProperties: false
      properties:
        data:
          $ref: '#/components/schemas/CreateResource'
      required:
        - data
      title: CreateEnvelope
      type: object
    TeamContactResponse:
      additionalProperties: false
      properties:
        data:
          $ref: '#/components/schemas/TeamContactResource'
      required:
        - data
      title: TeamContactResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    CreateResource:
      additionalProperties: false
      properties:
        attributes:
          $ref: '#/components/schemas/CreateAttributes'
        type:
          const: team_contacts
          title: Type
          type: string
      required:
        - type
        - attributes
      title: CreateResource
      type: object
    TeamContactResource:
      additionalProperties: false
      properties:
        attributes:
          $ref: '#/components/schemas/TeamContactAttributes'
        id:
          title: Id
          type: string
        type:
          const: team_contacts
          default: team_contacts
          title: Type
          type: string
      required:
        - id
        - attributes
      title: TeamContactResource
      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
    CreateAttributes:
      additionalProperties: false
      properties:
        city:
          anyOf:
            - maxLength: 100
              type: string
            - type: 'null'
          title: City
        consent_source:
          anyOf:
            - maxLength: 64
              type: string
            - type: 'null'
          title: Consent Source
        consent_version:
          anyOf:
            - maxLength: 32
              type: string
            - type: 'null'
          title: Consent Version
        country:
          anyOf:
            - maxLength: 2
              type: string
            - type: 'null'
          title: Country
        email:
          format: email
          title: Email
          type: string
        first_name:
          anyOf:
            - maxLength: 100
              type: string
            - type: 'null'
          title: First Name
        last_name:
          anyOf:
            - maxLength: 100
              type: string
            - type: 'null'
          title: Last Name
        marketing_consent_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Marketing Consent At
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        phone:
          anyOf:
            - maxLength: 32
              type: string
            - type: 'null'
          title: Phone
        send_invite:
          default: false
          title: Send Invite
          type: boolean
        state:
          anyOf:
            - maxLength: 100
              type: string
            - type: 'null'
          title: State
        timezone:
          anyOf:
            - maxLength: 64
              type: string
            - type: 'null'
          title: Timezone
      required:
        - email
      title: CreateAttributes
      type: object
    TeamContactAttributes:
      additionalProperties: false
      properties:
        city:
          anyOf:
            - type: string
            - type: 'null'
          title: City
        consent_source:
          anyOf:
            - type: string
            - type: 'null'
          title: Consent Source
        consent_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Consent Version
        contact_id:
          title: Contact Id
          type: string
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
        created_at:
          format: date-time
          title: Created At
          type: string
        deleted_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Deleted At
        email:
          format: email
          title: Email
          type: string
        email_verified_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Email Verified At
        first_name:
          anyOf:
            - type: string
            - type: 'null'
          title: First Name
        last_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Name
        marketing_consent_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Marketing Consent At
        meta:
          additionalProperties: true
          title: Meta
          type: object
        phone:
          anyOf:
            - type: string
            - type: 'null'
          title: Phone
        restored_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Restored At
        source:
          title: Source
          type: string
        state:
          anyOf:
            - type: string
            - type: 'null'
          title: State
        timezone:
          anyOf:
            - type: string
            - type: 'null'
          title: Timezone
        updated_at:
          format: date-time
          title: Updated At
          type: string
      required:
        - contact_id
        - email
        - email_verified_at
        - first_name
        - last_name
        - phone
        - country
        - timezone
        - source
        - marketing_consent_at
        - consent_source
        - consent_version
        - meta
        - created_at
        - updated_at
        - deleted_at
        - restored_at
      title: TeamContactAttributes
      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

````