> ## Documentation index
> Fetch the complete documentation index at: https://novu.docs7.io/llms.txt
> Ask it with GET https://novu.docs7.io/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.

# Update an agent integration

> Update which integration a link points to (by integration **identifier**, not the internal _id).

`PATCH /v1/agents/{identifier}/integrations/{agentIntegrationId}`

## OpenAPI

````yaml https://spec.speakeasy.com/novu/novu/json-development-with-code-samples patch /v1/agents/{identifier}/integrations/{agentIntegrationId}
openapi: 3.0.0
info:
  title: Novu API
  description: Novu REST API. Please see https://docs.novu.co/api-reference for
    more details.
  version: 3.19.2
  contact:
    name: Novu Support
    url: https://discord.gg/novu
    email: support@novu.co
  termsOfService: https://novu.co/terms
  license:
    name: MIT
    url: https://opensource.org/license/mit
servers:
  - url: https://api.novu.co
  - url: https://eu.api.novu.co
security:
  - secretKey: []
tags:
  - name: Events
    description: Events represent a change in state of a subscriber. They are used
      to trigger workflows, and enable you to send notifications to subscribers
      based on their actions.
    externalDocs:
      url: https://docs.novu.co/workflows
  - name: Subscribers
    description: A subscriber in Novu represents someone who should receive a
      message. A subscriber's profile information contains important attributes
      about the subscriber that will be used in messages (name, email). The
      subscriber object can contain other key-value pairs that can be used to
      further personalize your messages.
    externalDocs:
      url: https://docs.novu.co/subscribers/subscribers
  - name: Topics
    description: Topics are a way to group subscribers together so that they can be
      notified of events at once. A topic is identified by a custom key. This
      can be helpful for things like sending out marketing emails or notifying
      users of new features. Topics can also be used to send notifications to
      the subscribers who have been grouped together based on their interests,
      location, activities and much more.
    externalDocs:
      url: https://docs.novu.co/subscribers/topics
  - name: Integrations
    description: With the help of the Integration Store, you can easily integrate
      your favorite delivery provider. During the runtime of the API, the
      Integrations Store is responsible for storing the configurations of all
      the providers.
    externalDocs:
      url: https://docs.novu.co/platform/integrations/overview
  - name: Workflows
    description: All notifications are sent via a workflow. Each workflow acts as a
      container for the logic and blueprint that are associated with a type of
      notification in your system.
    externalDocs:
      url: https://docs.novu.co/workflows
  - name: Messages
    description: A message in Novu represents a notification delivered to a
      recipient on a particular channel. Messages contain information about the
      request that triggered its delivery, a view of the data sent to the
      recipient, and a timeline of its lifecycle events. Learn more about
      messages.
    externalDocs:
      url: https://docs.novu.co/workflows/messages
  - name: Environments
    description: Environments allow you to manage different stages of your
      application development lifecycle. Each environment has its own set of API
      keys and configurations, enabling you to separate development, staging,
      and production workflows.
    externalDocs:
      url: https://docs.novu.co/platform/environments
  - name: Layouts
    description: Layouts are reusable wrappers for your email notifications.
    externalDocs:
      url: https://docs.novu.co/platform/workflow/layouts
  - name: Translations
    description: Used to localize your notifications to different languages.
    externalDocs:
      url: https://docs.novu.co/platform/workflow/advanced-features/translations
  - name: Domains
    description: Used to manage your inbound email domains.
    externalDocs:
      url: https://docs.novu.co/platform/domains
  - name: Agents
    description: Agents are conversational assistants that receive inbound messages
      from connected channels and respond through a custom code bridge or a
      managed runtime provider.
    externalDocs:
      url: https://docs.novu.co/agents
