# Log an external Call activity

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

Use this endpoint to log calls made outside of the Close built-in VoIP system.

*status*: defaults to `completed`

*direction* (optional): `outbound` or `inbound`

*recording_url*: you can post a URL pointing to the MP3 recording of your call. For security reasons, we require the URL to be secure (i.e. starting with https://)

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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Close API
  version: 1.0.0
paths:
  /activity/call/:
    post:
      operationId: create
      summary: Log an external Call activity
      description: >-
        Use this endpoint to log calls made outside of the Close built-in VoIP
        system.


        *status*: defaults to `completed`


        *direction* (optional): `outbound` or `inbound`


        *recording_url*: you can post a URL pointing to the MP3 recording of
        your call. For security reasons, we require the URL to be secure (i.e.
        starting with https://)
      tags:
        - subpackage_activitiesCalls
      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/CallActivity'
        '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/CreateCallActivity'
servers:
  - url: https://api.close.com/api/v1
components:
  schemas:
    CreateCallActivityDirection:
      type: string
      enum:
        - inbound
        - outbound
      title: CreateCallActivityDirection
    CreateCallActivitySource:
      type: string
      enum:
        - Close.io
        - External
      title: CreateCallActivitySource
    CreateCallActivityStatus:
      type: string
      enum:
        - created
        - in-progress
        - completed
        - cancel
        - no-answer
        - busy
        - failed
        - timeout
      title: CreateCallActivityStatus
    CreateCallActivity:
      type: object
      properties:
        activity_at:
          type:
            - string
            - 'null'
          format: date-time
        contact_id:
          type:
            - string
            - 'null'
        conversation_type_id:
          type:
            - string
            - 'null'
        created_by_id:
          type:
            - string
            - 'null'
        custom_fields:
          type:
            - object
            - 'null'
          additionalProperties:
            description: Any type
        date_created:
          type:
            - string
            - 'null'
          format: date-time
        direction:
          $ref: '#/components/schemas/CreateCallActivityDirection'
        duration:
          type:
            - integer
            - 'null'
        lead_id:
          type:
            - string
            - 'null'
        note:
          type:
            - string
            - 'null'
        note_html:
          type:
            - string
            - 'null'
        organization_id:
          type:
            - string
            - 'null'
        outcome_id:
          type:
            - string
            - 'null'
        phone:
          type:
            - string
            - 'null'
          description: Phone number in E.164 format
        playbook_id:
          type:
            - string
            - 'null'
        quality_info:
          type:
            - string
            - 'null'
        recording_url:
          type:
            - string
            - 'null'
          format: uri
        source:
          $ref: '#/components/schemas/CreateCallActivitySource'
        status:
          $ref: '#/components/schemas/CreateCallActivityStatus'
        user_id:
          type:
            - string
            - 'null'
        voicemail_url:
          type:
            - string
            - 'null'
          format: uri
      title: CreateCallActivity
    PhoneActivitySource:
      type: string
      enum:
        - Close.io
        - External
      description: Source of a phone call or an SMS message.
      title: PhoneActivitySource
    CallStatus:
      type: string
      enum:
        - created
        - in-progress
        - completed
        - cancel
        - no-answer
        - busy
        - failed
        - timeout
      description: >-
        Indicates the status of the call.


        A brand new call starts off as `Created`. Then, if it's answered, its

        status changes to `InProgress`. Finally, once either party hangs up, the

        status is updated to `Completed`.


        Of course, that's the happy path. There are other scenarios in which the

        call assumes a different status. Read the comments below for details.


        Also, see possible call status values for Twilio [0] and, for historical

        calls, Plivo [1] from which the statuses below are derived.


        [0]
        https://www.twilio.com/docs/voice/api/call-resource#call-status-values

        [1]
        https://www.plivo.com/docs/voice/detailed-reference/xml/introduction/request#call-status
      title: CallStatus
    CallActivity:
      type: object
      properties:
        _type:
          type: string
        activity_at:
          type:
            - string
            - 'null'
          format: date-time
        contact_id:
          type:
            - string
            - 'null'
        created_by:
          type:
            - string
            - 'null'
        created_by_name:
          type:
            - string
            - 'null'
        date_created:
          type: string
          format: date-time
        date_updated:
          type: string
          format: date-time
        id:
          type: string
        lead_id:
          type:
            - string
            - 'null'
        organization_id:
          type: string
        outcome_id:
          type:
            - string
            - 'null'
        sequence_id:
          type:
            - string
            - 'null'
        sequence_name:
          type:
            - string
            - 'null'
        sequence_subscription_id:
          type:
            - string
            - 'null'
        source:
          $ref: '#/components/schemas/PhoneActivitySource'
        status:
          $ref: '#/components/schemas/CallStatus'
        updated_by:
          type:
            - string
            - 'null'
        updated_by_name:
          type:
            - string
            - 'null'
        user_id:
          type:
            - string
            - 'null'
        user_name:
          type:
            - string
            - 'null'
        users:
          type: array
          items:
            type: string
      required:
        - _type
        - activity_at
        - contact_id
        - created_by
        - date_created
        - date_updated
        - id
        - lead_id
        - organization_id
        - outcome_id
        - source
        - status
        - updated_by
        - user_id
        - users
      title: CallActivity
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: basic
    OAuth2:
      type: http
      scheme: bearer

```