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

# Disable a Gate service for the authenticated organization

> Requires Authorization: Bearer sk_* with the gate:services:manage scope. This is a soft delete that sets status=disabled.



## OpenAPI

````yaml /api-reference/openapi.json delete /v1/gate/services/{serviceId}
openapi: 3.1.0
info:
  title: Foil API
  version: '2026-03-25'
  description: >-
    Customer-facing Foil server APIs for sessions, visitor fingerprints,
    organizations, and API keys.
servers:
  - url: https://api.usefoil.com
    description: Production
security: []
tags:
  - name: Sessions
    description: Durable session readback endpoints.
  - name: Visitor fingerprints
    description: Durable visitor fingerprint readback endpoints.
  - name: Organizations
    description: Organization lifecycle endpoints.
  - name: API Keys
    description: Organization API key lifecycle endpoints.
  - name: Gate
    description: >-
      Registry, organization-owned services, signup sessions, agent tokens, and
      dashboard login sessions.
  - name: Gate Webhooks
    description: Outbound Gate webhook delivery contracts.
  - name: Webhooks
    description: Manage webhook endpoints, subscriptions, and outgoing event delivery.
  - name: Events
    description: Inspect organization events and their webhook delivery attempts.
paths:
  /v1/gate/services/{serviceId}:
    delete:
      tags:
        - Gate
      summary: Disable a Gate service for the authenticated organization
      description: >-
        Requires Authorization: Bearer sk_* with the gate:services:manage scope.
        This is a soft delete that sets status=disabled.
      operationId: disableManagedGateService
      parameters:
        - name: serviceId
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/GateServiceId'
            example: gsvc_0123456789abcdefghjkmnpqrs
      responses:
        '200':
          description: Disabled Gate service.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GateManagedServiceResponse'
                example:
                  data:
                    object: gate_service
                    id: gsvc_0123456789abcdefghjkmnpqrs
                    status: active
                    discoverable: true
                    name: Acme Growth Workspace
                    description: 203.0.113.10
                    website: https://app.acme.co/signup
                    dashboard_login_url: https://app.acme.co/signup
                    env_vars:
                      - name: Acme Growth Workspace
                        key: FOIL_PUBLISHABLE_KEY
                        secret: true
                    docs_url: https://app.acme.co/signup
                    sdks:
                      - label: Chrome
                        install: npm install @foil/server-node
                        url: https://app.acme.co/signup
                    branding:
                      logo_url: https://app.acme.co/signup
                      primary_color: '#111827'
                      secondary_color: '#60a5fa'
                      ascii_art: FOIL
                      verified: true
                    consent:
                      terms_url: https://app.acme.co/signup
                      privacy_url: https://app.acme.co/signup
                    created_at: '2026-03-24T20:00:00.000Z'
                    updated_at: '2026-03-24T20:00:05.000Z'
                    webhook_endpoint_id: we_0123456789abcdef0123456789abcdef
                  meta:
                    request_id: req_cf147349a4134208aebb8c70e25fb7e1
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
                example:
                  error:
                    code: request.validation_failed
                    message: Observation payload failed validation.
                    status: 1
                    retryable: true
                    request_id: req_cf147349a4134208aebb8c70e25fb7e1
                    docs_url: https://app.acme.co/signup
                    details:
                      fields:
                        - name: Acme Growth Workspace
                          issue: required
                          expected: string
                          received: any_of
                      allowed_values:
                        - verified
                      header_name: x-forwarded-for
                      parameter_set: browser_fingerprint
                      next_action: retry
        '403':
          description: Secret key required or insufficient scope.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
                example:
                  error:
                    code: request.validation_failed
                    message: Observation payload failed validation.
                    status: 1
                    retryable: true
                    request_id: req_cf147349a4134208aebb8c70e25fb7e1
                    docs_url: https://app.acme.co/signup
                    details:
                      fields:
                        - name: Acme Growth Workspace
                          issue: required
                          expected: string
                          received: any_of
                      allowed_values:
                        - verified
                      header_name: x-forwarded-for
                      parameter_set: browser_fingerprint
                      next_action: retry
        '404':
          description: Gate service not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
                example:
                  error:
                    code: request.validation_failed
                    message: Observation payload failed validation.
                    status: 1
                    retryable: true
                    request_id: req_cf147349a4134208aebb8c70e25fb7e1
                    docs_url: https://app.acme.co/signup
                    details:
                      fields:
                        - name: Acme Growth Workspace
                          issue: required
                          expected: string
                          received: any_of
                      allowed_values:
                        - verified
                      header_name: x-forwarded-for
                      parameter_set: browser_fingerprint
                      next_action: retry
      security:
        - BearerAuth: []
