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

# Put a routing rule on a destination

> Sending the same `name` twice updates that rule instead of adding a second one, and leaves its cursor alone. `new_qualified_lead` requires an `audience_id`: the fit tier it asks about hangs off an audience. Requires scope `write` and an `Idempotency-Key`.



## OpenAPI

````yaml /openapi.json post /v1/integrations/{id}/rules
openapi: 3.1.0
info:
  title: Ziplined API
  version: 1.0.0
  description: >-
    LinkedIn engagement data about people, companies and posts. The workspace
    comes from the credential; lists page with `limit` and `next_cursor`.
servers:
  - url: https://api.ziplined.io
    description: Production
security: []
tags:
  - name: People
    description: The people in your workspace, and what you sent them.
  - name: Companies
    description: The companies those people work at.
  - name: Posts
    description: Your own posts and their numbers.
  - name: Engagements
    description: One act by one person on one post.
  - name: Insights
    description: Period against period, and the series behind it.
  - name: Audiences
    description: Named lists of people, and their membership.
  - name: Sources
    description: What your radar collects from.
  - name: Integrations
    description: Webhook and Slack destinations, and routing rules.
paths:
  /v1/integrations/{id}/rules:
    post:
      tags:
        - Integrations
      summary: Put a routing rule on a destination
      description: >-
        Sending the same `name` twice updates that rule instead of adding a
        second one, and leaves its cursor alone. `new_qualified_lead` requires
        an `audience_id`: the fit tier it asks about hangs off an audience.
        Requires scope `write` and an `Idempotency-Key`.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: id
          in: path
        - schema:
            type: string
            minLength: 1
            maxLength: 255
            description: >-
              Any client-chosen key, a uuid for example. Sending the same
              request twice with the same key has one effect and returns the
              same response twice; the same key with a different body returns
              409.
            example: 3f1b2c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d
          required: true
          description: >-
            Any client-chosen key, a uuid for example. Sending the same request
            twice with the same key has one effect and returns the same response
            twice; the same key with a different body returns 409.
          name: idempotency-key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RuleCreate'
      responses:
        '201':
          description: The rule as it now stands.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/RoutingRule'
                required:
                  - data
        '400':
          description: A filter value is invalid, or this resource has no such filter.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: Not included in this plan, or a usage cap was exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Wrong workspace, or the credential lacks the required scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No such record, or it does not belong to this workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            The same `Idempotency-Key` was used for a different request, or that
            request is still in flight.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    RuleCreate:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 64
          description: >-
            The stable key of this rule inside the destination. Sending it twice
            updates the rule.
          example: newQualifiedLeads
        event:
          type: string
          enum:
            - new_engagement
            - new_post
            - new_qualified_lead
            - run_completed
            - account_marked
            - account_mark_revoked
          example: new_qualified_lead
        audience_id:
          type: string
          nullable: true
          format: uuid
          description: >-
            Narrow to this audience. Null is everyone. Required for
            `new_qualified_lead`.
        filter:
          $ref: '#/components/schemas/RuleFilter'
        is_active:
          type: boolean
          default: true
        min_interval_minutes:
          anyOf:
            - type: number
              enum:
                - 0
            - type: number
              enum:
                - 60
            - type: number
              enum:
                - 1440
          description: >-
            How long this rule waits between two messages: 0 immediate, 60
            hourly, 1440 daily.
        send_hour_utc:
          type: integer
          minimum: 0
          maximum: 23
          description: >-
            The whole hour in UTC after which a daily send may go out. Only used
            at 1440.
      required:
        - name
        - event
      additionalProperties: false
    RoutingRule:
      type: object
      properties:
        id:
          type: string
        integration_id:
          type: string
        name:
          type: string
        event:
          type: string
          example: new_engagement
        is_active:
          type: boolean
        audience_id:
          type: string
          nullable: true
          description: Null is everyone.
        filter:
          type: object
          nullable: true
          additionalProperties:
            nullable: true
        min_interval_minutes:
          type: number
          description: >-
            How long this rule waits between two messages: 0 immediate, 60
            hourly, 1440 daily.
        send_hour_utc:
          type: number
          nullable: true
          description: >-
            The whole hour in UTC after which a daily send may go out. Only used
            at 1440.
        watermark_at:
          type: string
        created_at:
          type: string
      required:
        - id
        - integration_id
        - name
        - event
        - is_active
        - audience_id
        - filter
        - min_interval_minutes
        - send_hour_utc
        - watermark_at
        - created_at
      additionalProperties: false
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
          required:
            - code
            - message
      required:
        - error
    RuleFilter:
      type: object
      nullable: true
      properties:
        via_kind:
          type: array
          items:
            type: string
            enum:
              - team
              - competitor
              - influencer
              - market
          minItems: 1
        engagement_type:
          type: array
          items:
            type: string
            minLength: 1
          minItems: 1
        company_id:
          type: array
          items:
            type: string
            minLength: 1
          minItems: 1
        min_warmth:
          type: integer
          minimum: 0
          maximum: 100
        min_warmth_tier:
          type: string
          enum:
            - cold
            - cool
            - warm
            - hot
        min_fit_tier:
          type: string
          enum:
            - none
            - low
            - medium
            - high
        min_fit_score:
          type: integer
          minimum: 0
          maximum: 100
        first_engagement_only:
          type: boolean
          enum:
            - true
        pinned_only:
          type: boolean
          enum:
            - true
        orbit:
          type: array
          items:
            type: string
            enum:
              - team
              - competitor
              - influencer
              - market
          minItems: 1
        kind:
          type: array
          items:
            type: string
            minLength: 1
          minItems: 1
        status:
          type: array
          items:
            type: string
            minLength: 1
          minItems: 1
      additionalProperties: false
      description: Optional narrowing. Every key is optional and all of them are ANDed.

````

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