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

# Create Event

> Schedules a new event

<Warning>
  A status code of 200 does not imply sucessful scheduling, but rather that the request was received successfully.
  For reliable scheduling completion info, please use the `webhook_url` field in the request to receive a webhook on completion.
</Warning>

<Note>
  Note: Currently the API only supports Calendly event types set to English, German, French, Spanish and Portuguese. Please [reach out](mailto:contact@trysetter.com), if you'd like us to support more languages. We can add more languages if there is a demand.
</Note>

Watch the video below to learn how to use this endpoint step by step.

<iframe width="560" height="315" src="https://www.youtube.com/embed/qrmMOd6_6M4?si=BAJMZbrk80c0ND__" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen />


## OpenAPI

````yaml POST /api/scheduled_events
openapi: 3.0.1
info:
  title: OpenAPI Calendly Scheduling
  description: Schedule new events with Calendly
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://calendlyscheduling.dev
security:
  - bearerAuth: []
paths:
  /api/scheduled_events:
    post:
      description: Schedules a new event
      requestBody:
        description: Event details
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewEvent'
        required: true
      responses:
        '200':
          description: Scheduling response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response'
        '400':
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    NewEvent:
      allOf:
        - $ref: '#/components/schemas/Event'
    Response:
      required:
        - message
      type: object
      properties:
        message:
          type: string
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: string
    Event:
      required:
        - scheduling_url
        - start_time
        - fields
      type: object
      properties:
        scheduling_url:
          description: >-
            URL of the scheduling page. E.g.
            'https://calendly.com/johndoe/30min'. It has to match this exact
            format. Please don't include any query parameters, trailing slashes
            or a timestamp in the slug.
          type: string
        start_time:
          description: >-
            ISO timestamp of the start time. E.g. '2021-01-01T09:15:00Z' OR
            '2021-01-01T10:15:00+01:00'. DO NOT include millie seconds. NOT:
            '2021-01-01T10:15:00.000Z'
          type: string
        fields:
          description: >-
            All fields that should be completed on the scheduling form. This
            includes not only custom questions but also the default fields
            required by Calendly (e.g., email address).


            Include all fields that are displayed and required to be filled out,
            as well as any optional fields you intend to complete. If a field is
            not included, it will not be filled out, and the scheduling process
            may fail.
          type: array
          items:
            type: object
            required:
              - name
              - type
              - value
            properties:
              name:
                description: >-
                  Name of the field (exactly as displayed on the form). E.g.
                  'Name', 'First Name', 'Email', ... . NOT 'name' or 'email'.
                type: string
              type:
                description: >-
                  Type of the field (according to Calendly API reference:
                  https://developer.calendly.com/api-docs/f3185c91567db-event-type
                  > custom_questions > type)
                type: string
                enum:
                  - string
                  - text
                  - phone_number
                  - single_select
                  - multi_select
              value:
                description: >-
                  Value of the field. E.g. 'John Doe', 'john.doe@example.com',
                  '+1 234 567 890', ...
                type: string
        invitee_timezone:
          description: >-
            (Optional) Invitee time zone in IANA format (E.g.
            'America/New_York'). This field does not affect the start date of
            the event `start_time`. It is only displayed in Calendly as the
            invitees local time zone while scheduling the event. Defaults to
            `UTC`.
          type: string
        webhook_url:
          description: >-
            (Optional) URL to send a webhook to after scheduling has completed.
            If `error` is `null` scheduling was successful. If `error` is not
            `null` scheduling failed.
          type: string
        metadata:
          description: >-
            (Optional) Metadata to be sent to the webhook. This can be used to
            identify the scheduling request in the webhook. Unstructured data is
            allowed.
          type: object
  securitySchemes:
    bearerAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        API key for authentication. Please purchase a subscription to get your
        API key.

````