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

# Sync an opportunity

> Sync an opportunity



## OpenAPI

````yaml put /v1/integrations/sync/opportunities
openapi: 3.0.0
info:
  version: 1.0.0
  title: Swagger API
servers:
  - url: https://functions.siro.ai/api-externalApi
    description: Siro API external API endpoint
security: []
externalDocs:
  description: View the raw OpenAPI Specification in JSON format
  url: /swagger.json
paths:
  /v1/integrations/sync/opportunities:
    put:
      summary: Sync an opportunity
      description: Sync an opportunity
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                externalId:
                  type: string
                  description: The ID of the opportunity in the external system
                name:
                  type: string
                  description: The name of the opportunity
                amount:
                  type: number
                  description: The dollar amount of the opportunity
                closedAt:
                  type: string
                  description: >-
                    The closure date of the opportunity in string format e.g.
                    2024-02-28 20:09:58.692
                remoteCreatedAt:
                  type: string
                  description: date the opportunity was created
                lastActivityAt:
                  type: string
                  description: date of last external update
                deletedAt:
                  type: string
                  nullable: true
                  format: date-time
                  description: >-
                    The datetime when this record was deleted in the external
                    system
                disposition:
                  type: string
                  enum:
                    - OPEN
                    - LOST
                    - WON
                  description: '"WON" | "LOST" | "OPEN"'
                accountId:
                  type: string
                  nullable: true
                  description: >-
                    Internal SIRO accountId override for this opportunity.
                    OPTIONAL -- only use if you know the internal value of the
                    Account as it will override the account object args.
                account:
                  type: object
                  nullable: true
                  properties:
                    externalId:
                      type: string
                      description: The ID of the account in the external system.
                    name:
                      type: string
                      description: The name of the account
                    latitude:
                      type: number
                      description: The latitude of the account
                    longitude:
                      type: number
                      description: The longitude of the account
                    addresses:
                      type: array
                      items:
                        type: object
                        properties:
                          country:
                            type: string
                          street:
                            type: string
                          city:
                            type: string
                          state:
                            type: string
                          zip:
                            type: string
                        required:
                          - country
                          - street
                          - city
                          - state
                          - zip
                      description: The address(es) associated to the account
                    phoneNumbers:
                      type: array
                      items:
                        type: string
                      description: The phone number(s) for the account
                    emailAddresses:
                      type: array
                      items:
                        type: string
                      description: The email address(es) for the account
                    lastActivityAt:
                      type: string
                      description: >-
                        The datetime of the last activity on this record in the
                        external system
                    deletedAt:
                      type: string
                      nullable: true
                      format: date-time
                      description: >-
                        The datetime when this record was deleted in the
                        external system
                    owner:
                      type: object
                      nullable: true
                      properties:
                        externalId:
                          type: string
                      required:
                        - externalId
                      description: >-
                        The owner user of this record in the external system
                        (optional)
                    mergedToExternalId:
                      type: string
                      description: >-
                        If this Account was merged into another, the surviving
                        Account externalId. Will migrate all existing references
                        from this Account to the surviving Account.
                    mergedFromExternalIds:
                      type: array
                      items:
                        type: string
                      description: >-
                        If other Accounts were merged into this one, their
                        externalIds. Will migrate all existing references from
                        those Accounts to this Account.
                  description: >-
                    The associated account for this opportunity. Note: supplying
                    just an externalId will resolve to an already-synced account
                contact:
                  type: object
                  nullable: true
                  properties:
                    externalId:
                      type: string
                      description: The ID of the contact in the external system
                    name:
                      type: string
                      description: The name of the contact
                    latitude:
                      type: number
                      description: The latitude of the contact
                    longitude:
                      type: number
                      description: The longitude of the contact
                    account:
                      type: object
                      nullable: true
                      properties:
                        externalId:
                          type: string
                          description: The ID of the account in the external system.
                        name:
                          type: string
                          description: The name of the account
                        latitude:
                          type: number
                          description: The latitude of the account
                        longitude:
                          type: number
                          description: The longitude of the account
                        addresses:
                          type: array
                          items:
                            type: object
                            properties:
                              country:
                                type: string
                              street:
                                type: string
                              city:
                                type: string
                              state:
                                type: string
                              zip:
                                type: string
                            required:
                              - country
                              - street
                              - city
                              - state
                              - zip
                          description: The address(es) associated to the account
                        phoneNumbers:
                          type: array
                          items:
                            type: string
                          description: The phone number(s) for the account
                        emailAddresses:
                          type: array
                          items:
                            type: string
                          description: The email address(es) for the account
                        lastActivityAt:
                          type: string
                          description: >-
                            The datetime of the last activity on this record in
                            the external system
                        deletedAt:
                          type: string
                          nullable: true
                          format: date-time
                          description: >-
                            The datetime when this record was deleted in the
                            external system
                        owner:
                          type: object
                          nullable: true
                          properties:
                            externalId:
                              type: string
                          required:
                            - externalId
                          description: >-
                            The owner user of this record in the external system
                            (optional)
                        mergedToExternalId:
                          type: string
                          description: >-
                            If this Account was merged into another, the
                            surviving Account externalId. Will migrate all
                            existing references from this Account to the
                            surviving Account.
                        mergedFromExternalIds:
                          type: array
                          items:
                            type: string
                          description: >-
                            If other Accounts were merged into this one, their
                            externalIds. Will migrate all existing references
                            from those Accounts to this Account.
                      description: >-
                        The associated account for this contact. Note: supplying
                        just an externalId will resolve to an already-synced
                        account
                    addresses:
                      type: array
                      items:
                        type: object
                        properties:
                          country:
                            type: string
                          street:
                            type: string
                          city:
                            type: string
                          state:
                            type: string
                          zip:
                            type: string
                        required:
                          - country
                          - street
                          - city
                          - state
                          - zip
                      description: The address(es) associated with this contact
                    phoneNumbers:
                      type: array
                      items:
                        type: string
                      description: The phone number(s) associated with this contact
                    emailAddresses:
                      type: array
                      items:
                        type: string
                      description: The email address(es) associated with this contact
                    lastActivityAt:
                      type: string
                      description: >-
                        The datetime of the last activity on this record in the
                        external system
                    deletedAt:
                      type: string
                      nullable: true
                      format: date-time
                      description: >-
                        The datetime when this record was deleted in the
                        external system
                    owner:
                      type: object
                      nullable: true
                      properties:
                        externalId:
                          type: string
                      required:
                        - externalId
                      description: >-
                        The owner of this record in the external system
                        (optional)
                    mergedToExternalId:
                      type: string
                      description: >-
                        If this Contact was merged into another, the surviving
                        Contact externalId. Will migrate all existing references
                        from this Contact to the surviving Contact.
                    mergedFromExternalIds:
                      type: array
                      items:
                        type: string
                      description: >-
                        If other Contacts were merged into this one, their
                        externalIds. Will migrate all existing references from
                        those Contacts to this Contact.
                  required:
                    - externalId
                  description: >-
                    (DEPRECATED IN FAVOR OF CONTACTS ARRAY) The associated
                    contact for this opportunity. Note: supplying just an
                    externalId will resolve to an already-synced contact
                opportunityContacts:
                  type: array
                  items:
                    type: object
                    properties:
                      externalId:
                        type: string
                        description: The ID of the contact in the external system
                      name:
                        type: string
                        description: The name of the contact
                      latitude:
                        type: number
                        description: The latitude of the contact
                      longitude:
                        type: number
                        description: The longitude of the contact
                      account:
                        type: object
                        nullable: true
                        properties:
                          externalId:
                            type: string
                            description: The ID of the account in the external system.
                          name:
                            type: string
                            description: The name of the account
                          latitude:
                            type: number
                            description: The latitude of the account
                          longitude:
                            type: number
                            description: The longitude of the account
                          addresses:
                            type: array
                            items:
                              type: object
                              properties:
                                country:
                                  type: string
                                street:
                                  type: string
                                city:
                                  type: string
                                state:
                                  type: string
                                zip:
                                  type: string
                              required:
                                - country
                                - street
                                - city
                                - state
                                - zip
                            description: The address(es) associated to the account
                          phoneNumbers:
                            type: array
                            items:
                              type: string
                            description: The phone number(s) for the account
                          emailAddresses:
                            type: array
                            items:
                              type: string
                            description: The email address(es) for the account
                          lastActivityAt:
                            type: string
                            description: >-
                              The datetime of the last activity on this record
                              in the external system
                          deletedAt:
                            type: string
                            nullable: true
                            format: date-time
                            description: >-
                              The datetime when this record was deleted in the
                              external system
                          owner:
                            type: object
                            nullable: true
                            properties:
                              externalId:
                                type: string
                            required:
                              - externalId
                            description: >-
                              The owner user of this record in the external
                              system (optional)
                          mergedToExternalId:
                            type: string
                            description: >-
                              If this Account was merged into another, the
                              surviving Account externalId. Will migrate all
                              existing references from this Account to the
                              surviving Account.
                          mergedFromExternalIds:
                            type: array
                            items:
                              type: string
                            description: >-
                              If other Accounts were merged into this one, their
                              externalIds. Will migrate all existing references
                              from those Accounts to this Account.
                        description: >-
                          The associated account for this contact. Note:
                          supplying just an externalId will resolve to an
                          already-synced account
                      addresses:
                        type: array
                        items:
                          type: object
                          properties:
                            country:
                              type: string
                            street:
                              type: string
                            city:
                              type: string
                            state:
                              type: string
                            zip:
                              type: string
                          required:
                            - country
                            - street
                            - city
                            - state
                            - zip
                        description: The address(es) associated with this contact
                      phoneNumbers:
                        type: array
                        items:
                          type: string
                        description: The phone number(s) associated with this contact
                      emailAddresses:
                        type: array
                        items:
                          type: string
                        description: The email address(es) associated with this contact
                      lastActivityAt:
                        type: string
                        description: >-
                          The datetime of the last activity on this record in
                          the external system
                      deletedAt:
                        type: string
                        nullable: true
                        format: date-time
                        description: >-
                          The datetime when this record was deleted in the
                          external system
                      owner:
                        type: object
                        nullable: true
                        properties:
                          externalId:
                            type: string
                        required:
                          - externalId
                        description: >-
                          The owner of this record in the external system
                          (optional)
                      mergedToExternalId:
                        type: string
                        description: >-
                          If this Contact was merged into another, the surviving
                          Contact externalId. Will migrate all existing
                          references from this Contact to the surviving Contact.
                      mergedFromExternalIds:
                        type: array
                        items:
                          type: string
                        description: >-
                          If other Contacts were merged into this one, their
                          externalIds. Will migrate all existing references from
                          those Contacts to this Contact.
                      isPrimary:
                        type: boolean
                    required:
                      - externalId
                  description: >-
                    The associated contacts for this opportunity. Note:
                    supplying just an externalId will resolve to an
                    already-synced contact
                opportunityUsers:
                  type: array
                  items:
                    type: object
                    properties:
                      externalId:
                        type: string
                        description: The user's externalId in the external system
                      email:
                        type: string
                        description: The user's email, preferably their email in Siro
                      shareOfSale:
                        type: number
                        description: >-
                          The user's fractional share of the sale, e.g. 0.5 for
                          50% or 1 for 100% (Optional)
                      name:
                        type: string
                        description: The name of the user, e.g. John Smith
                      deletedAt:
                        type: string
                        nullable: true
                        format: date-time
                        description: >-
                          The datetime when this record was deleted in the
                          external system (Optional)
                    required:
                      - externalId
                  description: The users associated with this opportunity
              required:
                - externalId
      responses:
        '200':
          description: Sync an opportunity
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      externalId:
                        type: string
                        description: >-
                          The ID of the opportunity in the external system (e.g.
                          Salesforce)
                      name:
                        type: string
                        nullable: true
                        description: The name of the opportunity
                      amount:
                        type: number
                        description: The dollar amount of the opportunity
                      closedAt:
                        type: string
                        description: The closure date of the opportunity
                      disposition:
                        type: string
                        description: '"WON" | "LOST" | "OPEN"'
                      createdAt:
                        type: string
                        description: The date the opportunity was created
                      updatedAt:
                        type: string
                        description: The date the opportunity was last updated
                      recordingId:
                        type: string
                        description: The ID of the recording associated to the opportunity
                      accountId:
                        type: string
                      organizationId:
                        type: string
                      account:
                        nullable: true
                      opportunityUsers:
                        type: array
                        items:
                          nullable: true
                    required:
                      - id
                      - externalId
                      - createdAt
                      - updatedAt
                      - organizationId
                required:
                  - data
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Organization API token
      description: >-
        Organization integration token from Siro admin (Person icon → API
        Tokens). Send Authorization: Bearer <organization-api-token>. This is
        not the OAuth access token used with api.siro.ai user-scoped endpoints.
      x-default: <organization-api-token>

````