# ForbiddenError<!-- -->

Raised when the Apify API returns an HTTP 403 Forbidden response.

### Hierarchy

* [ApifyApiError](https://docs.apify.com/api/client/python/reference/class/ApifyApiError)
  * *ForbiddenError*

## Index[](#Index)

### Methods

* [\_\_init\_\_](https://docs.apify.com/sdk/python/reference/class/ForbiddenError.md#__init__)
* [\_\_new\_\_](https://docs.apify.com/sdk/python/reference/class/ForbiddenError.md#__new__)

## Methods<!-- -->[](#Methods)

### [](#__init__)[](https://github.com/apify/apify-sdk-python/blob/c674a4d42ade9c1a07f33062b6702497cd34b19d//src/apify_client/errors.py#L57)\_\_init\_\_

* **\_\_init\_\_**(response, attempt, \*, method, url): None

- Inherited from [ApifyApiError.\_\_init\_\_](https://docs.apify.com/api/client/python/reference/class/ApifyApiError#__init__)

  Initialize the API error from a failed response.

  ***

  #### Parameters

  * ##### response: [HttpResponse](https://docs.apify.com/api/client/python/reference/class/HttpResponse)

    The failed HTTP response from the Apify API.

  * ##### attempt: int

    The attempt number when the request failed (1-indexed).

  * ##### optionalkeyword-onlymethod: str = <!-- -->'GET'

    The HTTP method of the failed request.

  * ##### optionalkeyword-onlyurl: str | None = <!-- -->None

    The failed request URL, if available.

  #### Returns None

### [](#__new__)[](https://github.com/apify/apify-sdk-python/blob/c674a4d42ade9c1a07f33062b6702497cd34b19d//src/apify_client/errors.py#L44)\_\_new\_\_

* **\_\_new\_\_**(response, attempt, \*, method, url): Self

- Inherited from [ApifyApiError.\_\_new\_\_](https://docs.apify.com/api/client/python/reference/class/ApifyApiError#__new__)

  Dispatch to the subclass matching the response's HTTP status code, if any.

  ***

  #### Parameters

  * ##### response: [HttpResponse](https://docs.apify.com/api/client/python/reference/class/HttpResponse)
  * ##### attempt: int
  * ##### optionalkeyword-onlymethod: str = <!-- -->'GET'
  * ##### optionalkeyword-onlyurl: str | None = <!-- -->None

  #### Returns Self
