# Create a new Custom Activity instance

POST https://api.close.com/api/v1/activity/custom/
Content-Type: application/json

Custom Activity instances will be created by default with the 'published' status. All required fields will be validated in this status. To create an activity without setting all required fields, you can use the "draft" status.

A Custom Activity can be pinned or unpinned by setting the `pinned` field to `true` or `false` when creating or updating a Custom Activity.

Reference: https://developer.close.com/api/resources/activities/custom-activities/create

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Close API
  version: 1.0.0
paths:
  /activity/custom/:
    post:
      operationId: create
      summary: Create a new Custom Activity instance
      description: >-
        Custom Activity instances will be created by default with the
        'published' status. All required fields will be validated in this
        status. To create an activity without setting all required fields, you
        can use the "draft" status.


        A Custom Activity can be pinned or unpinned by setting the `pinned`
        field to `true` or `false` when creating or updating a Custom Activity.
      tags:
        - subpackage_activitiesCustomActivities
      parameters:
        - name: Authorization
          in: header
          description: Basic authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/activities.custom_activities_create_Response_200
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                description: Any type
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                description: Any type
        '404':
          description: Not found
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCustomActivity'
servers:
  - url: https://api.close.com/api/v1
components:
  schemas:
    CreateCustomActivityStatus:
      type: string
      enum:
        - draft
        - published
      title: CreateCustomActivityStatus
    CreateCustomActivity:
      type: object
      properties:
        activity_at:
          type:
            - string
            - 'null'
          format: date-time
        contact_id:
          type:
            - string
            - 'null'
        created_by_id:
          type:
            - string
            - 'null'
        custom_activity_type_id:
          type: string
        custom_fields:
          type:
            - object
            - 'null'
          additionalProperties:
            description: Any type
        date_created:
          type:
            - string
            - 'null'
          format: date-time
        lead_id:
          type: string
        organization_id:
          type:
            - string
            - 'null'
        pinned:
          type:
            - boolean
            - 'null'
        status:
          $ref: '#/components/schemas/CreateCustomActivityStatus'
        user_id:
          type:
            - string
            - 'null'
      required:
        - custom_activity_type_id
        - lead_id
      title: CreateCustomActivity
    activities.custom_activities_create_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: activities.custom_activities_create_Response_200
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: basic
    OAuth2:
      type: http
      scheme: bearer

```