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

# Create An Activity

> This endpoint creates an activity or task within a collection.

#### Description

This API endpoint facilitates the creation of an activity or task within a specified collection. The activity can be associated with a collection record and is defined by various parameters provided in the request body.

#### Body

<ParamField body="iconType" type="string" required>
  Specifies the type of icon associated with the activity. Possible values include 'emoji', 'interaction', 'messaging\_app', etc.
</ParamField>

<ParamField body="iconValue" type="string" required>
  Defines the specific value of the icon based on the iconType.

  * For 'emoji', provide any emoji.
  * For 'interaction', valid values include 'call', 'meeting', 'message', 'coffee', 'lunch', 'event', 'drink', etc.
  * For 'messaging\_app', valid values include 'whatsapp', 'twitter', 'linkedin', 'hangout', 'skype', 'slack', 'imessage', 'facebook\_messenger', 'signal', 'discord', 'wechat', 'telegram', 'viber', etc.
</ParamField>

<ParamField body="name" type="string" required>
  The name or title of the activity.
</ParamField>

<ParamField body="scheduleAt" type="string" required>
  Specifies the scheduled time for the activity in the format "YYYY-MM-DDTHH:mm:ss.SSSZ".
</ParamField>

<ParamField body="description" type="string">
  A description providing additional details about the activity.
</ParamField>

<ParamField body="associated" type="string">
  The ID of the collection record associated with the activity.
</ParamField>

<ParamField body="status" type="string">
  The ID of the status attribute indicating the current status of the activity.
</ParamField>

#### Response

<ResponseField name="status" type="boolean">
  Indicates the success or failure of the activity creation. In this case,
  true signifies a successful operation.
</ResponseField>

<ResponseField name="message" type="string">
  Provides a human-readable message accompanying the response. In this instance,
  it confirms the successful creation of the activity with the message "Record created successfully!"
</ResponseField>

<ResponseField name="_id" type="string">
  The unique identifier for the created activity.
</ResponseField>

<ResponseField name="data" type="object">
  An object containing details of the created activity.

  <Expandable title="data">
    <ResponseField name="_id" type="string">
      The unique identifier for the activity.
    </ResponseField>

    <ResponseField name="name" type="string">
      The name or title of the activity.
    </ResponseField>

    <ResponseField name="scheduleAt" type="string">
      The scheduled time for the activity in the format "YYYY-MM-DDTHH:mm:ss.SSSZ".
    </ResponseField>

    <ResponseField name="description" type="string">
      Additional details or description of the activity.
    </ResponseField>

    <ResponseField name="associated" type="string">
      The ID of the associated collection record, if any.
    </ResponseField>

    <ResponseField name="assignee" type="object">
      Details of the assignee for the activity.

      <Expandable title="assignee">
        <ResponseField name="_id" type="string">
          The unique identifier for the assignee.
        </ResponseField>

        <ResponseField name="name" type="string">
          The name of the assignee.
        </ResponseField>

        <ResponseField name="avatar" type="string">
          The avatar or profile picture of the assignee.
        </ResponseField>

        <ResponseField name="email" type="string">
          The email address of the assignee.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="status" type="object">
      Details of the status attribute associated with the activity.

      <Expandable title="status" />
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseExample>
  ```json 200-Success theme={null}
  {
      "status": true,
      "message": "Record created successfully!",
      "_id": "655c081eb3b96854c04e621a",
      "data": {
          "_id": "655c081eb3b96854c04e621a",
          "name": "Test Activity",
          "scheduleAt": "2023-12-01T00:00:00.000Z",
          "description": "Testing",
          "associated": null,
          "assignee": null,
          "status": {
              "_id": "65338d9cf781c59be3859c62",
              "color": "#9898fa",
              "name": "Open",
              "celebrationEnabled": false,
              "isArchived": false,
              "order": 1,
              "statusType": "normal",
              "timeInStatus": 0
          },
          "sourceDetails": "",
          "source": {
              "_id": "65338d9cf781c59be3859c6b",
              "name": "API",
              "color": "#dbeddb",
              "isArchived": false,
              "order": 2
          },
          "createdBy": {
              "_id": "65338d9a4d3b7a624a8d63ab",
              "name": "Test user",
              "avatar": "",
              "email": "user@zixflow.com"
          },
          "completedTime": false,
          "activityLostReason": null,
          "createdAt": "2023-11-21T01:30:06.242Z"
      }
  }
  ```

  ```json 401-Unauthorised theme={null}
  {
    "status": false,
    "message": "No token provided"
  }
  ```
</ResponseExample>
