class AdminApi

Enables Cloudinary Admin API functionality.

Learn more: Admin API Reference

Properties

ApiClient $apiClient Defined in AdminApi class. from MiscTrait
ApiClient $apiV2Client Defined in AdminApi class. from AnalysisTrait

Methods

rootFolders(array $options = [])

Lists all root folders.

subFolders(string $ofFolderPath, array $options = [])

Lists sub-folders.

createFolder(string $path)

Creates a new empty folder.

renameFolder(string $fromPath, string $toPath)

Renames folder.

deleteFolder(string $path)

Deletes an empty folder.

uploadPresets(array $options = [])

Lists existing upload presets.

uploadPreset(string $name, array $options = [])

Retrieves the details of the specified upload preset.

deleteUploadPreset(string $name)

Deletes the specified upload preset.

updateUploadPreset(string $name, array $options = [])

Updates the specified upload preset.

createUploadPreset(array $options = [])

Creates a new upload preset.

uploadMappings(array $options = [])

Lists upload mappings by folder and its mapped template (URL).

uploadMapping(string $name)

Returns the details of the specified upload mapping.

deleteUploadMapping(string $name)

Deletes an upload mapping.

updateUploadMapping(string $name, array $options = [])

Updates an existing upload mapping with a new template (URL).

createUploadMapping(string $name, array $options = [])

Creates a new upload mapping.

ping()

Tests the reachability of the Cloudinary API.

pingAsync()

Tests the reachability of the Cloudinary API asynchronously.

config(array $options = [])

Gets account config details.

usage(array $options = [])

Gets cloud usage details.

tags(array $options = [])

Lists all the tags currently used for a specified asset type.

analyze(string $inputType, string $analysisType, string|null $uri = null, array|null $parameters = null)

Analyzes an asset with the requested analysis type.

analyzeAsync(string $inputType, string $analysisType, string|null $uri = null, array|null $parameters = null)

Analyzes an asset with the requested analysis type asynchronously.

__construct(mixed $configuration = null)

AdminApi constructor.

Details

ApiResponse rootFolders(array $options = [])

Lists all root folders.

Parameters

Name Type Description
$options array The optional parameters. See the Admin API documentation.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#get_root_folders

ApiResponse subFolders(string $ofFolderPath, array $options = [])

Lists sub-folders.

Returns the name and path of all the sub-folders of a specified parent folder. Limited to 2000 results.

Parameters

Name Type Description
$ofFolderPath string The parent folder
$options array The optional parameters. See the Admin API documentation.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#get_subfolders

ApiResponse createFolder(string $path)

Creates a new empty folder.

Parameters

Name Type Description
$path string The full path of the new folder to create.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#create_folder

ApiResponse renameFolder(string $fromPath, string $toPath)

Renames folder.

Parameters

Name Type Description
$fromPath string The full path of an existing asset folder.
$toPath string The full path of the new asset folder.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#rename_folder

ApiResponse deleteFolder(string $path)

Deletes an empty folder.

The specified folder cannot contain any assets, but can have empty descendant sub-folders.

Parameters

Name Type Description
$path string The full path of the empty folder to delete.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#delete_folder

ApiResponse uploadPresets(array $options = [])

Lists existing upload presets.

Parameters

Name Type Description
$options array The optional parameters. See the Admin API documentation.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#get_upload_presets

ApiResponse uploadPreset(string $name, array $options = [])

Retrieves the details of the specified upload preset.

Parameters

Name Type Description
$name string The name of the upload preset.
$options array The optional parameters. See the Admin API documentation.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#get_the_details_of_a_single_upload_preset

ApiResponse deleteUploadPreset(string $name)

Deletes the specified upload preset.

Parameters

Name Type Description
$name string The name of the upload preset to delete.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#delete_an_upload_preset

ApiResponse updateUploadPreset(string $name, array $options = [])

Updates the specified upload preset.

Parameters

Name Type Description
$name string The name of the upload preset.
$options array The optional parameters. See the Admin API documentation.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#update_an_upload_preset

ApiResponse createUploadPreset(array $options = [])

Creates a new upload preset.

Parameters

Name Type Description
$options array The optional parameters. See the Admin API documentation.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#create_an_upload_preset

ApiResponse uploadMappings(array $options = [])

Lists upload mappings by folder and its mapped template (URL).

Parameters

Name Type Description
$options array The optional parameters. See the Admin API documentation.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#get_upload_mappings

ApiResponse uploadMapping(string $name)

Returns the details of the specified upload mapping.

Retrieve the mapped template (URL) of a specified upload mapping folder.

Parameters

Name Type Description
$name string The name of the upload mapping folder.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#get_the_details_of_a_single_upload_mapping

ApiResponse deleteUploadMapping(string $name)

Deletes an upload mapping.

Parameters

Name Type Description
$name string The name of the upload mapping folder to delete.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#delete_an_upload_mapping

ApiResponse updateUploadMapping(string $name, array $options = [])

Updates an existing upload mapping with a new template (URL).

Parameters

Name Type Description
$name string The name of the upload mapping folder to remap.
$options array The optional parameters. See the Admin API documentation.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#update_an_upload_mapping

ApiResponse createUploadMapping(string $name, array $options = [])

Creates a new upload mapping.

Parameters

Name Type Description
$name string The name of the folder to map.
$options array The optional parameters. See the Admin API documentation.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#create_an_upload_mapping

ApiResponse ping()

Tests the reachability of the Cloudinary API.

Return Value

ApiResponse

See also

AdminApi::pingAsync()
https://cloudinary.com/documentation/admin_api#ping

PromiseInterface pingAsync()

Tests the reachability of the Cloudinary API asynchronously.

Return Value

PromiseInterface

See also

https://cloudinary.com/documentation/admin_api#ping

ApiResponse config(array $options = [])

Gets account config details.

Fetches the account's configuration details with optional settings.

Parameters

Name Type Description
$options array The optional parameters for the API request.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#config

ApiResponse usage(array $options = [])

Gets cloud usage details.

Returns a report detailing your current Cloudinary cloud usage details, including storage, bandwidth, requests, number of assets, and add-on usage. Note that numbers are updated periodically.

Parameters

Name Type Description
$options array The optional parameters. See the Admin API documentation.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#usage

ApiResponse tags(array $options = [])

Lists all the tags currently used for a specified asset type.

Parameters

Name Type Description
$options array The optional parameters. See the Admin API documentation.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#get_tags

ApiResponse analyze(string $inputType, string $analysisType, string|null $uri = null, array|null $parameters = null)

Analyzes an asset with the requested analysis type.

Parameters

Name Type Description
$inputType string The type of input for the asset to analyze ('uri').
$analysisType string The type of analysis to run ('google_tagging', 'captioning', 'fashion').
$uri string|null The URI of the asset to analyze.
$parameters array|null Additional parameters.

Return Value

ApiResponse

See also

AdminApi::analyzeAsync()
https://cloudinary.com/documentation/media_analyzer_api_reference

PromiseInterface analyzeAsync(string $inputType, string $analysisType, string|null $uri = null, array|null $parameters = null)

Analyzes an asset with the requested analysis type asynchronously.

Parameters

Name Type Description
$inputType string The type of input for the asset to analyze ('uri').
$analysisType string The type of analysis to run ('google_tagging', 'captioning', 'fashion').
$uri string|null The URI of the asset to analyze.
$parameters array|null Additional parameters.

Return Value

PromiseInterface

See also

https://cloudinary.com/documentation/media_analyzer_api_reference

__construct(mixed $configuration = null)

AdminApi constructor.

Parameters

Name Type Description
$configuration mixed