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

# Start a run

> Initiates a new run of the specified agent with the provided configuration parameters.

Sample request:
```json
{
    "inputParameters": {
        "param1": "value1",
        "param2": "value2"
    },
    "parallelism": 1,
    "parallelMaxConcurrency": 2,
    "parallelExport": true,
    "proxyPoolId": 123,
    "isExclusive": false,
    "isWaitOnFailure": true,
    "logLevel": "Info",
    "logMode": "Normal"
}
```

**Encrypted input parameters**

Prefix a parameter name with `?` to have its value encrypted at rest and hidden in
the Run log — for example `"?apiKey"` instead of `"apiKey"`. The name you send decides
this. Sending a name without the `?` prefix stores and logs the value in clear text,
**even when the Agent defines that parameter as encrypted**. Omitting a parameter
entirely leaves the Agent's own definition in effect, encryption included.

If you send both `"name"` and `"?name"`, the `?`-prefixed entry is used and the plain
one is discarded. The request still succeeds.

Call `GET /api/v1/agent/{agentId}/input-parameters` to see which parameters an Agent
defines as encrypted.



## OpenAPI

````yaml POST /api/v1/agent/{agentId}/start
openapi: 3.0.1
info:
  title: Sequentum Cloud API
  description: API endpoints for Sequentum Cloud
  version: v1
servers: []
security:
  - ApiKey: []
    Bearer: []
