# Abort build


```
POST 
https://api.apify.com/v2/actor-builds/:buildId/abort
```


Aborts an Actor build and returns an object that contains all the details about the build.

Only builds that are starting or running are aborted. For builds with status `FINISHED`, `FAILED`, `ABORTING` and `TIMED-OUT` this call does nothing.

## Request

### Path Parameters

* **buildId** string required

  ID of the build, found in the build's Info tab.

  **Example:** `soSkq9ekdmfOslopH`

<!-- -->

### Status 200

**Response Headers**




```
{
  "data": {
    "id": "HG7ML7M8z78YcAPEB",
    "actId": "janedoe~my-actor",
    "userId": "klmdEpoiojmdEMlk3",
    "startedAt": "2019-11-30T07:34:24.202Z",
    "finishedAt": "2019-12-12T09:30:12.202Z",
    "status": "SUCCEEDED",
    "meta": {
      "origin": "WEB",
      "clientIp": "172.234.12.34",
      "userAgent": "Mozilla/5.0 (iPad)"
    },
    "stats": {
      "durationMillis": 1000,
      "runTimeSecs": 45.718,
      "computeUnits": 0.012699444444444444
    },
    "options": {
      "useCache": false,
      "betaPackages": false,
      "memoryMbytes": 1024,
      "diskMbytes": 2048
    },
    "usage": {
      "ACTOR_COMPUTE_UNITS": 0.08
    },
    "usageTotalUsd": 0.02,
    "usageUsd": {
      "ACTOR_COMPUTE_UNITS": 0.02
    },
    "inputSchema": "{\\n  \"title\": \"Schema for ...\"}",
    "readme": "# Magic Actor\\nThis Actor is magic.",
    "buildNumber": "0.1.1",
    "actorDefinition": {
      "actorSpecification": 1,
      "name": "example-actor",
      "version": "1.0",
      "buildTag": "latest",
      "environmentVariables": {
        "DEBUG_MODE": "false"
      },
      "input": {
        "type": "object",
        "properties": {
          "prompt": {
            "type": "string",
            "description": "The text prompt to generate completions for."
          },
          "maxTokens": {
            "type": "integer",
            "description": "The maximum number of tokens to generate."
          }
        },
        "required": [
          "prompt"
        ]
      },
      "storages": {
        "dataset": {
          "type": "object",
          "$schema": "http://json-schema.org/draft-07/schema#",
          "properties": {
            "id": {
              "type": "string",
              "description": "Unique identifier for the generated text."
            },
            "text": {
              "type": "string",
              "description": "The generated text output from the model."
            }
          },
          "required": [
            "id",
            "text"
          ]
        }
      },
      "minMemoryMbytes": 512,
      "maxMemoryMbytes": 2048,
      "usesStandbyMode": false
    }
  }
}
```


**Schema**

