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

# Agent Stop



## OpenAPI

````yaml https://api.notte.cc/openapi.json delete /agents/{agent_id}/stop
openapi: 3.1.0
info:
  title: Notte API
  description: >-
    Notte API is a REST API that allows you to interact with Notte. It is used
    to create cloud browser sessions, scrape webpages, and run web ai agents to
    act on your behalf on the internet.
  version: 1.4.40
  x-logo:
    url: https://www.notte.cc/images/logo/logo-white.png
servers: []
security: []
tags:
  - name: agents
    description: Web AI agents (start, stop, status, replay, etc.)
  - name: sessions
    description: Session management (start, stop, status, etc.)
  - name: debug
    description: Session debugging tools (replay,logs, recording, etc.)
  - name: page
    description: Page operations withing a session (observe, step, scrape, etc.)
  - name: storage
    description: File storage interface (upload, download, list, etc.)
  - name: network
    description: Network requests/responses withing a session (intercept, etc.)
  - name: vaults
    description: >-
      Vault & Credentials management (create/delete vaults, create/delete
      credentials, etc.)
  - name: personas
    description: Persona management (create, delete, list emails, list sms, etc.)
  - name: scrape
    description: >-
      Webpage scraping (scrape, screenshot, etc.) with automatic session
      management.
  - name: health
    description: Health check endpoint.
  - name: usage
    description: Usage logs (usage, logs, etc.)
  - name: functions
    description: Functions management (create, delete, list, etc.)
paths:
  /agents/{agent_id}/stop:
    delete:
      tags:
        - agents
      summary: Agent Stop
      operationId: agent_stop
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: session_id
          in: query
          required: true
          schema:
            type: string
            minLength: 1
            title: Session Id
        - name: x-notte-request-origin
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Notte-Request-Origin
        - name: x-notte-sdk-version
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Notte-Sdk-Version
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentStatusResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
      x-codeSamples:
        - lang: Python
          source: |-
            from notte_sdk import NotteClient

            notte = NotteClient()

            with notte.Session() as session:
                agent = notte.Agent(session=session)
                _ = agent.start(
                    task="find a cute dog on google images"
                )

                # stops without waiting for the agent to finish
                _ = agent.stop()
          label: python
        - lang: JavaScript
          source: |-
            import { NotteClient } from "notte-sdk";

            const notte = new NotteClient();

            await notte.Session().use(async (session) => {
              const agent = notte.Agent({ session });
              await agent.start({
                task: "find a cute dog on google images",
              });

              // stops without waiting for the agent to finish
              await agent.stop();
            });
          label: node
        - lang: Curl
          source: >-
            curl -X DELETE
            "https://api.notte.cc/agents/$agent_id/stop?session_id=${session_id}"
            \

            -H "Authorization: Bearer $NOTTE_API_KEY" \

            -H "Content-Type: application/json"
          label: curl
components:
  schemas:
    AgentStatusResponse:
      properties:
        agent_id:
          type: string
          title: Agent Id
          description: The ID of the agent
        created_at:
          type: string
          format: date-time
          title: Created At
          description: The creation time of the agent
        session_id:
          type: string
          title: Session Id
          description: The ID of the session
        status:
          $ref: '#/components/schemas/AgentStatus'
          description: The status of the agent (active or closed)
        closed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Closed At
          description: The closing time of the agent
        saved:
          type: boolean
          title: Saved
          description: Whether the agent is saved as a workflow
          default: false
        task:
          type: string
          title: Task
          description: The task that the agent is currently running
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
          description: The URL that the agent started on
        success:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Success
          description: >-
            Whether the agent task was successful. None if the agent is still
            running
        answer:
          anyOf:
            - type: string
            - type: 'null'
          title: Answer
          description: The answer to the agent task. None if the agent is still running
        steps:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Steps
          description: The steps that the agent has currently taken
      type: object
      required:
        - agent_id
        - created_at
        - session_id
        - status
        - task
      title: AgentStatusResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AgentStatus:
      type: string
      enum:
        - active
        - closed
      title: AgentStatus
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: token

````