# /create

{% hint style="info" %}
This endpoint requires a POST request!
{% endhint %}

{% hint style="info" %}
This endpoint supports the [Exclude](https://dadocs.rickyjs.xyz/exclude-header) header
{% endhint %}

### Endpoint Headers:

* bot-token - Token of the Bot <mark style="color:orange;">**\[String]**</mark> (<mark style="color:red;">**Required**</mark>)&#x20;
* apikey - Your Api Auth Key <mark style="color:orange;">**\[String]**</mark> (<mark style="color:red;">**Required**</mark>)
* guild-id - ID of the guild to be fetched <mark style="color:orange;">**\[Snowflake]**</mark> (<mark style="color:red;">**Required**</mark>)&#x20;

### Endpoint Body Parameters

* channel\_id - the channel id of the scheduled event. <mark style="color:orange;">**\[Snowflake]**</mark> ([<mark style="color:yellow;">\*</mark>](#user-content-fn-1)[^1])&#x20;
* entity\_metadata - the entity metadata of the scheduled event <mark style="color:orange;">**\[Object]**</mark> (<mark style="color:yellow;">\*\*</mark>)&#x20;
* name - the name of the scheduled event <mark style="color:orange;">**\[String]**</mark> (<mark style="color:red;">**Required**</mark>)&#x20;
* privacy\_level - the privacy level of the scheduled event <mark style="color:orange;">**\[Integer]**</mark> (<mark style="color:red;">**Required**</mark>)&#x20;
* scheduled\_start\_time - the time to schedule the event <mark style="color:orange;">**\[ISO8601 timestamp]**</mark> (<mark style="color:red;">**Required**</mark>)&#x20;
* scheduled\_end\_time - the time when the event is scheduled to end <mark style="color:orange;">**\[ISO8601 timestamp]**</mark> (<mark style="color:yellow;">\*\*</mark>)&#x20;
* description - the description of the scheduled event <mark style="color:orange;">**\[String]**</mark> (<mark style="color:green;">**Optional**</mark>)&#x20;
* entity\_type - the entity type of the scheduled event <mark style="color:orange;">**\[Integer]**</mark> (<mark style="color:red;">**Required**</mark>)&#x20;
* image - the cover image of the scheduled event <mark style="color:orange;">**\[Image Data]**</mark> (<mark style="color:green;">**Optional**</mark>)&#x20;

{% hint style="warning" %} <mark style="color:yellow;">\* Optional for events with 'entity\_type': EXTERNAL</mark>

<mark style="color:yellow;">\*\* Required for events with'entity\_type': EXTERNAL</mark>\
\
**We suggest you read Discord's** [**Documentation on Event Creation**](https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event)
{% endhint %}

### Examples:

{% hint style="info" %}
Data API version required. Must replace `<version>` with either **release** or **beta**.
{% endhint %}

<details>

<summary>Bot Designer for Discord</summary>

Example usage of `/guild/event/create` endpoint using BDFD

```bash
$httpAddHeader[apikey;<YOUR-API-KEY>]
$httpAddHeader[bot-token;<YOUR-BOT-TOKEN>]
$httpAddHeader[guild-id;1064098700307218463] 
$httpPost[https://bdfddata.rickyjs.xyz/<version>/guild/event/create;{
 "name": "Tainted Love",
      "description": "Star Wars Is Cool",
      "scheduled_start_time": 1683215100,
      "scheduled_end_time": 1683242100,
      "privacy_level": 1,
      "entity_type": 1,
      "entity_metadata": {
        "location": "Alabama"
      }
 }]


$httpResult OR $httpResult[details]
```

</details>

<details>

<summary>Discord.js</summary>

Example usage of `/guild/event/create` endpoint using Discord.js

```javascript
const axios = require('axios');
(async () => {
return await axios.post('https://bdfddata.rickyjs.xyz/<version>/guild/event/create', {
 "name": "Tainted Love",
      "description": "Star Wars Is Cool",
      "scheduled_start_time": 1683215100,
      "scheduled_end_time": 1683242100,
      "privacy_level": 1,
      "entity_type": 1,
      "entity_metadata": {
        "location": "Alabama"
      }
}, {
headers: {
'apikey': <YOUR-API-KEY>,
'bot-token': <YOUR-BOT-TOKEN>,
'guild-id: '1064098700307218463',
}
}).then(res=>res.data)
})()
```

</details>

### Possible Responses (Codes)

<details>

<summary>Code 200</summary>

API succeeded and details were fetched.

```javascript
{
 status: 200
 {
  status: 200,
  details:
     {
      id: '1093716999017865326',
      guild_id: '1064098700307218463',
      channel_id: null,
      creator_id: '672215920558604332',
      name: 'Test Event - Ignore This!!!!!',
      description: 'We love you, this is a secret!',
      "pending": false,
      "premium_since": null,

   >  'Read on `Event Objects`: https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object' 
  }
} 
```

</details>

<details>

<summary>Code 400</summary>

An error occurred that stopped execution.

```javascript
{
    status: 400
    error: 'Cannot read ...  (This can vary)'
}
```

</details>

<details>

<summary>Code 401</summary>

Invalid bot token was provided.

```javascript
{
  status: 401,
  details: { message: '401: Unauthorized', code: 0 }
}
```

</details>

<details>

<summary>Code 404</summary>

Guild was not found via DAPI

```javascript
{
  status: 404,
  details: { message: 'Unknown Guild', code: 10004 } (this can vary)
}
```

</details>

[^1]:
