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

# Create Event

> Create scheduled virtual or in-person events with the SDK event repository.

Create events through the event repository on TypeScript, iOS, and Android. A create request needs a title, description, event type, start time, end time, origin type, and origin ID. Optional fields include location, external URL, cover image file ID, tags, and metadata.

<Info>
  Flutter does not currently expose a public scheduled-event creation API in the SDK source reviewed for this page.
</Info>

## Parameters

| Parameter                | Required | Platforms                | Description                                                                                            |
| ------------------------ | -------- | ------------------------ | ------------------------------------------------------------------------------------------------------ |
| `title`                  | Yes      | TypeScript, iOS, Android | Event title shown to users.                                                                            |
| `description`            | Yes      | TypeScript, iOS, Android | Event description or summary.                                                                          |
| `type`                   | Yes      | TypeScript, iOS, Android | Virtual or in-person event type.                                                                       |
| `startTime`, `endTime`   | Yes      | TypeScript, iOS, Android | Start and end time. TypeScript accepts ISO strings, iOS uses `Date`, and Android uses Joda `DateTime`. |
| `originType`, `originId` | Yes      | TypeScript, iOS, Android | Event owner scope, usually a community origin and community ID.                                        |
| `location`               | No       | TypeScript, iOS, Android | Physical location for in-person events.                                                                |
| `externalUrl`            | No       | TypeScript, iOS, Android | Link for a virtual event or external event details.                                                    |
| `coverImageFileId`       | No       | TypeScript, iOS, Android | Uploaded file ID for the event cover image.                                                            |
| `tags`                   | No       | TypeScript, iOS, Android | Tags used for app-owned grouping or filtering.                                                         |
| `metadata` / `timezone`  | No       | TypeScript, iOS, Android | Custom metadata. Android exposes timezone through `.timezone(...)`.                                    |

## Create an Event

Use the create method when your app has collected the required event fields and knows the target origin. The examples below create a virtual community event and return the created event object.

<CodeGroup>
  ```typescript TypeScript theme={null}
  import {
    AmityEventOriginType,
    AmityEventType,
    EventRepository,
  } from '@amityco/ts-sdk';

  const { data: event } = await EventRepository.createEvent({
    title: 'Community Workshop',
    description: 'A live workshop for community members.',
    type: AmityEventType.Virtual,
    startTime: '2026-08-01T09:00:00.000Z',
    endTime: '2026-08-01T10:00:00.000Z',
    originType: AmityEventOriginType.Community,
    originId: communityId,
    externalUrl: 'https://example.com/live',
    tags: ['workshop'],
    metadata: { timezone: 'UTC' },
  });

  showSuccessMessage(event.eventId);
  ```

  ```swift iOS theme={null}
  let repository = AmityEventRepository()

  let options = AmityEventCreateOptions(
      title: "Community Workshop",
      description: "A live workshop for community members.",
      type: .virtual,
      startTime: Date(),
      endTime: Date().addingTimeInterval(3600),
      originType: .community,
      originId: communityId,
      externalUrl: "https://example.com/live",
      tags: ["workshop"],
      metadata: ["timezone": "UTC"]
  )

  let event = try await repository.createEvent(options: options)
  showSuccessMessage(event.eventId)
  ```

  ```kotlin Android theme={null}
  AmitySocialClient.newEventRepository()
      .createEvent()
      .title("Community Workshop")
      .description("A live workshop for community members.")
      .type(AmityEventType.VIRTUAL)
      .startTime(DateTime.now().plusDays(7))
      .endTime(DateTime.now().plusDays(7).plusHours(1))
      .originType(AmityEventOriginType.COMMUNITY)
      .originId(communityId)
      .externalUrl("https://example.com/live")
      .timezone("UTC")
      .tags(listOf("workshop"))
      .build()
      .create()
      .subscribe(
          { event: AmityEvent -> showSuccessMessage(event.getEventId()) },
          { error -> handleGeneralError(error) }
      )
  ```
</CodeGroup>

## Platform Notes

* TypeScript uses `AmityEventType.Virtual` and `AmityEventType.InPerson`.
* iOS uses `.virtual` and `.inPerson`.
* Android uses `AmityEventType.VIRTUAL` and `AmityEventType.IN_PERSON`.
* Android requires `endTime(...)` before calling `build()`.

## Related Topics

<CardGroup cols={3}>
  <Card title="Manage Events" href="./manage-events" icon="calendar-days">
    Get, query, update, and delete events.
  </Card>

  <Card title="Event RSVP" href="./event-rsvp" icon="ticket-check">
    Create, update, read, and query RSVP responses.
  </Card>

  <Card title="Events Overview" href="./overview" icon="calendar">
    Review event fields, coverage, and common flows.
  </Card>
</CardGroup>