components:
  schemas:
    GateServiceId:
      type: string
      example: gsvc_0123456789abcdefghjkmnpqrs
      minLength: 3
      maxLength: 32
      pattern: ^[a-z0-9](?:[a-z0-9_-]{1,30}[a-z0-9])$
      description: >-
        Canonical Gate service slug used by the public registry and by npx
        signup <service>. Lowercase letters, numbers, dashes, and underscores
        only; must start and end with a letter or number.
    GateManagedServiceResponse:
      type: object
      required:
        - data
        - meta
      properties:
        data:
          $ref: '#/components/schemas/GateManagedService'
          example:
            object: gate_service
            id: gsvc_0123456789abcdefghjkmnpqrs
            status: active
            discoverable: true
            name: Acme Growth Workspace
            description: 203.0.113.10
            website: https://app.acme.co/signup
            dashboard_login_url: https://app.acme.co/signup
            env_vars:
              - name: Acme Growth Workspace
                key: FOIL_PUBLISHABLE_KEY
                secret: true
            docs_url: https://app.acme.co/signup
            sdks:
              - label: Chrome
                install: npm install @foil/server-node
                url: https://app.acme.co/signup
            branding:
              logo_url: https://app.acme.co/signup
              primary_color: '#111827'
              secondary_color: '#60a5fa'
              ascii_art: FOIL
              verified: true
            consent:
              terms_url: https://app.acme.co/signup
              privacy_url: https://app.acme.co/signup
            created_at: '2026-03-24T20:00:00.000Z'
            updated_at: '2026-03-24T20:00:05.000Z'
            webhook_endpoint_id: we_0123456789abcdef0123456789abcdef
        meta:
          $ref: '#/components/schemas/ResponseMeta'
          example:
            request_id: req_cf147349a4134208aebb8c70e25fb7e1
      example:
        data:
          object: gate_service
          id: gsvc_0123456789abcdefghjkmnpqrs
          status: active
          discoverable: true
          name: Acme Growth Workspace
          description: 203.0.113.10
          website: https://app.acme.co/signup
          dashboard_login_url: https://app.acme.co/signup
          env_vars:
            - name: Acme Growth Workspace
              key: FOIL_PUBLISHABLE_KEY
              secret: true
          docs_url: https://app.acme.co/signup
          sdks:
            - label: Chrome
              install: npm install @foil/server-node
              url: https://app.acme.co/signup
          branding:
            logo_url: https://app.acme.co/signup
            primary_color: '#111827'
            secondary_color: '#60a5fa'
            ascii_art: FOIL
            verified: true
          consent:
            terms_url: https://app.acme.co/signup
            privacy_url: https://app.acme.co/signup
          created_at: '2026-03-24T20:00:00.000Z'
          updated_at: '2026-03-24T20:00:05.000Z'
          webhook_endpoint_id: we_0123456789abcdef0123456789abcdef
        meta:
          request_id: req_cf147349a4134208aebb8c70e25fb7e1
    ApiErrorEnvelope:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/PublicError'
          example:
            code: request.validation_failed
            message: Observation payload failed validation.
            status: 1
            retryable: true
            request_id: req_cf147349a4134208aebb8c70e25fb7e1
            docs_url: https://app.acme.co/signup
            details:
              fields:
                - name: Acme Growth Workspace
                  issue: required
                  expected: string
                  received: any_of
              allowed_values:
                - verified
              header_name: x-forwarded-for
              parameter_set: browser_fingerprint
              next_action: retry
      example:
        error:
          code: request.validation_failed
          message: Observation payload failed validation.
          status: 1
          retryable: true
          request_id: req_cf147349a4134208aebb8c70e25fb7e1
          docs_url: https://app.acme.co/signup
          details:
            fields:
              - name: Acme Growth Workspace
                issue: required
                expected: string
                received: any_of
            allowed_values:
              - verified
            header_name: x-forwarded-for
            parameter_set: browser_fingerprint
            next_action: retry
    GateManagedService:
      type: object
      required:
        - object
        - id
        - status
        - discoverable
        - name
        - description
        - website
        - webhook_endpoint_id
        - env_vars
        - docs_url
        - sdks
        - branding
        - consent
        - created_at
        - updated_at
      properties:
        object:
          type: string
          const: gate_service
          example: gate_service
        id:
          $ref: '#/components/schemas/GateServiceId'
          example: gsvc_0123456789abcdefghjkmnpqrs
        status:
          $ref: '#/components/schemas/GateServiceStatus'
          example: active
        discoverable:
          type: boolean
          example: true
        name:
          type: string
          example: Acme Growth Workspace
        description:
          type: string
          example: 203.0.113.10
        website:
          type: string
          format: uri
          example: https://app.acme.co/signup
        dashboard_login_url:
          type: string
          format: uri
          example: https://app.acme.co/signup
        env_vars:
          type: array
          items:
            $ref: '#/components/schemas/GateEnvVar'
            example:
              name: Acme Growth Workspace
              key: FOIL_PUBLISHABLE_KEY
              secret: true
          example:
            - name: Acme Growth Workspace
              key: FOIL_PUBLISHABLE_KEY
              secret: true
        docs_url:
          type: string
          format: uri
          example: https://app.acme.co/signup
        sdks:
          type: array
          items:
            $ref: '#/components/schemas/GateSdkInstall'
            example:
              label: Chrome
              install: npm install @foil/server-node
              url: https://app.acme.co/signup
          example:
            - label: Chrome
              install: npm install @foil/server-node
              url: https://app.acme.co/signup
        branding:
          $ref: '#/components/schemas/GateBranding'
          example:
            logo_url: https://app.acme.co/signup
            primary_color: '#111827'
            secondary_color: '#60a5fa'
            ascii_art: FOIL
            verified: true
        consent:
          $ref: '#/components/schemas/GateConsentConfig'
          example:
            terms_url: https://app.acme.co/signup
            privacy_url: https://app.acme.co/signup
        created_at:
          type: string
          format: date-time
          example: '2026-03-24T20:00:00.000Z'
        updated_at:
          type: string
          format: date-time
          example: '2026-03-24T20:00:05.000Z'
        webhook_endpoint_id:
          anyOf:
            - $ref: '#/components/schemas/WebhookEndpointId'
              example: we_0123456789abcdef0123456789abcdef
            - type: 'null'
              example: null
          example: we_0123456789abcdef0123456789abcdef
      example:
        object: gate_service
        id: gsvc_0123456789abcdefghjkmnpqrs
        status: active
        discoverable: true
        name: Acme Growth Workspace
        description: 203.0.113.10
        website: https://app.acme.co/signup
        dashboard_login_url: https://app.acme.co/signup
        env_vars:
          - name: Acme Growth Workspace
            key: FOIL_PUBLISHABLE_KEY
            secret: true
        docs_url: https://app.acme.co/signup
        sdks:
          - label: Chrome
            install: npm install @foil/server-node
            url: https://app.acme.co/signup
        branding:
          logo_url: https://app.acme.co/signup
          primary_color: '#111827'
          secondary_color: '#60a5fa'
          ascii_art: FOIL
          verified: true
        consent:
          terms_url: https://app.acme.co/signup
          privacy_url: https://app.acme.co/signup
        created_at: '2026-03-24T20:00:00.000Z'
        updated_at: '2026-03-24T20:00:05.000Z'
        webhook_endpoint_id: we_0123456789abcdef0123456789abcdef
    ResponseMeta:
      type: object
      additionalProperties: false
      required:
        - request_id
      properties:
        request_id:
          $ref: '#/components/schemas/RequestId'
          example: req_cf147349a4134208aebb8c70e25fb7e1
      example:
        request_id: req_cf147349a4134208aebb8c70e25fb7e1
    PublicError:
      type: object
      additionalProperties: false
      required:
        - code
        - message
        - status
        - retryable
        - request_id
      properties:
        code:
          type: string
          x-foil-known-values-ref: '#/components/schemas/KnownPublicErrorCode'
          example: request.validation_failed
        message:
          type: string
          example: Observation payload failed validation.
        status:
          type: integer
          example: 1
        retryable:
          type: boolean
          example: true
        request_id:
          $ref: '#/components/schemas/RequestId'
          example: req_cf147349a4134208aebb8c70e25fb7e1
        docs_url:
          type: string
          format: uri
          example: https://app.acme.co/signup
        details:
          $ref: '#/components/schemas/ApiErrorDetails'
          example:
            fields:
              - name: Acme Growth Workspace
                issue: required
                expected: string
                received: any_of
            allowed_values:
              - verified
            header_name: x-forwarded-for
            parameter_set: browser_fingerprint
            next_action: retry
      example:
        code: request.validation_failed
        message: Observation payload failed validation.
        status: 1
        retryable: true
        request_id: req_cf147349a4134208aebb8c70e25fb7e1
        docs_url: https://app.acme.co/signup
        details:
          fields:
            - name: Acme Growth Workspace
              issue: required
              expected: string
              received: any_of
          allowed_values:
            - verified
          header_name: x-forwarded-for
          parameter_set: browser_fingerprint
          next_action: retry
    GateServiceStatus:
      type: string
      enum:
        - active
        - disabled
      example: active
    GateEnvVar:
      type: object
      required:
        - name
        - key
        - secret
      properties:
        name:
          type: string
          example: Acme Growth Workspace
        key:
          type: string
          example: FOIL_PUBLISHABLE_KEY
        secret:
          type: boolean
          example: true
      example:
        name: Acme Growth Workspace
        key: FOIL_PUBLISHABLE_KEY
        secret: true
    GateSdkInstall:
      type: object
      required:
        - label
        - install
        - url
      properties:
        label:
          type: string
          example: Chrome
        install:
          type: string
          example: npm install @foil/server-node
        url:
          type: string
          format: uri
          example: https://app.acme.co/signup
      example:
        label: Chrome
        install: npm install @foil/server-node
        url: https://app.acme.co/signup
    GateBranding:
      type: object
      required:
        - verified
      properties:
        logo_url:
          type: string
          format: uri
          example: https://app.acme.co/signup
        primary_color:
          type: string
          pattern: ^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$
          description: 'Hex color in #RGB, #RGBA, #RRGGBB, or #RRGGBBAA format.'
          example: '#111827'
        secondary_color:
          type: string
          pattern: ^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$
          description: 'Hex color in #RGB, #RGBA, #RRGGBB, or #RRGGBBAA format.'
          example: '#60a5fa'
        ascii_art:
          type: string
          example: FOIL
        verified:
          type: boolean
          readOnly: true
          example: true
      example:
        logo_url: https://app.acme.co/signup
        primary_color: '#111827'
        secondary_color: '#60a5fa'
        ascii_art: FOIL
        verified: true
    GateConsentConfig:
      type: object
      properties:
        terms_url:
          type: string
          format: uri
          example: https://app.acme.co/signup
        privacy_url:
          type: string
          format: uri
          example: https://app.acme.co/signup
      example:
        terms_url: https://app.acme.co/signup
        privacy_url: https://app.acme.co/signup
    WebhookEndpointId:
      type: string
      pattern: ^we_[0-9a-f]{32}$
      example: we_0123456789abcdef0123456789abcdef
    RequestId:
      type: string
      pattern: ^req_[0-9a-f]{32}$
      example: req_cf147349a4134208aebb8c70e25fb7e1
    ApiErrorDetails:
      type: object
      properties:
        fields:
          type: array
          items:
            $ref: '#/components/schemas/ApiFieldIssue'
            example:
              name: Acme Growth Workspace
              issue: required
              expected: string
              received: any_of
          example:
            - name: Acme Growth Workspace
              issue: required
              expected: string
              received: any_of
        allowed_values:
          type: array
          items:
            type: string
            example: verified
          example:
            - verified
        header_name:
          type: string
          example: x-forwarded-for
        parameter_set:
          type: string
          example: browser_fingerprint
        next_action:
          type: string
          enum:
            - retry
            - new_session
            - reload_bundle
            - contact_support
          example: retry
      additionalProperties: true
      example:
        fields:
          - name: Acme Growth Workspace
            issue: required
            expected: string
            received: any_of
        allowed_values:
          - verified
        header_name: x-forwarded-for
        parameter_set: browser_fingerprint
        next_action: retry
    ApiFieldIssue:
      type: object
      additionalProperties: false
      required:
        - name
        - issue
      properties:
        name:
          type: string
          example: Acme Growth Workspace
        issue:
          type: string
          example: required
        expected:
          type: string
          example: string
        received:
          anyOf:
            - type: string
              example: '0'
            - type: number
              example: 1.5
            - type: boolean
              example: true
            - type: 'null'
              example: null
          example: any_of
      example:
        name: Acme Growth Workspace
        issue: required
        expected: string
        received: any_of
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send Authorization: Bearer <token>. Gate business endpoints require sk_*
        secret keys. Gate workflow endpoints use gate-native bearer tokens such
        as gtpoll_* or agt_* where documented.

````