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

# Admin Create Event

> Create a hub event as the team principal.

Same request body and host rules as the member-facing create endpoint:
``host_contact_id`` records one contact as the event's sole host,
``host_contact_ids`` records the full ordered host set (1 to 3
entries), the two are mutually exclusive, and every contact named as a
host must already be a current, active member of this hub or the whole
request is rejected with 422 (``host_not_active_member``). That
rejection does not say which entry failed or why, but it does confirm
membership one contact at a time; this is accepted because the team
principal can already list this hub's members directly. Omit both
and the sole host is the authenticated author's own contact -- the
caller's contact when authenticating with a contact token, the team
owner's contact when authenticating as the team.

The author must themselves have a current, active member identity in
this hub, whether or not a host is named; otherwise the request is
rejected with 422 (``author_not_active_member``).

Emits hub_event.created.



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/admin/teams/{team_id}/hubs/{hub_id}/events
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/admin/teams/{team_id}/hubs/{hub_id}/events:
    post:
      tags:
        - hub-events-admin
      summary: Admin Create Event
      description: |-
        Create a hub event as the team principal.

        Same request body and host rules as the member-facing create endpoint:
        ``host_contact_id`` records one contact as the event's sole host,
        ``host_contact_ids`` records the full ordered host set (1 to 3
        entries), the two are mutually exclusive, and every contact named as a
        host must already be a current, active member of this hub or the whole
        request is rejected with 422 (``host_not_active_member``). That
        rejection does not say which entry failed or why, but it does confirm
        membership one contact at a time; this is accepted because the team
        principal can already list this hub's members directly. Omit both
        and the sole host is the authenticated author's own contact -- the
        caller's contact when authenticating with a contact token, the team
        owner's contact when authenticating as the team.

        The author must themselves have a current, active member identity in
        this hub, whether or not a host is named; otherwise the request is
        rejected with 422 (``author_not_active_member``).

        Emits hub_event.created.
      operationId: >-
        hub_events_admin.post_hub_events_admin_post_admin_teams_by_team_id_hubs_by_hub_id_events
      parameters:
        - in: path
          name: team_id
          required: true
          schema:
            title: Team Id
            type: string
        - in: path
          name: hub_id
          required: true
          schema:
            title: Hub Id
            type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/HubEventCreateEnvelope'
        required: true
      responses:
        '201':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HubEventResponse'
          description: Successful Response
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    HubEventCreateEnvelope:
      additionalProperties: false
      properties:
        data:
          $ref: '#/components/schemas/HubEventCreateResource'
      required:
        - data
      title: HubEventCreateEnvelope
      type: object
    HubEventResponse:
      additionalProperties: false
      properties:
        data:
          $ref: '#/components/schemas/HubEventResource'
      required:
        - data
      title: HubEventResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    HubEventCreateResource:
      additionalProperties: false
      properties:
        attributes:
          $ref: '#/components/schemas/HubEventCreateAttributes'
        type:
          const: hub_events
          title: Type
          type: string
      required:
        - type
        - attributes
      title: HubEventCreateResource
      type: object
    HubEventResource:
      additionalProperties: false
      properties:
        attributes:
          $ref: '#/components/schemas/HubEventAttributes'
        id:
          title: Id
          type: string
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiLinks'
            - type: 'null'
        type:
          const: hub_events
          default: hub_events
          title: Type
          type: string
      required:
        - id
        - attributes
      title: HubEventResource
      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
    HubEventCreateAttributes:
      additionalProperties: false
      properties:
        attendee_list_visible:
          default: true
          title: Attendee List Visible
          type: boolean
        broadcast:
          default: false
          description: >-
            Whether the announcement for this event goes out as a broadcast.
            This is NOT a mute switch -- every member who can see the event is
            notified that it exists either way; this only decides whether that
            announcement is delivered loudly. Defaults to false.
          title: Broadcast
          type: boolean
        capacity:
          anyOf:
            - minimum: 1
              type: integer
            - type: 'null'
          title: Capacity
        cover_image_url:
          anyOf:
            - maxLength: 1024
              type: string
            - type: 'null'
          title: Cover Image Url
        cover_media_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Soft ref to a Media row bound via a composer-attachment-upload
            session (POST the hub's attachment-uploads endpoint with
            attachment_context='event', then pass the returned media id here).
            Optional; coexists with cover_image_url -- when set, the response's
            cover_url is derived from this media (freshly re-signed on every
            read) instead of the raw cover_image_url column. Binding is
            one-shot: each upload session can only be consumed once.
          title: Cover Media Id
        description:
          anyOf:
            - maxLength: 20000
              type: string
            - type: 'null'
          title: Description
        ends_at:
          format: date-time
          title: Ends At
          type: string
        host_contact_id:
          anyOf:
            - maxLength: 36
              type: string
            - type: 'null'
          description: >-
            Contact id to record as this event's SOLE host -- shorthand for
            host_contact_ids=[this value]. Optional -- when both this and
            host_contact_ids are omitted, the event is stamped with the
            authenticated caller's own contact id (today's behavior). When
            provided, it must resolve as a CURRENT, active member of this hub or
            the request is rejected with 422; the target need not hold an
            elevated role. Mutually exclusive with host_contact_ids -- sending
            both is 422, and so is sending either one as an explicit null.
          title: Host Contact Id
        host_contact_ids:
          anyOf:
            - items:
                type: string
              maxItems: 3
              minItems: 1
              type: array
            - type: 'null'
          description: >-
            The full, ordered set of contact ids to record as this event's hosts
            (1 to 3 entries, position 0 is the primary/denormalized
            host_contact_id on every response). Optional -- when both this and
            host_contact_id are omitted, the event is stamped with the
            authenticated caller's own contact id as its sole host. Every id
            must resolve as a CURRENT, active member of this hub, or the WHOLE
            request is rejected with 422 (fail closed, no partial accept); no
            entry needs an elevated role -- being a host is attribution, not
            entitlement. Mutually exclusive with host_contact_id: sending both
            is 422, and so is sending either one as an explicit null.
          title: Host Contact Ids
        location_address:
          anyOf:
            - maxLength: 10000
              type: string
            - type: 'null'
          title: Location Address
        location_type:
          enum:
            - url
            - address
          title: Location Type
          type: string
        location_url:
          anyOf:
            - maxLength: 1024
              type: string
            - type: 'null'
          title: Location Url
        rsvp_tag_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Rsvp Tag Id
        segment_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Segment Id
        starts_at:
          format: date-time
          title: Starts At
          type: string
        timezone:
          maxLength: 64
          minLength: 1
          title: Timezone
          type: string
        title:
          maxLength: 200
          minLength: 1
          title: Title
          type: string
        visibility:
          default: all_members
          enum:
            - all_members
            - segment
          title: Visibility
          type: string
      required:
        - title
        - starts_at
        - ends_at
        - timezone
        - location_type
      title: HubEventCreateAttributes
      type: object
    HubEventAttributes:
      additionalProperties: false
      properties:
        announced_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: >-
            When members were told this event exists, or null. Visible only to
            hub staff; always null for everyone else. Null also for an event
            that was never announced -- including events created before
            announcements shipped -- so a client renders the announcement chip
            if and only if this is present.
          title: Announced At
        announced_loudly:
          anyOf:
            - type: boolean
            - type: 'null'
          description: >-
            Whether that announcement went out as a broadcast. Only ever
            non-null alongside announced_at, and only for hub staff. It records
            what was actually sent, so it does not change if the host later
            flips the broadcast switch.
          title: Announced Loudly
        attendee_list_visible:
          title: Attendee List Visible
          type: boolean
        attendee_sample_contact_ids:
          default: []
          items:
            type: string
          title: Attendee Sample Contact Ids
          type: array
        broadcast:
          description: >-
            Whether this event's announcement goes out as a broadcast. Not a
            mute switch -- see the create endpoint's field of the same name.
          title: Broadcast
          type: boolean
        capacity:
          anyOf:
            - type: integer
            - type: 'null'
          title: Capacity
        cover_image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Cover Image Url
        cover_media_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Soft ref to the bound Media row, or null when no media-backed cover
            is set. When non-null, cover_url is derived from this media rather
            than cover_image_url. See PATCH .../events/{id}'s cover_media_id
            field for the one-shot bind/clear limitation.
          title: Cover Media Id
        cover_url:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Derived, read-only display URL for the event cover -- resolved fresh
            on every read, never independently settable. A freshly (re-)signed
            URL when cover_media_id is bound and resolvable, else the raw
            cover_image_url value, else null.
          title: Cover Url
        cover_url_expires_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: >-
            Expiry timestamp sealed into the signed cover_url, or null when
            cover_url is unsigned (a raw cover_image_url fallback) or itself
            null.
          title: Cover Url Expires At
        created_at:
          format: date-time
          title: Created At
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        ends_at:
          format: date-time
          title: Ends At
          type: string
        going_count:
          title: Going Count
          type: integer
        google_calendar_url:
          title: Google Calendar Url
          type: string
        host_contact_id:
          title: Host Contact Id
          type: string
        host_contact_ids:
          items:
            type: string
          maxItems: 3
          minItems: 1
          title: Host Contact Ids
          type: array
        hub_id:
          title: Hub Id
          type: string
        is_full:
          title: Is Full
          type: boolean
        location_address:
          anyOf:
            - type: string
            - type: 'null'
          title: Location Address
        location_type:
          enum:
            - url
            - address
          title: Location Type
          type: string
        location_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Location Url
        my_rsvp_status:
          anyOf:
            - enum:
                - going
                - not_going
                - maybe
              type: string
            - type: 'null'
          title: My Rsvp Status
        rsvp_tag_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Rsvp Tag Id
        segment_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Segment Id
        starts_at:
          format: date-time
          title: Starts At
          type: string
        status:
          enum:
            - scheduled
            - cancelled
          title: Status
          type: string
        team_id:
          title: Team Id
          type: string
        timezone:
          title: Timezone
          type: string
        title:
          title: Title
          type: string
        updated_at:
          format: date-time
          title: Updated At
          type: string
        visibility:
          enum:
            - all_members
            - segment
          title: Visibility
          type: string
      required:
        - hub_id
        - team_id
        - title
        - description
        - cover_image_url
        - cover_media_id
        - cover_url
        - cover_url_expires_at
        - starts_at
        - ends_at
        - timezone
        - location_type
        - location_url
        - location_address
        - capacity
        - host_contact_id
        - host_contact_ids
        - visibility
        - segment_id
        - rsvp_tag_id
        - attendee_list_visible
        - status
        - going_count
        - is_full
        - google_calendar_url
        - my_rsvp_status
        - broadcast
        - announced_at
        - announced_loudly
        - created_at
        - updated_at
      title: HubEventAttributes
      type: object
    JsonApiLinks:
      properties:
        self:
          anyOf:
            - type: string
            - type: 'null'
          title: Self
      title: JsonApiLinks
      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

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.