paths:
  /v1/agents/{identifier}/integrations/{agentIntegrationId}:
    patch:
      description: Update which integration a link points to (by integration
        **identifier**, not the internal _id).
      operationId: AgentIntegrationsController_updateAgentIntegration
      parameters:
        - name: identifier
          required: true
          in: path
          schema:
            type: string
        - name: agentIntegrationId
          required: true
          in: path
          schema:
            type: string
        - name: idempotency-key
          in: header
          description: A header for idempotency purposes
          required: false
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateAgentIntegrationRequestDto"
      responses:
        "200":
          description: OK
          headers:
            Content-Type:
              $ref: "#/components/headers/Content-Type"
            RateLimit-Limit:
              $ref: "#/components/headers/RateLimit-Limit"
            RateLimit-Remaining:
              $ref: "#/components/headers/RateLimit-Remaining"
            RateLimit-Reset:
              $ref: "#/components/headers/RateLimit-Reset"
            RateLimit-Policy:
              $ref: "#/components/headers/RateLimit-Policy"
            Idempotency-Key:
              $ref: "#/components/headers/Idempotency-Key"
            Idempotency-Replay:
              $ref: "#/components/headers/Idempotency-Replay"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AgentIntegrationResponseDto"
        "400":
          description: Bad Request
          headers:
            Content-Type:
              $ref: "#/components/headers/Content-Type"
            RateLimit-Limit:
              $ref: "#/components/headers/RateLimit-Limit"
            RateLimit-Remaining:
              $ref: "#/components/headers/RateLimit-Remaining"
            RateLimit-Reset:
              $ref: "#/components/headers/RateLimit-Reset"
            RateLimit-Policy:
              $ref: "#/components/headers/RateLimit-Policy"
            Idempotency-Key:
              $ref: "#/components/headers/Idempotency-Key"
            Idempotency-Replay:
              $ref: "#/components/headers/Idempotency-Replay"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
        "401":
          description: Unauthorized
          headers:
            Content-Type:
              $ref: "#/components/headers/Content-Type"
            RateLimit-Limit:
              $ref: "#/components/headers/RateLimit-Limit"
            RateLimit-Remaining:
              $ref: "#/components/headers/RateLimit-Remaining"
            RateLimit-Reset:
              $ref: "#/components/headers/RateLimit-Reset"
            RateLimit-Policy:
              $ref: "#/components/headers/RateLimit-Policy"
            Idempotency-Key:
              $ref: "#/components/headers/Idempotency-Key"
            Idempotency-Replay:
              $ref: "#/components/headers/Idempotency-Replay"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
        "403":
          description: Forbidden
          headers:
            Content-Type:
              $ref: "#/components/headers/Content-Type"
            RateLimit-Limit:
              $ref: "#/components/headers/RateLimit-Limit"
            RateLimit-Remaining:
              $ref: "#/components/headers/RateLimit-Remaining"
            RateLimit-Reset:
              $ref: "#/components/headers/RateLimit-Reset"
            RateLimit-Policy:
              $ref: "#/components/headers/RateLimit-Policy"
            Idempotency-Key:
              $ref: "#/components/headers/Idempotency-Key"
            Idempotency-Replay:
              $ref: "#/components/headers/Idempotency-Replay"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
        "404":
          description: The agent, integration, or link was not found.
          headers:
            Content-Type:
              $ref: "#/components/headers/Content-Type"
            RateLimit-Limit:
              $ref: "#/components/headers/RateLimit-Limit"
            RateLimit-Remaining:
              $ref: "#/components/headers/RateLimit-Remaining"
            RateLimit-Reset:
              $ref: "#/components/headers/RateLimit-Reset"
            RateLimit-Policy:
              $ref: "#/components/headers/RateLimit-Policy"
            Idempotency-Key:
              $ref: "#/components/headers/Idempotency-Key"
            Idempotency-Replay:
              $ref: "#/components/headers/Idempotency-Replay"
        "405":
          description: Method Not Allowed
          headers:
            Content-Type:
              $ref: "#/components/headers/Content-Type"
            RateLimit-Limit:
              $ref: "#/components/headers/RateLimit-Limit"
            RateLimit-Remaining:
              $ref: "#/components/headers/RateLimit-Remaining"
            RateLimit-Reset:
              $ref: "#/components/headers/RateLimit-Reset"
            RateLimit-Policy:
              $ref: "#/components/headers/RateLimit-Policy"
            Idempotency-Key:
              $ref: "#/components/headers/Idempotency-Key"
            Idempotency-Replay:
              $ref: "#/components/headers/Idempotency-Replay"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
        "409":
          headers:
            Content-Type:
              $ref: "#/components/headers/Content-Type"
            RateLimit-Limit:
              $ref: "#/components/headers/RateLimit-Limit"
            RateLimit-Remaining:
              $ref: "#/components/headers/RateLimit-Remaining"
            RateLimit-Reset:
              $ref: "#/components/headers/RateLimit-Reset"
            RateLimit-Policy:
              $ref: "#/components/headers/RateLimit-Policy"
            Idempotency-Key:
              $ref: "#/components/headers/Idempotency-Key"
            Idempotency-Replay:
              $ref: "#/components/headers/Idempotency-Replay"
          description: Conflict
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
        "413":
          description: Payload Too Large
          headers:
            Content-Type:
              $ref: "#/components/headers/Content-Type"
            RateLimit-Limit:
              $ref: "#/components/headers/RateLimit-Limit"
            RateLimit-Remaining:
              $ref: "#/components/headers/RateLimit-Remaining"
            RateLimit-Reset:
              $ref: "#/components/headers/RateLimit-Reset"
            RateLimit-Policy:
              $ref: "#/components/headers/RateLimit-Policy"
            Idempotency-Key:
              $ref: "#/components/headers/Idempotency-Key"
            Idempotency-Replay:
              $ref: "#/components/headers/Idempotency-Replay"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
        "414":
          description: URI Too Long
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
        "415":
          description: Unsupported Media Type
          headers:
            Content-Type:
              $ref: "#/components/headers/Content-Type"
            RateLimit-Limit:
              $ref: "#/components/headers/RateLimit-Limit"
            RateLimit-Remaining:
              $ref: "#/components/headers/RateLimit-Remaining"
            RateLimit-Reset:
              $ref: "#/components/headers/RateLimit-Reset"
            RateLimit-Policy:
              $ref: "#/components/headers/RateLimit-Policy"
            Idempotency-Key:
              $ref: "#/components/headers/Idempotency-Key"
            Idempotency-Replay:
              $ref: "#/components/headers/Idempotency-Replay"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
        "422":
          description: Unprocessable Entity
          headers:
            Content-Type:
              $ref: "#/components/headers/Content-Type"
            RateLimit-Limit:
              $ref: "#/components/headers/RateLimit-Limit"
            RateLimit-Remaining:
              $ref: "#/components/headers/RateLimit-Remaining"
            RateLimit-Reset:
              $ref: "#/components/headers/RateLimit-Reset"
            RateLimit-Policy:
              $ref: "#/components/headers/RateLimit-Policy"
            Idempotency-Key:
              $ref: "#/components/headers/Idempotency-Key"
            Idempotency-Replay:
              $ref: "#/components/headers/Idempotency-Replay"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationErrorDto"
        "429":
          description: "The client has sent too many requests in a given amount of time. "
          headers:
            Content-Type:
              $ref: "#/components/headers/Content-Type"
            RateLimit-Limit:
              $ref: "#/components/headers/RateLimit-Limit"
            RateLimit-Remaining:
              $ref: "#/components/headers/RateLimit-Remaining"
            RateLimit-Reset:
              $ref: "#/components/headers/RateLimit-Reset"
            RateLimit-Policy:
              $ref: "#/components/headers/RateLimit-Policy"
            Idempotency-Key:
              $ref: "#/components/headers/Idempotency-Key"
            Idempotency-Replay:
              $ref: "#/components/headers/Idempotency-Replay"
            Retry-After:
              $ref: "#/components/headers/Retry-After"
          content:
            application/json:
              schema:
                type: string
                example: API rate limit exceeded
        "500":
          description: Internal Server Error
          headers:
            Content-Type:
              $ref: "#/components/headers/Content-Type"
            RateLimit-Limit:
              $ref: "#/components/headers/RateLimit-Limit"
            RateLimit-Remaining:
              $ref: "#/components/headers/RateLimit-Remaining"
            RateLimit-Reset:
              $ref: "#/components/headers/RateLimit-Reset"
            RateLimit-Policy:
              $ref: "#/components/headers/RateLimit-Policy"
            Idempotency-Key:
              $ref: "#/components/headers/Idempotency-Key"
            Idempotency-Replay:
              $ref: "#/components/headers/Idempotency-Replay"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorDto"
        "503":
          description: The server is currently unable to handle the request due to a
            temporary overload or scheduled maintenance, which will likely be
            alleviated after some delay.
          headers:
            Content-Type:
              $ref: "#/components/headers/Content-Type"
            RateLimit-Limit:
              $ref: "#/components/headers/RateLimit-Limit"
            RateLimit-Remaining:
              $ref: "#/components/headers/RateLimit-Remaining"
            RateLimit-Reset:
              $ref: "#/components/headers/RateLimit-Reset"
            RateLimit-Policy:
              $ref: "#/components/headers/RateLimit-Policy"
            Idempotency-Key:
              $ref: "#/components/headers/Idempotency-Key"
            Idempotency-Replay:
              $ref: "#/components/headers/Idempotency-Replay"
            Retry-After:
              $ref: "#/components/headers/Retry-After"
          content:
            application/json:
              schema:
                type: string
                example: Please wait some time, then try again.
      security:
        - secretKey: []
      summary: Update an agent integration
      tags:
        - Agents
      x-speakeasy-group: Agents.Integrations
      x-speakeasy-name-override: update
      x-codeSamples:
        - lang: php
          label: PHP
          source: >-
            declare(strict_types=1);


            require 'vendor/autoload.php';


            use novu;

            use novu\Models\Components;


            $sdk = novu\Novu::builder()
                ->setSecurity(
                    'YOUR_SECRET_KEY_HERE'
                )
                ->build();

            $updateAgentIntegrationRequestDto = new
            Components\UpdateAgentIntegrationRequestDto(
                integrationIdentifier: '<value>',
            );


            $response = $sdk->agents->integrations->update(
                identifier: '<value>',
                agentIntegrationId: '<id>',
                updateAgentIntegrationRequestDto: $updateAgentIntegrationRequestDto

            );


            if ($response->agentIntegrationResponseDto !== null) {
                // handle response
            }
        - lang: python
          label: Python
          source: >-
            from novu_py import Novu



            with Novu(
                secret_key="YOUR_SECRET_KEY_HERE",
            ) as novu:

                res = novu.agents.integrations.update(identifier="<value>", agent_integration_id="<id>", update_agent_integration_request_dto={
                    "integration_identifier": "<value>",
                })

                # Handle response
                print(res)
        - lang: go
          label: Go
          source: >-
            package main


            import(
            	"context"
            	"github.com/novuhq/novu-go/v3"
            	"github.com/novuhq/novu-go/v3/models/components"
            	"log"
            )


            func main() {
                ctx := context.Background()

                s := v3.New(
                    v3.WithSecurity("YOUR_SECRET_KEY_HERE"),
                )

                res, err := s.Agents.Integrations.Update(ctx, "<value>", "<id>", components.UpdateAgentIntegrationRequestDto{
                    IntegrationIdentifier: "<value>",
                }, nil)
                if err != nil {
                    log.Fatal(err)
                }
                if res.AgentIntegrationResponseDto != nil {
                    // handle response
                }
            }
        - lang: typescript
          label: TypeScript
          source: |-
            import { Novu } from "@novu/api";

            const novu = new Novu({
              secretKey: "YOUR_SECRET_KEY_HERE",
            });

            async function run() {
              const result = await novu.agents.integrations.update({
                identifier: "<value>",
                agentIntegrationId: "<id>",
                updateAgentIntegrationRequestDto: {
                  integrationIdentifier: "<value>",
                },
              });

              console.log(result);
            }

            run();
        - lang: csharp
          label: Csharp (SDK)
          source: >-
            using Novu;

            using Novu.Models.Components;


            var sdk = new NovuSDK(secretKey: "YOUR_SECRET_KEY_HERE");


            var res = await sdk.Agents.Integrations.UpdateAsync(
                identifier: "<value>",
                agentIntegrationId: "<id>",
                updateAgentIntegrationRequestDto: new UpdateAgentIntegrationRequestDto() {
                    IntegrationIdentifier = "<value>",
                }
            );


            // handle response
