# Overview

> **Part of**: [Admin API reference](admin_api.md)


By default, the API endpoints use the following format:

`https://api.cloudinary.com/v1_1/:cloud_name/:action`

For example, to list all video assets in the `cld-docs` product environment:

```
GET https://api.cloudinary.com/v1_1/cld-docs/resources/video
```

The API uses **Basic Authentication** over secure HTTP. Your Cloudinary **API Key** and **API Secret** (which can be found on the [API Keys](https://console.cloudinary.com/app/settings/api-keys) page of your Cloudinary Console Settings) are used for the authentication.

> **INFO**: If you receive HTML responses instead of JSON, this typically indicates an authentication issue. For detailed troubleshooting, see [Admin API authentication troubleshooting](ts_admin_api_authentication_issues).

You can experiment with returning a list of the images in your own Cloudinary product environment by replacing the `API_KEY`, `API_SECRET`, and `CLOUD_NAME` in the cURL command below:

```
curl https://<API_KEY>:<API_SECRET>@api.cloudinary.com/v1_1/<CLOUD_NAME>/resources/image
```
> **INFO**: Cloudinary may add more fields to API responses and notifications in the future, so please ensure that your response parsing remains forward compatible and won't break as a result of unknown fields.

### Using Postman for Admin REST API calls
Take advantage of our [Cloudinary Postman Collections](https://www.postman.com/cloudinaryteam/workspace/programmable-media/overview?ctx=documentation) to experiment with our REST APIs and view the responses before adding them to your own code. 

[Run in Postman](https://www.postman.com/cloudinaryteam/workspace/programmable-media/overview?ctx=documentation)

For details on setting up your own fork of our collections and configuring your Postman environment with your Cloudinary product environment credentials, see [Using Cloudinary Postman collections](using_cloudinary_postman_collections).
### Using SDKs with the Admin API

Our [backend SDK libraries](cloudinary_sdks) provide a wrapper for the Admin API, enabling you to use your native programming language of choice. When using an SDK, request building and authentication are handled automatically, and the JSON response is parsed and returned. 

For example, you can use the following SDK command to return a listing of all image (the default `resource_type`) assets:

```multi
|curl
curl https://<API_KEY>:<API_SECRET>@api.cloudinary.com/v1_1/<cloud_name>/resources

|ruby
result = Cloudinary::Api
.resources

|php_2
$result = $api
->assets();

|python
result = cloudinary.api\
.resources()

|nodejs
cloudinary.v2.api
.resources()
.then(result=>console.log(result)); 

|java
result = api.resources(ObjectUtils.emptyMap());

|csharp
result = cloudinary.ListResources();

|go
resp, err := cld.Admin.Assets(ctx, admin.AssetsParams{})

|cli
cld admin resources

```
### Using the CLI to access the Admin API

You can use the Cloudinary CLI (Command Line Interface) to interact with the Admin API.  This can provide an easy way to add automation to your workflows and manage your assets without the need for a formal coding environment or having to access your Cloudinary Console. 

You can find instructions for setting up and using the CLI in the [CLI reference](cloudinary_cli).
### Error handling

The Admin API returns the status of requests using HTTP status codes:

**200**: OK | Success. 
**400**: Bad request. 
**401**: Authorization required. 
**403**: Not allowed. 
**404**: Not found. 
**409**: Already exists. 
**420**: Rate limited. 

The SDKs report errors by raising applicative exceptions.
Additionally, an informative JSON message is returned. For example:

```json
{ "error": { "message": "Resource not found - 5traNge_nam3" } }
```

### Usage limits

You can use the Admin API quite extensively, but it's a rate limited API. The free plan includes 500 hourly requests, while the hourly rate-limit for those on paid plans begins at 2000. The specific limits depend on your [plan](https://cloudinary.com/pricing). 

You can check your current plan and limits in [Console Settings](programmable_media_asset_usage_data#usage_limits_and_notifications) or programmatically via the [usage](admin_api_usage.md#usage) method.

If you require more flexible limits, don't hesitate to contact us.

> **NOTE**: This API rate limit refers only to Admin API requests, and not to requests that use the [Upload API](image_upload_api_reference), which isn't rate-limited. In some cases, you may be able to use certain methods of the Upload API to achieve some administration goals. For example, you can modify or remove tags for one or multiple resources using the [tags](image_upload_api_reference#tags) method. You can modify many attributes of an individual resource using the [explicit](image_upload_api_reference#explicit) method, and you can return most details about a single (original) resource in response to any [upload](image_upload_api_reference#upload) or [explicit](image_upload_api_reference#explicit) method call.

#### How requests are counted
Each separate request to the Admin API counts as one request. There is one exception when you request details of backed up versions with `versions=true`. This consumes one request for the call plus an additional request for each version in the version history (for example, if there are ten versions, the call would consume eleven requests).

#### Monitoring usage
For each Admin API call, standard HTTP headers are returned with details on your current usage statistics, including your per-hour limit, remaining number of actions and the time the hourly count will be reset.

The header might look something like this:

```
X-FeatureRateLimit-Limit: 500
X-FeatureRateLimit-Remaining: 499
X-FeatureRateLimit-Reset: Wed, 03 Oct 2012 08:00:00 GMT
```

You can use the SDKs to retrieve this data as follows:

```multi
|ruby
result = Cloudinary::Api.resources
result.rate_limit_allowed
=> 500
$ result.rate_limit_remaining
=> 499
$ result.rate_limit_reset_at
=> 2019-10-03 10:00:00 +0200


|php_2
$result = $api->assets();
var_dump($result->rateLimitAllowed);
php > int(500)
var_dump($result->rateLimitRemaining);
php > int(499)
var_dump($result->rateLimitResetAt);
php > int(1570089600)

|python
result = cloudinary.api.resources()
result.rate_limit_allowed
>>>500
result.rate_limit_remaining
>>>499
result.rate_limit_reset_at
>>>(2019, 10, 3, 08, 0, 0, 0, 1, -1)

|nodejs
cloudinary.v2.api
.resources()
.then(result=>console.log(result.rate_limit_allowed,
              result.rate_limit_remaining,
              result.rate_limit_reset_at));

> 500 499 Sun, 03 Oct 2019 08:00:00 GMT

|java
ApiResponse result = api.resources(ObjectUtils.emptyMap());
System.out.println(result.apiRateLimit().getLimit());
=> 500
System.out.println(result.apiRateLimit().getRemaining());
=> 499
System.out.println(result.apiRateLimit().getReset());
=> 2019-10-03 10:00:00 +0200

|csharp
var result = cloudinary.ListResources();
result.Limit
// returns 500
result.Remaining
// returns 499
result.Reset
//returns  2019-10-03 10:00:00 +0200

|go
Not supported by this SDK

```

> **TIP**: You can also retrieve rate limits details as well as transformation, bandwidth, and storage limits, and a variety of additional product environment usage data with the [GET /usage](admin_api_usage.md#usage) method.

### Pagination

The GET methods of the API return a limited set of results, ordered by the creation time of the relevant entities. You can control the number of results returned in a single request by specifying the `max_results` parameter. The default is 10 for most methods. There is also a maximum number of results you can request for a single API call (either 100 or 500 as documented for each of the relevant methods). DELETE methods also operate in chunks. 

When a GET request has more results to return than `max_results` or when a DELETE request has more than 1000 entities to delete, the `next_cursor` value is returned as part of the response. You can then specify this cursor value as the `next_cursor` parameter of the following GET or DELETE request. For example, this enables you to iterate through the full list of uploaded resources, transformations, or tags in your product environment or to delete an entire set of entities that matches your deletion request.



### EU or AP data centers and endpoints	(premium feature)

> **NOTE**: This is a premium feature that is supported only for our [Enterprise plans](https://cloudinary.com/pricing#pricing-enterprise) and must be arranged when the account is created. [Contact our Enterprise support and sales team](https://cloudinary.com/contact?plan=enterprise) or your CSM for more information.

By default, Cloudinary accounts use US-based data centers. In these cases, the endpoint format is as shown at the beginning of this [Overview](#overview).

If the majority of your users are located in Europe or Asia, Cloudinary can set up your account to use our Europe (EU) or Asia Pacific (AP) data center. In that case, your endpoints will take the form: 

`https://api-eu.cloudinary.com/v1_1/:cloud_name/:action`

OR

`https://api-ap.cloudinary.com/v1_1/:cloud_name/:action`

> **TIP**: When using the Cloudinary SDKs you need to set the `upload_prefix` [configuration parameter](cloudinary_sdks#configuration_parameters).
