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

# SetIntegrationManagedAccessAPI starts or stops providing a connection to the
organizations this


> one manages, so an agency's own vendor key is spendable by every client it operates for while the management link is live, instead of being connected by hand per client and re-fanned out on rotation. Blanket lending accepts API keys; supported OAuth providers require an explicit client/account assignment. Both need connection admin and an admin or owner of the source organization (enforced by the integration service). There is deliberately no MCP tool: widening which organizations a credential serves is not a model's decision.




## OpenAPI

````yaml /api/openapi.json post /v1/integrations/{integrationID}/managed-access
openapi: 3.0.0
info:
  title: Erdo API
  description: >-
    Erdo's REST API: query and write datasets, run agents, manage threads,
    integrations, pages, evals, workstreams, experiments, and bounded outreach.
    Authenticate with a Bearer API key (erdo_api_...) or scoped token
    (erdo_token_...).
  version: '2026-11-21'
servers:
  - url: https://api.erdo.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/integrations/{integrationID}/managed-access:
    post:
      summary: >
        SetIntegrationManagedAccessAPI starts or stops providing a connection to
        the

        organizations this
      description: >
        one manages, so an agency's own vendor key is spendable by every client
        it operates for while the management link is live, instead of being
        connected by hand per client and re-fanned out on rotation. Blanket
        lending accepts API keys; supported OAuth providers require an explicit
        client/account assignment. Both need connection admin and an admin or
        owner of the source organization (enforced by the integration service).
        There is deliberately no MCP tool: widening which organizations a
        credential serves is not a model's decision.
      operationId: POST:mcp.SetIntegrationManagedAccessAPI
      parameters:
        - allowEmptyValue: true
          explode: false
          in: path
          name: integrationID
          required: true
          schema:
            format: uuid
            type: string
          style: simple
      requestBody:
        content:
          application/json:
            schema:
              properties:
                ad_account_id:
                  type: string
                client_integration_id:
                  format: uuid
                  type: string
                managed_access:
                  type: string
                managed_organization_id:
                  format: uuid
                  type: string
                managed_organization_slug:
                  type: string
                preserve_client_grant:
                  type: boolean
                replace_current_account:
                  type: boolean
                selected_segments:
                  items:
                    $ref: '#/components/schemas/types.SegmentOption'
                  type: array
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  client_integration_id:
                    format: uuid
                    type: string
                  managed_access:
                    type: string
                  managed_organizations:
                    description: >
                      manages nobody yet. The second case is a truthful answer
                      rather than a refusal — being a manager IS holding live
                      links, so an org with none has simply not adopted a
                      client, and the fix is to link one rather than to ask for
                      a permission.
                    items:
                      $ref: >-
                        #/components/schemas/integration.ManagedOrganizationSummary
                    title: >
                      ManagedOrganizations is empty for owner_only, and also for
                      an org that
                    type: array
                  previous_account_id:
                    type: string
                  previous_campaign_count:
                    format: int64
                    type: integer
                type: object
          description: Success response
        default:
          $ref: '#/components/responses/APIError'
components:
  schemas:
    types.SegmentOption:
      properties:
        children:
          items:
            $ref: '#/components/schemas/types.SegmentOption'
          title: |
            nested segments
          type: array
          nullable: true
        id:
          type: string
        metadata:
          additionalProperties:
            type: string
          title: |
            additional provider-specific info
          type: object
          nullable: true
        name:
          type: string
        parent_id:
          title: |
            for hierarchy
          type: string
          nullable: true
        type:
          title: |
            e.g., "project", "campaign", "account"
          type: string
      title: |
        SegmentOption represents a segment option for a provider
      type: object
    integration.ManagedOrganizationSummary:
      properties:
        name:
          type: string
        slug:
          type: string
      title: >
        ManagedOrganizationSummary names one org a provided connection now
        serves.
      type: object
  responses:
    APIError:
      content:
        application/json:
          schema:
            externalDocs:
              url: https://pkg.go.dev/encore.dev/beta/errs#Error
            properties:
              code:
                description: Error code
                example: not_found
                externalDocs:
                  url: https://pkg.go.dev/encore.dev/beta/errs#ErrCode
                type: string
              details:
                description: Error details
                type: object
              message:
                description: Error message
                type: string
            title: APIError
            type: object
      description: Error response
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: An Erdo API key (erdo_api_...) or scoped token (erdo_token_...).

````

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