* **data** object required

  * **id** string required\
    **Example:** `HG7ML7M8z78YcAPEB`

  * **actId** string required\
    **Example:** `janedoe~my-actor`

  * **userId** string required\
    **Example:** `klmdEpoiojmdEMlk3`

  * **startedAt** string\<date-time> required\
    **Example:** `2019-11-30T07:34:24.202Z`

  * **finishedAt** string,null\<date-time> nullable\
    **Example:** `2019-12-12T09:30:12.202Z`

  * **status** ActorJobStatus (string) required

    Status of an Actor job (run or build).

    **Possible values:** \[`READY`, `RUNNING`, `SUCCEEDED`, `FAILED`, `TIMING-OUT`, `TIMED-OUT`, `ABORTING`, `ABORTED`]

  * **meta** object required

    * **origin** RunOrigin (string) required

      **Possible values:** \[`DEVELOPMENT`, `WEB`, `API`, `SCHEDULER`, `TEST`, `WEBHOOK`, `ACTOR`, `CLI`, `STANDBY`]

    * **clientIp** string

      IP address of the client that started the build.

      **Example:** `172.234.12.34`

    * **userAgent** string

      User agent of the client that started the build.

      **Example:** `Mozilla/5.0 (iPad)`

  * **stats** object

    * anyOf
      * BuildStats
      * null
      **durationMillis** integer\
      **Example:** `1000`
    * **runTimeSecs** number\
      **Example:** `45.718`
    * **computeUnits** number required\
      **Example:** `0.0126994444444444`

  * **options** object

    * anyOf
      * BuildOptions
      * null
      **useCache** boolean | null nullable\
      **Example:** `false`
    * **betaPackages** boolean | null nullable\
      **Example:** `false`
    * **memoryMbytes** integer | null nullable\
      **Example:** `1024`
    * **diskMbytes** integer | null nullable\
      **Example:** `2048`

  * **usage** object

    * anyOf
      * BuildUsage
      * null
      **ACTOR\_COMPUTE\_UNITS** number | null nullable\
      **Example:** `0.08`

  * **usageTotalUsd** number | null nullable\
    **Example:** `0.02`

  * **usageUsd** object

    * anyOf
      * BuildUsage
      * null
      **ACTOR\_COMPUTE\_UNITS** number | null nullable\
      **Example:** `0.08`

  * **inputSchema** string | null nullable deprecated\
    **Example:** `{\n "title": "Schema for ... }`

  * **readme** string | null nullable deprecated\
    **Example:** `# Magic Actor\nThis Actor is magic.`

  * **buildNumber** string required\
    **Example:** `0.1.1`

  * **actorDefinition** object

    * anyOf

      * ActorDefinition
      * null

      **actorSpecification** integer

      The Actor specification version that this Actor follows. This property must be set to 1.

      **Constant value:** `1`

    * **name** string

      The name of the Actor.

    * **version** string

      The version of the Actor, specified in the format \[Number].\[Number], e.g., 0.1, 1.0.

      **Possible values:** Value must match regular expression `^[0-9]+\.[0-9]+$`

    * **buildTag** string

      The tag name to be applied to a successful build of the Actor. Defaults to 'latest' if not specified.

    * **environmentVariables** object

      A map of environment variables to be used during local development and deployment.

      * **property name\*** string

    * **dockerfile** string

      The path to the Dockerfile used for building the Actor on the platform.

    * **dockerContextDir** string

      The path to the directory used as the Docker context when building the Actor.

    * **readme** string

      The path to the README file for the Actor.

    * **input** object

      The input schema object, the full specification can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/input-schema)

    * **changelog** string

      The path to the CHANGELOG file displayed in the Actor's information tab.

    * **storages** object

      * **dataset** object

        Defines the schema of items in your dataset, the full specification can be found in [Apify docs](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema)

    * **defaultMemoryMbytes** object

      Specifies the default amount of memory in megabytes to be used when the Actor is started. Can be an integer or a [dynamic memory expression](https://pr-2390.preview.docs.apify.com/platform/actors/development/actor-definition/dynamic-actor-memory.md).

      * oneOf

        * string
        * integer

        string

        **Examples:**

        * Example 1
        * Example 2
        * Example 3

        **Example:** `get(input`

        **Example:** `startUrls.length`

        **Example:** `1) * 1024`

    * **minMemoryMbytes** integer

      Specifies the minimum amount of memory in megabytes required by the Actor.

      **Possible values:** `>= 256`

    * **maxMemoryMbytes** integer

      Specifies the maximum amount of memory in megabytes required by the Actor.

      **Possible values:** `>= 256`

    * **usesStandbyMode** boolean

      Specifies whether Standby mode is enabled for the Actor.

### Status 400

Bad request - invalid input parameters or request body.


```
{
  "error": {
    "type": "invalid-input",
    "message": "Invalid input: The request body contains invalid data."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 401

Unauthorized - authentication required or invalid token.


```
{
  "error": {
    "type": "token-not-valid",
    "message": "Authentication token is not valid."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 403

Forbidden - insufficient permissions to perform this action.


```
{
  "error": {
    "type": "permission-denied",
    "message": "You do not have permission to perform this action."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 404

Not found - the requested resource was not found.


```
{
  "error": {
    "type": "record-not-found",
    "message": "Actor build was not found"
  }
}
```


**Schema**

* **error** object

  * **type** string

    **Possible values:** \[`record-not-found`]

  * **message** string\
    **Example:** `Actor build was not found`

### Status 405

Method not allowed.


```
{
  "error": {
    "type": "method-not-allowed",
    "message": "This API end-point can only be accessed using the following HTTP methods: OPTIONS,GET"
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`

### Status 429

Too many requests - rate limit exceeded.


```
{
  "error": {
    "type": "rate-limit-exceeded",
    "message": "You have exceeded the rate limit. Please try again later."
  }
}
```


**Schema**

* **error** object required

  * **type** string required\
    **Example:** `run-failed`
  * **message** string required\
    **Example:** `Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)`