components:
  securitySchemes:
    secretKey:
      type: apiKey
      name: Authorization
      in: header
      description: 'API key authentication. Allowed headers-- "Authorization: ApiKey
        <novu_secret_key>".'
      x-speakeasy-example: YOUR_SECRET_KEY_HERE
  schemas:
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code of the error response.
          example: 404
        timestamp:
          type: string
          description: Timestamp of when the error occurred.
          example: 2024-12-12T13:00:00Z
        path:
          type: string
          description: The path where the error occurred.
          example: /api/v1/resource
        message:
          description: Value that failed validation
          oneOf:
            - type: string
              nullable: true
            - type: number
            - type: boolean
            - type: object
              nullable: true
            - type: array
              items:
                anyOf:
                  - type: string
                    nullable: true
                  - type: number
                  - type: boolean
                  - type: object
                    additionalProperties: true
          example: "xx xx xx "
        ctx:
          type: object
          description: Optional context object for additional error details.
          additionalProperties: true
          example:
            workflowId: some_wf_id
            stepId: some_wf_id
        errorId:
          type: string
          description: >-
            Optional unique identifier for the error, useful for tracking using
            Sentry and 
                  New Relic, only available for 500.
          example: abc123
      required:
        - statusCode
        - timestamp
        - path
    ConstraintValidation:
      type: object
      properties:
        messages:
          type: array
          items:
            type: string
          description: List of validation error messages
          example:
            - Field is required
            - Invalid format
        value:
          description: Value that failed validation
          oneOf:
            - type: string
              nullable: true
            - type: number
            - type: boolean
            - type: object
            - type: array
              items:
                anyOf:
                  - type: string
                    nullable: true
                  - type: number
                  - type: boolean
                  - type: object
                    additionalProperties: true
          example: "xx xx xx "
      required:
        - messages
    ValidationErrorDto:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code of the error response.
          example: 404
        timestamp:
          type: string
          description: Timestamp of when the error occurred.
          example: 2024-12-12T13:00:00Z
        path:
          type: string
          description: The path where the error occurred.
          example: /api/v1/resource
        message:
          description: Value that failed validation
          oneOf:
            - type: string
              nullable: true
            - type: number
            - type: boolean
            - type: object
              nullable: true
            - type: array
              items:
                anyOf:
                  - type: string
                    nullable: true
                  - type: number
                  - type: boolean
                  - type: object
                    additionalProperties: true
          example: "xx xx xx "
        ctx:
          type: object
          description: Optional context object for additional error details.
          additionalProperties: true
          example:
            workflowId: some_wf_id
            stepId: some_wf_id
        errorId:
          type: string
          description: >-
            Optional unique identifier for the error, useful for tracking using
            Sentry and 
                  New Relic, only available for 500.
          example: abc123
        errors:
          type: object
          description: A record of validation errors keyed by field name
          additionalProperties:
            $ref: "#/components/schemas/ConstraintValidation"
          example:
            fieldName1:
              messages:
                - Field is required
                - Must be a valid email address
              value: invalidEmail
            fieldName2:
              messages:
                - Must be at least 18 years old
              value: 17
            fieldName3:
              messages:
                - Must be a boolean value
              value: true
            fieldName4:
              messages:
                - Must be a valid object
              value:
                key: value
            fieldName5:
              messages:
                - Field is missing
              value: null
            fieldName6:
              messages:
                - Undefined value
      required:
        - statusCode
        - timestamp
        - path
        - errors
    ChannelTypeEnum:
      type: string
      enum:
        - in_app
        - email
        - sms
        - chat
        - push
        - tool
    AgentIntegrationResponseIntegrationDto:
      type: object
      properties:
        _id:
          type: string
          description: Integration document _id.
        identifier:
          type: string
          description: The integration identifier (matches the integration store), not the
            internal MongoDB _id.
        name:
          type: string
        providerId:
          type: string
        channel:
          description: Delivery channel; not set for agent-runtime integrations.
          $ref: "#/components/schemas/ChannelTypeEnum"
        active:
          type: boolean
        sharedInboundAddress:
          type: string
          description: The Novu shared inbox address for this agent. Set whenever the
            cloud shared-inbox feature is enabled. The dashboard uses this as
            the headline inbound address and to render the shared inbox row in
            the inbox list.
        defaultSenderName:
          type: string
          description: Default email From display name for this agent (NovuAgent
            integrations only). Falls back to the agent name when not explicitly
            stored on the integration credentials.
        sharedInboxDisabled:
          type: boolean
          description: When true, the worker drops inbound mail addressed to this agent on
            the shared `agentconnect.sh` domain. Custom-domain routes still
            deliver. Meaningful on cloud-enabled NovuAgent integrations; on
            self-hosted it is set defensively at provisioning time and is
            effectively redundant.
      required:
        - _id
        - identifier
        - name
        - providerId
        - active
    AgentIntegrationResponseDto:
      type: object
      properties:
        _id:
          type: string
          description: Agent–integration link document id.
        _agentId:
          type: string
        integration:
          $ref: "#/components/schemas/AgentIntegrationResponseIntegrationDto"
        _environmentId:
          type: string
        _organizationId:
          type: string
        connectedAt:
          type: object
          nullable: true
          description: Set when the agent–integration link received its first inbound
            webhook delivery.
        createdAt:
          type: string
        updatedAt:
          type: string
        exceedsPlanLimit:
          type: boolean
          description: Cloud only. `true` when this channel type (provider) falls outside
            the organization plan active-channel limit (by connection order).
            Active channels are counted per channel type, so multiple
            integrations of the same provider (e.g. several Slack workspaces)
            count as a single active channel. Over-limit channels keep their
            configuration but the agent will not respond on them until the plan
            is upgraded or older channel types are disconnected.
        hasChannelEndpoints:
          type: boolean
          description: "`true` when at least one person has linked their chat on this
            integration (it has a channel endpoint), so the agent has someone to
            reach there. Only returned by the list, and only when true. Email
            has no channel endpoints, so it never carries the flag."
      required:
        - _id
        - _agentId
        - integration
        - _environmentId
        - _organizationId
        - createdAt
        - updatedAt
    UpdateAgentIntegrationRequestDto:
      type: object
      properties:
        integrationIdentifier:
          type: string
          description: The integration identifier this link should point to (not the
            internal document _id).
      required:
        - integrationIdentifier
  headers:
    Content-Type:
      required: true
      description: The MIME type of the response body.
      schema:
        type: string
      example: application/json
    RateLimit-Limit:
      required: false
      description: The number of requests that the client is permitted to make per
        second. The actual maximum may differ when burst is enabled.
      schema:
        type: string
      example: "100"
    RateLimit-Remaining:
      required: false
      description: The number of requests remaining until the next window.
      schema:
        type: string
      example: "93"
    RateLimit-Reset:
      required: false
      description: The remaining seconds until a request of the same cost will be refreshed.
      schema:
        type: string
      example: "8"
    RateLimit-Policy:
      required: false
      description: The rate limit policy that was used to evaluate the request.
      schema:
        type: string
      example: 100;w=1;burst=110;comment="token bucket";category="trigger";cost="single"
    Retry-After:
      required: false
      description: The number of seconds after which the client may retry the request
        that was previously rejected.
      schema:
        type: string
      example: "8"
    Idempotency-Key:
      required: false
      description: The idempotency key used to evaluate the request.
      schema:
        type: string
      example: "8"
    Idempotency-Replay:
      required: false
      description: Whether the request was a replay of a previous request.
      schema:
        type: string
      example: "true"
````
