# Create Invite

> Create an invite for a channel.

- ID: `create_invite`
- Type: Block
- Category: [Invites](https://inventor.bot/docs/reference/blocks/invites.md)

**Inputs**

| Name | Required | Description | Value |
| --- | --- | --- | --- |
| `channel_id` | yes | ID of the channel to create the invite for. |  |
| `max_uses` |  | Maximum number of times the invite can be used. Set to 0 or leave blank for unlimited. |  |
| `temporary` |  | Whether the invite is temporary. Set to true for the invite to be temporary. | e.g. `"false"` |
| `expires_after_seconds` |  | Number of seconds until the invite expires. Set to 0 for never, or leave blank for default (7 days). | e.g. `"604800"` |
| `unique` |  | Whether the invite should be unique. Set to true for the invite to be unique. | `"true"`, `"false"` |

**Outputs**

| Name | Description | Value |
| --- | --- | --- |
| `invite_code` | Code for the created invite. |  |
| `server_id` | ID of the server for the invite. |  |
| `channel_id` | ID of the channel for the invite. |  |
| `channel_name` | Name of the channel. |  |
| `invite_creator_user_id` | User ID of the invite creator. |  |
| `invite_creator_username` | Username of the invite creator. |  |
| `invite_uses` | Number of times the invite has been used. |  |
| `invite_max_uses` | Maximum number of times the invite can be used. |  |
| `invite_temporary` | Whether the invite is temporary. |  |
| `expires_at_unix` | Unix timestamp when the invite expires. |  |
| `invite_created_at_unix` | Unix timestamp when the invite was created. |  |

**Example**

```go
invite := create_invite(Args{channel_id: trigger.channel_id})
send_text_message(Args{
	channel_id:      trigger.channel_id,
	message_content: "Invite Code: " + invite.invite_code,
})
```