# Updating a Custom Activity instance

PUT https://api.close.com/api/v1/activity/custom/{id}/
Content-Type: application/json

A Custom Activity can be updated to add, change or remove any Custom Fields and to change the status between "draft" and "published".

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/update

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Close API
  version: 1.0.0
paths:
  /activity/custom/{id}/:
    put:
      operationId: update
      summary: Updating a Custom Activity instance
      description: >-
        A Custom Activity can be updated to add, change or remove any Custom
        Fields and to change the status between "draft" and "published".


        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: id
          in: path
          required: true
          schema:
            type: string
        - 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_update_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/UpdateCustomActivity'
servers:
  - url: https://api.close.com/api/v1
components:
  schemas:
    UpdateCustomActivityStatus:
      type: string
      enum:
        - draft
        - published
      title: UpdateCustomActivityStatus
    UpdateCustomActivity:
      type: object
      properties:
        activity_at:
          type:
            - string
            - 'null'
          format: date-time
        contact_id:
          type:
            - string
            - 'null'
        custom_fields:
          type:
            - object
            - 'null'
          additionalProperties:
            description: Any type
        pinned:
          type:
            - boolean
            - 'null'
        status:
          $ref: '#/components/schemas/UpdateCustomActivityStatus'
      title: UpdateCustomActivity
    activities.custom_activities_update_Response_200:
      type: object
      properties: {}
      description: Empty response body
      title: activities.custom_activities_update_Response_200
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: basic
    OAuth2:
      type: http
      scheme: bearer

```