paths:
  /api/v1/agent/{agentId}/start:
    post:
      tags:
        - ApiAgent
      summary: Start a new agent run
      description: >-
        Initiates a new run of the specified agent with the provided
        configuration parameters.


        Sample request:

        ```json

        {
            "inputParameters": {
                "param1": "value1",
                "param2": "value2"
            },
            "parallelism": 1,
            "parallelMaxConcurrency": 2,
            "parallelExport": true,
            "proxyPoolId": 123,
            "isExclusive": false,
            "isWaitOnFailure": true,
            "logLevel": "Info",
            "logMode": "Normal"
        }

        ```


        **Encrypted input parameters**


        Prefix a parameter name with `?` to have its value encrypted at rest and
        hidden in

        the Run log — for example `"?apiKey"` instead of `"apiKey"`. The name
        you send decides

        this. Sending a name without the `?` prefix stores and logs the value in
        clear text,

        **even when the Agent defines that parameter as encrypted**. Omitting a
        parameter

        entirely leaves the Agent's own definition in effect, encryption
        included.


        If you send both `"name"` and `"?name"`, the `?`-prefixed entry is used
        and the plain

        one is discarded. The request still succeeds.


        Call `GET /api/v1/agent/{agentId}/input-parameters` to see which
        parameters an Agent

        defines as encrypted.
      parameters:
        - name: agentId
          in: path
          description: The ID of the agent to run
          required: true
          schema:
            type: integer
            format: int32
      requestBody:
        description: The configuration parameters for the run
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StartAgentApiRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/StartAgentApiRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/StartAgentApiRequest'
      responses:
        '200':
          description: Returns the ID of the newly created run
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentRunApiModel'
        '400':
          description: If the request is invalid or there was an error starting the agent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '401':
          description: >-
            If the API key is missing or invalid, or the user doesn't have
            permission to run the agent
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: If the agent is not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    StartAgentApiRequest:
      type: object
      properties:
        parallelism:
          type: integer
          format: int32
        parallelMaxConcurrency:
          type: integer
          format: int32
        parallelExport:
          $ref: '#/components/schemas/ParallelExport'
        proxyPoolId:
          type: integer
          format: int32
          nullable: true
        inputParameters:
          type: string
          nullable: true
        timeout:
          type: integer
          format: int32
        isExclusive:
          type: boolean
        isWaitOnFailure:
          type: boolean
        isRunSynchronously:
          type: boolean
        logLevel:
          $ref: '#/components/schemas/LogLevel'
        logMode:
          $ref: '#/components/schemas/LogMode'
      additionalProperties: false
    AgentRunApiModel:
      type: object
      properties:
        id:
          type: integer
          format: int64
        configId:
          type: integer
          format: int64
        configName:
          type: string
          nullable: true
        spaceId:
          type: integer
          format: int32
        organizationId:
          type: integer
          format: int32
        organizationName:
          type: string
          nullable: true
        sequence:
          type: integer
          format: int64
        parallelism:
          type: integer
          format: int32
          nullable: true
        parallelMaxConcurrency:
          type: integer
          format: int32
          nullable: true
        parallelExport:
          $ref: '#/components/schemas/ParallelExport'
        parallelSet:
          type: integer
          format: int32
          nullable: true
        startTime:
          type: string
          format: date-time
          nullable: true
        endTime:
          type: string
          format: date-time
          nullable: true
        created:
          type: string
          format: date-time
          nullable: true
        status:
          $ref: '#/components/schemas/RunStatus'
        message:
          type: string
          nullable: true
        configVersion:
          type: integer
          format: int32
          nullable: true
        actionCount:
          type: integer
          format: int32
        pageCount:
          type: integer
          format: int32
        dynamicPageCount:
          type: integer
          format: int32
        requestCount:
          type: integer
          format: int32
        dataCount:
          type: integer
          format: int32
        inputCount:
          type: integer
          format: int32
          nullable: true
        errorCount:
          type: integer
          format: int32
        exportCount:
          type: integer
          format: int32
          nullable: true
        traffic:
          type: integer
          format: int64
          nullable: true
        runTimeSec:
          type: integer
          format: int32
          nullable: true
        serverName:
          type: string
          nullable: true
        tableType:
          type: string
          nullable: true
      additionalProperties: false
    BadRequestError:
      type: object
      properties:
        statusCode:
          type: integer
          format: int32
        statusDescription:
          type: string
          nullable: true
        message:
          type: string
          nullable: true
          readOnly: true
        severity:
          $ref: '#/components/schemas/ErrorSeverity'
        errorCode:
          type: string
          description: "Optional machine-readable error code. When present, clients should switch on this\r\nvalue rather than parsing Sequentum.Enterprise.Core.ControllerError.Message. Omitted from the response when null."
          nullable: true
      additionalProperties: false
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    ParallelExport:
      enum:
        - Combined
        - Separated
      type: string
      description: '`0` = `Combined`; `1` = `Separated`'
    LogLevel:
      enum:
        - Fatal
        - Error
        - Warning
        - Info
      type: string
      description: '`0` = `Fatal`; `1` = `Error`; `2` = `Warning`; `3` = `Info`'
    LogMode:
      enum:
        - Text
        - TextAndHtml
      type: string
      description: '`0` = `Text`; `1` = `TextAndHtml`'
    RunStatus:
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
        - 9
        - 10
        - 11
        - 12
      type: integer
      description: >-
        `0` = `Invalid`; `1` = `Running`; `2` = `Exporting`; `3` = `Starting`;
        `4` = `Queuing`; `5` = `Stopping`; `6` = `Failure`; `7` = `Failed`; `8`
        = `Stopped`; `9` = `Completed`; `10` = `Success`; `11` = `Skipped`; `12`
        = `Waiting`
      format: int32
    ErrorSeverity:
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
      type: integer
      description: >-
        `0` = `Error`; `1` = `Unexpected`; `2` = `Fatal`; `3` = `Warning`; `4` =
        `Info`
      format: int32
  securitySchemes:
    ApiKey:
      type: apiKey
      description: >-
        API Key authorization header. Example: "Authorization: ApiKey
        {your-api-key}"
      name: Authorization
      in: header
    Bearer:
      type: http
      description: 'OAuth 2.0 Bearer token. Example: "Authorization: Bearer {access-token}"'
      scheme: bearer
      bearerFormat: JWT

````