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

# Push a record to the CRM now (retry a sync issue)

> Writes one account, opportunity or contact to the workspace's CRM now, as Retry on a record's sync issue does in the app, and answers what the CRM said, with the record's sync issue after it. An account goes to every CRM its write-back is on for. The admin's CRM write-back switch is honoured, and checked first, as in the app: with it off, nothing is pushed and the answer is OFF, whether or not the record exists. With it on, a record that does not exist is a 404. An opportunity id that is not a number is always a 422.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/integrations/crm/records/{entity_type}/{record_id}/push
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/integrations/crm/records/{entity_type}/{record_id}/push:
    post:
      tags:
        - integrations
      summary: Push a record to the CRM now (retry a sync issue)
      description: >-
        Writes one account, opportunity or contact to the workspace's CRM now,
        as Retry on a record's sync issue does in the app, and answers what the
        CRM said, with the record's sync issue after it. An account goes to
        every CRM its write-back is on for. The admin's CRM write-back switch is
        honoured, and checked first, as in the app: with it off, nothing is
        pushed and the answer is OFF, whether or not the record exists. With it
        on, a record that does not exist is a 404. An opportunity id that is not
        a number is always a 422.
      operationId: integrations_crm_push
      parameters:
        - description: account, opportunity or contact
          in: path
          name: entity_type
          required: true
          schema:
            enum:
              - account
              - opportunity
              - contact
            type: string
        - description: >-
            The record's id: an account's or opportunity's id; for contact, the
            person's id
          in: path
          name: record_id
          required: true
          schema:
            pattern: ^[^/\x00-\x1f]{1,128}$
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrmPush'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    CrmPush:
      properties:
        entity_type:
          enum:
            - account
            - opportunity
            - contact
          title: Entity Type
          type: string
        errors:
          description: The CRM's errors, masked as a run's `message` is
          items:
            type: string
          title: Errors
          type: array
        issue:
          anyOf:
            - $ref: '#/components/schemas/SyncIssue'
            - type: 'null'
          description: >-
            The record's sync issue after the push, as GET
            /v1/integrations/sync-issues lists it; null when it has none
        reason:
          anyOf:
            - type: string
            - type: 'null'
          description: Why it was SKIPPED or OFF
          title: Reason
        record_id:
          title: Record Id
          type: string
        status:
          anyOf:
            - enum:
                - SYNCED
                - FAILED
                - SKIPPED
                - 'OFF'
              type: string
            - type: string
          description: >-
            SYNCED: the CRM took it; FAILED: the CRM refused it (see `errors`
            and `issue`); SKIPPED: there was nothing to push, or the record is
            not one the sync pushes (`reason`); OFF: CRM write-back for this
            entity type is off (`reason`; PATCH /v1/settings/crm-sync turns it
            on)
          title: Status
      required:
        - entity_type
        - record_id
        - status
        - reason
        - errors
        - issue
      title: CrmPush
      type: object
    SyncIssue:
      properties:
        crm:
          description: >-
            The CRM of its worst problem (FAILED before ERRORED, then the
            newest)
          title: Crm
          type: string
        destinations:
          description: >-
            One entry per CRM it could not be written to, worst first (an
            account writes to every push CRM)
          items:
            $ref: '#/components/schemas/SyncIssueDestination'
          title: Destinations
          type: array
        entity_type:
          enum:
            - account
            - opportunity
            - contact
            - project_task
            - activity
          title: Entity Type
          type: string
        error:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Its worst problem's first error message (or code), else the CRM's
            masked answer; null when neither
          title: Error
        last_attempt_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: When the worst problem's last write failed
          title: Last Attempt At
        record_id:
          description: >-
            The record's id: an account's, opportunity's or task's id; for
            contact, the person's id
          title: Record Id
          type: string
        state:
          anyOf:
            - enum:
                - ERRORED
                - FAILED
              type: string
            - type: string
          description: The state of its worst problem
          title: State
      required:
        - entity_type
        - record_id
        - crm
        - state
        - error
        - last_attempt_at
        - destinations
      title: SyncIssue
      type: object
    SyncIssueDestination:
      properties:
        attempts:
          description: Failed writes in a row (shown at most max_attempts)
          title: Attempts
          type: integer
        crm:
          description: 'The CRM the write went to: SALESFORCE, HUBSPOT, GAINSIGHT, ...'
          title: Crm
          type: string
        crm_response:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            When no error could be parsed from the CRM's answer, the answer
            itself: masked as a run's `message` is, and cut at 200 characters.
            Null when `errors` names them
          title: Crm Response
        errors:
          description: The errors the CRM named, as parsed from its answer
          items:
            $ref: '#/components/schemas/SyncIssueError'
          title: Errors
          type: array
        last_attempt_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: When the last write failed
          title: Last Attempt At
        max_attempts:
          title: Max Attempts
          type: integer
        rejected_fields:
          description: The fields the CRM refused
          items:
            type: string
          title: Rejected Fields
          type: array
        state:
          anyOf:
            - enum:
                - ERRORED
                - FAILED
              type: string
            - type: string
          description: >-
            ERRORED: the next sync tries again; FAILED: it failed max_attempts
            times in a row and is not tried again until the record changes or
            someone retries it in the app
          title: State
        status_code:
          anyOf:
            - type: integer
            - type: 'null'
          description: The CRM's HTTP status
          title: Status Code
      required:
        - crm
        - state
        - attempts
        - max_attempts
        - last_attempt_at
        - status_code
        - errors
        - rejected_fields
        - crm_response
      title: SyncIssueDestination
      type: object
    SyncIssueError:
      properties:
        code:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The CRM's error code, e.g. INVALID_FIELD or REQUIRED_FIELD_MISSING;
            masked as `message` is when it is not a code's shape
          title: Code
        fields:
          description: The CRM fields it names
          items:
            type: string
          title: Fields
          type: array
        message:
          anyOf:
            - type: string
            - type: 'null'
          description: The CRM's message, masked as a run's `message` is
          title: Message
      required:
        - code
        - fields
        - message
      title: SyncIssueError
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.