openapi: 3.0.0
info:
title: REST API Reference
version: '0.7'
description: |
REST API provides low-level access to Uploadcare features. You can access files and their metadata, application data, file groups, add-ons, projects, webhooks, document conversion and video encoding.
The REST API root is `https://api.uploadcare.com/`. Send data via query strings and POST request bodies, and receive JSON responses. All URLs MUST end with a forward slash `/`.
Check out our [API clients](https://uploadcare.com/docs/integrations/) that cover most of the popular programming languages and frameworks.
# Authentication
contact:
name: API support
email: help@uploadcare.com
x-logo:
url: https://ucarecdn.com/06bc72fb-3a5a-4ee7-a19c-b1d02fb9e711/logorestapi.svg
backgroundColor: '#fafafa'
altText: Uploadcare REST API Reference
x-meta:
title: REST API 0.7 Reference — Uploadcare
description: Complete reference documentation for the Uploadcare REST API 0.7. Covers endpoints, requests, their params, and response examples.
servers:
- url: https://api.uploadcare.com
description: Production server
security:
- apiKeyAuth: []
tags:
- name: Integrations
description: |
You don't have to code most of the low-level API interactions.
We have high-level [libraries](/docs/integrations/) for all popular platforms:
* [JavaScript](/docs/integrations/javascript/)
* [PHP](/docs/integrations/php/)
* [Python](/docs/integrations/python/) (including Django)
* [Ruby](/docs/integrations/ruby/) and [Rails](/docs/integrations/rails/)
* [Swift](/docs/integrations/swift/) (iOS, iPadOS, macOS, tvOS, Linux)
* [Kotlin](/docs/integrations/android/) (Android)
* [Java](/docs/integrations/java/)
* [Golang](/docs/integrations/golang/)
* [Rust](/docs/integrations/rust/)
In this API reference, you will see request examples in different languages.
Keep in mind that running sample queries requires our libraries to be installed and initialized.
- name: File
- name: File metadata
description: |
File metadata is additional, arbitrary data, associated with uploaded file. As an example, you could store unique file identifier from your system.
Metadata is key-value data. You can specify up to 50 keys, with key names up to 64 characters long and values up to 512 characters long.
Read more in the [docs](https://uploadcare.com/docs/file-metadata/).
**Notice:** Do not store any sensitive information (bank account numbers, card details, etc.) as metadata.
**Notice:** File metadata is provided by the end-users uploading the files and can contain symbols unsafe in, for example, HTML context. Please escape the metadata before use according to the rules of the target runtime context (HTML browser, SQL query parameter, etc).
- name: Group
- name: Add-Ons
description: |
An `Add-On` is an application implemented by Uploadcare that accepts uploaded files as an
input and can produce other files and/or [appdata](#operation/fileInfo) as an output.
- name: Project
- name: Webhook
- name: Conversion
- name: Changelog
description: |
### Document conversion info, November 7, 2023
`GET /convert/document/{uuid}/` allows you to determine the document format and possible conversion formats.
Learn more about [Document conversion](/docs/transformations/file-conversion/).
### Multipage conversion, September 20, 2023
Added `save_in_group` parameter to allow `POST /convert/document/` to convert a multi-page document into a group of files.
Learn more about [Multipage conversion](/docs/transformations/file-conversion/#multipage-conversion).
### Webhook updates, July 7, 2023
Added a field `initiator` in webhook payload for all events. It contains a "link" to the entity that initiated the webhook and metadata related to the event.
Added new webhook events:
* `file.info_updated` — file's `metadata` or `appdata` has been altered.
* `file.deleted` — a file has been removed.
* `file.stored` — a file has been stored.
Learn more about [Webhook events](/docs/webhooks/#event-types).
### File metadata, September 8, 2022
File metadata is introduced. [File metadata Upload API](/docs/api/upload/upload/file-upload-info/#response.body.metadata) provides an option to specify a file's metadata during the file uploading procedure. [File metadata REST API](https://uploadcare.com/docs/api/rest/file-metadata/) provides the ability to update the file's metadata.
| GET /files/{uuid}/metadata/ |
Get file's metadata keys and values |
| GET /files/{uuid}/metadata/{key}/ |
Get the value of a single metadata key |
| PUT /files/{uuid}/metadata/{key}/ |
Update the value of a single metadata key. If the key does not exist, it will be created |
| DELETE /files/{uuid}/metadata/{key}/ |
Delete a file's metadata key |
| GET /files/{uuid}/ |
Learn more about [File metadata management](/docs/file-metadata/).
### Changes to previous API version (_released on 15 Aug 2022_)
| GET /files/{uuid}/ |
File information doesn't return `image_info` and `video_info` fields anymore
Added mime-type, image (dimensions, format, etc), video information (duration, format, bitrate, etc), audio information, etc. to `content_info` field
Associated field `appdata` that includes dictionary of application names and data with these applications
Removed `rekognition_info` in favor of `appdata`
Renamed Parameter `add_fields` to `include` |
| DELETE /files/{uuid}/ |
Removed in favour of `/files/{uuid}/storage/` |
| GET /files/ |
Remove the option of sorting the file list by file size |
| PUT /group/{uuid}/storage/ |
Removed. To store or remove files from a group, query the list of files in it, split the list into chunks of 100 files per chunk and then perform batch file storing or batch file removal for all the chunks |
| DELETE /group/{uuid}/ |
Added a possibility to delete a Group. Note: when we delete a group, we remove information about the group object itself, the files from the group are left intact |
| POST /addons/uc_clamav_virus_scan/execute/ |
Introduced ClamAV Add-On: perform virus scan on a target file |
| GET /addons/uc_clamav_virus_scan/execute/status/ |
Check ClamAV Add-On execution status |
| POST /addons/aws_rekognition_detect_labels /execute/ |
Introduced AWS Rekognition Add-On: detect labels on a target image and save results in the file's application data |
| GET /addons/aws_rekognition_detect_labels /execute/status/ |
Check AWS Rekognition Add-On execution status |
| POST /addons/aws_rekognition_detect_ moderation_labels/execute/ |
Introduced AWS Rekognition moderation Add-On: detect labels on a target image and save results in the file's application data |
| GET /addons/aws_rekognition_detect_ moderation_labels/execute/status/ |
Check AWS Rekognition moderation Add-On execution status |
| POST /addons/remove_bg/execute/ |
Introduced RemoveBG Add-On |
| GET /addons/remove_bg/execute/status/ |
Check RemoveBG Add-On execution status and get `file_id` with an UUID of the file with removed background |
- name: Versioning
description: |
When we introduce backward-incompatible changes, we release new major versions.
Once published, such versions are supported for _2 years_.
| Version | Date Published | Available Until |
| ----------------------------------------------------- | -------------- | --------------- |
| [0.7](https://uploadcare.com/docs/api/rest/) | 15 Aug 2022 | TBD |
| [0.6](https://uploadcare.com/api-refs/rest-api/v0.6/) | RC | 15 Aug 2024 |
| [0.5](https://uploadcare.com/api-refs/rest-api/v0.5/) | 1 Apr 2016 | 15 Aug 2024 |
| 0.4 | 13 Jun 2015 | 1 Sep 2019 |
| 0.3 | 11 Jun 2013 | 1 Sep 2019 |
| 0.2 | 7 Jun 2012 | 1 Sep 2019 |
| 0.1 | 31 May 2012 | 1 Feb 2019 |
| Undefined | 31 May 2012 | 1 Sep 2019 |
Note, you won’t be able to use any API version after its support term.
Requests to deprecated API versions will return error messages.
- name: Other APIs
description: |
You can find the complete reference documentation for the Upload API [here](https://uploadcare.com/docs/api/upload/) and URL API [here](https://uploadcare.com/docs/api/url/).
paths:
/files/:
get:
tags:
- File
summary: List of files
description: Getting a paginated list of files. If you need multiple results pages, use `previous`/`next` from the response to navigate back/forth.
operationId: filesList
parameters:
- $ref: '#/components/parameters/acceptHeader'
- in: query
name: removed
description: '`true` to only include removed files in the response, `false` to include existing files. Defaults to `false`.'
schema:
type: boolean
default: false
example: true
- in: query
name: stored
description: '`true` to only include files that were stored, `false` to include temporary ones. The default is unset: both stored and not stored files are returned.'
schema:
type: boolean
example: true
- in: query
name: limit
description: A preferred amount of files in a list for a single response. Defaults to 100, while the maximum is 1000.
schema:
type: integer
maximum: 1000
minimum: 1
example: 100
default: 100
- in: query
name: ordering
description: Specifies the way files are sorted in a returned list. `datetime_uploaded` for ascending order, `-datetime_uploaded` for descending order.
schema:
type: string
enum:
- datetime_uploaded
- '-datetime_uploaded'
default: datetime_uploaded
example: '-datetime_uploaded'
- in: query
name: from
description: A starting point for filtering the files. If provided, the value MUST adhere to the ISO 8601 Extended Date/Time Format (`YYYY-MM-DDTHH:MM:SSZ`).
schema:
type: string
example: '2015-09-10T10:00:00Z'
- in: query
name: include
description: 'Include additional fields to the file object, such as: appdata.'
schema:
type: string
example: appdata
responses:
'200':
$ref: '#/components/responses/paginatedFilesResponse'
'400':
$ref: '#/components/responses/simpleAuthHTTPForbiddenResponse'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'429':
$ref: '#/components/responses/requestWasThrottledError'
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
listOfFiles,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await listOfFiles(
{},
{ authSchema: uploadcareSimpleAuthSchema }
)
- lang: PHP
label: PHP
source: |
file();
$list = $api->listFiles();
foreach ($list->getResults() as $result) {
echo \sprintf('URL: %s', $result->getUrl());
}
while (($next = $api->nextPage($list)) !== null) {
foreach ($next->getResults() as $result) {
echo \sprintf('URL: %s', $result->getUrl());
}
}
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
files = uploadcare.list_files(stored=True, limit=10)
for file in files:
print(file.info)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
list = Uploadcare::FileList.file_list(stored: true, removed: false, limit: 100)
list.each { |file| puts file.inspect }
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let query = PaginationQuery()
.stored(true)
.ordering(.dateTimeUploadedDESC)
.limit(10)
var list = uploadcare.listOfFiles()
try await list.get(withQuery: query)
print(list)
// Next page
if list.next != nil {
try await list.nextPage()
print(list)
}
// Previous page
if list.previous != nil {
try await filesList.previousPage()
print(list)
}
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val filesQueryBuilder = uploadcare.getFiles()
val files = filesQueryBuilder
.stored(true)
.ordering(Order.UPLOAD_TIME_DESC)
.asList()
Log.d("TAG", files.toString())
/files/{uuid}/storage/:
put:
summary: Store file
description: Store a single file by UUID. When file is stored, it is available permanently. If not stored — it will only be available for 24 hours. If the parameter is omitted, it checks the `Auto file storing` setting of your Uploadcare project identified by the `public_key` provided in the `auth-param`.
tags:
- File
operationId: storeFile
parameters:
- $ref: '#/components/parameters/acceptHeader'
- in: path
name: uuid
description: File UUID.
required: true
schema:
type: string
format: uuid
example: 21975c81-7f57-4c7a-aef9-acfe28779f78
responses:
'200':
description: File stored. File info in JSON.
content:
application/json:
schema:
$ref: '#/components/schemas/file'
'400':
$ref: '#/components/responses/simpleAuthHTTPForbiddenResponse'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'404':
$ref: '#/components/responses/fileNotFoundError'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'429':
$ref: '#/components/responses/requestWasThrottledError'
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
storeFile,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await storeFile(
{
uuid: '1bac376c-aa7e-4356-861b-dd2657b5bfd2',
},
{ authSchema: uploadcareSimpleAuthSchema }
)
- lang: PHP
label: PHP
source: |
file();
$result = $api->storeFile('1bac376c-aa7e-4356-861b-dd2657b5bfd2');
echo \sprintf('File %s is stored at %s', $result->getUuid(), $result->getDatetimeStored()->format(\DateTimeInterface::ATOM));
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
file = uploadcare.file("1bac376c-aa7e-4356-861b-dd2657b5bfd2")
file.store()
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
uuid = '1bac376c-aa7e-4356-861b-dd2657b5bfd2'
Uploadcare::File.store(uuid)
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let file = try await uploadcare.storeFile(withUUID: "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
print(file)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
uploadcare.saveFile("1bac376c-aa7e-4356-861b-dd2657b5bfd2")
delete:
summary: Delete file
tags:
- File
description: |
Removes individual files. Returns file info.
Note: this operation removes the file from storage but doesn't invalidate CDN cache.
operationId: deleteFileStorage
parameters:
- $ref: '#/components/parameters/acceptHeader'
- in: path
name: uuid
description: File UUID.
required: true
schema:
type: string
format: uuid
example: 21975c81-7f57-4c7a-aef9-acfe28779f78
responses:
'200':
description: File deleted. File info in JSON.
content:
application/json:
schema:
$ref: '#/components/schemas/file'
examples:
Removed File:
$ref: '#/components/examples/file_removed'
'400':
$ref: '#/components/responses/simpleAuthHTTPForbiddenResponse'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'404':
$ref: '#/components/responses/fileNotFoundError'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'429':
$ref: '#/components/responses/requestWasThrottledError'
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
deleteFile,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await deleteFile(
{
uuid: '1bac376c-aa7e-4356-861b-dd2657b5bfd2',
},
{ authSchema: uploadcareSimpleAuthSchema }
)
- lang: PHP
label: PHP
source: |
file()->deleteFile('1bac376c-aa7e-4356-861b-dd2657b5bfd2');
echo \sprintf('File \'%s\' deleted at \'%s\'', $fileInfo->getUuid(), $fileInfo->getDatetimeRemoved()->format(\DateTimeInterface::ATOM));
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
file = uploadcare.file("1bac376c-aa7e-4356-861b-dd2657b5bfd2")
file.delete()
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
puts Uploadcare::File.delete('1bac376c-aa7e-4356-861b-dd2657b5bfd2')
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let file = try await uploadcare.deleteFile(withUUID: "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
print(file)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
uploadcare.deleteFile(fileId = "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
/files/{uuid}/:
get:
summary: File info
tags:
- File
description: Get file information by its UUID (immutable).
operationId: fileInfo
parameters:
- $ref: '#/components/parameters/acceptHeader'
- in: path
name: uuid
description: File UUID.
required: true
schema:
type: string
format: uuid
example: 03ccf9ab-f266-43fb-973d-a6529c55c2ae
- in: query
name: include
description: 'Include additional fields to the file object, such as: appdata.'
schema:
type: string
example: appdata
responses:
'200':
description: File info in JSON.
content:
application/json:
schema:
$ref: '#/components/schemas/file'
examples:
Image:
$ref: '#/components/examples/file'
Video:
$ref: '#/components/examples/file_video'
'400':
$ref: '#/components/responses/simpleAuthHTTPForbiddenResponse'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'404':
$ref: '#/components/responses/fileNotFoundError'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'429':
$ref: '#/components/responses/requestWasThrottledError'
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
fileInfo,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await fileInfo(
{
uuid: '1bac376c-aa7e-4356-861b-dd2657b5bfd2',
},
{ authSchema: uploadcareSimpleAuthSchema }
)
- lang: PHP
label: PHP
source: |
file();
$fileInfo = $api->fileInfo('1bac376c-aa7e-4356-861b-dd2657b5bfd2');
echo \sprintf('URL: %s, ID: %s, Mime type: %s', $fileInfo->getUrl(), $fileInfo->getUuid(), $fileInfo->getMimeType());
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
file = uploadcare.file("1bac376c-aa7e-4356-861b-dd2657b5bfd2")
print(file.info)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
uuid = '1bac376c-aa7e-4356-861b-dd2657b5bfd2'
puts Uploadcare::File.info(uuid).inspect
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let fileInfoQuery = FileInfoQuery().include(.appdata)
let file = try await uploadcare.fileInfo(withUUID: "1bac376c-aa7e-4356-861b-dd2657b5bfd2", withQuery: fileInfoQuery)
print(file)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val file = uploadcare.getFile(fileId = "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
Log.d("TAG", file.toString())
/files/storage/:
put:
summary: Batch file storing
description: Used to store multiple files in one go. Up to 100 files are supported per request. A JSON object holding your File list SHOULD be put into a request body.
operationId: filesStoring
tags:
- File
parameters:
- $ref: '#/components/parameters/acceptHeader'
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
type: string
format: uuid
description: List of file UUIDs to store.
example:
- 21975c81-7f57-4c7a-aef9-acfe28779f78
- cbaf2d73-5169-4b2b-a543-496cf2813dff
responses:
'200':
$ref: '#/components/responses/filesStorageResponse'
'400':
$ref: '#/components/responses/filesStoreUUIDSError'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'429':
$ref: '#/components/responses/requestWasThrottledError'
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
storeFiles,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await storeFiles(
{
uuids: [
'b7a301d1-1bd0-473d-8d32-708dd55addc0',
'1bac376c-aa7e-4356-861b-dd2657b5bfd2',
]
},
{ authSchema: uploadcareSimpleAuthSchema }
)
- lang: PHP
label: PHP
source: |
file();
$result = $api->batchStoreFile(['b7a301d1-1bd0-473d-8d32-708dd55addc0', '1bac376c-aa7e-4356-861b-dd2657b5bfd2']);
foreach ($result->getResult() as $result) {
if (!$result instanceof FileInfoInterface) {
continue;
}
\sprintf('Result %s is stored at %s', $result->getUuid(), $result->getDatetimeStored()->format(\DateTimeInterface::ATOM));
}
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
files = [
'b7a301d1-1bd0-473d-8d32-708dd55addc0',
'1bac376c-aa7e-4356-861b-dd2657b5bfd2'
]
uploadcare.store_files(files)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
uuids = %w[
b7a301d1-1bd0-473d-8d32-708dd55addc0
1bac376c-aa7e-4356-861b-dd2657b5bfd2
]
Uploadcare::FileList.batch_store(uuids)
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let uuids = [
"b7a301d1-1bd0-473d-8d32-708dd55addc0",
"1bac376c-aa7e-4356-861b-dd2657b5bfd2"
]
let response = try await uploadcare.storeFiles(withUUIDs: uuids)
print(response)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val uuids = listOf(
"b7a301d1-1bd0-473d-8d32-708dd55addc0",
"1bac376c-aa7e-4356-861b-dd2657b5bfd2"
)
uploadcare.saveFiles(uuids)
delete:
summary: Batch file delete
description: |
Used to delete multiple files in one go. Up to 100 files are supported per request. A JSON object holding your File list SHOULD be put into a request body.
Note: this operation removes files from storage but doesn't invalidate CDN cache.
operationId: filesDelete
tags:
- File
parameters:
- $ref: '#/components/parameters/acceptHeader'
requestBody:
required: true
content:
application/json:
schema:
type: array
items:
type: string
format: uuid
description: List of file UUIDs to delete.
example:
- 21975c81-7f57-4c7a-aef9-acfe28779f78
- cbaf2d73-5169-4b2b-a543-496cf2813dff
responses:
'200':
$ref: '#/components/responses/filesStorageResponse'
'400':
$ref: '#/components/responses/filesStoreUUIDSError'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'429':
$ref: '#/components/responses/requestWasThrottledError'
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
deleteFiles,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await deleteFiles(
{
uuids: [
'21975c81-7f57-4c7a-aef9-acfe28779f78',
'cbaf2d73-5169-4b2b-a543-496cf2813dff',
]
},
{ authSchema: uploadcareSimpleAuthSchema }
)
- lang: PHP
label: PHP
source: |
file();
$fileInfo = $api->fileInfo('21975c81-7f57-4c7a-aef9-acfe28779f78');
$api->deleteFile($fileInfo);
echo \sprintf('File \'%s\' deleted at \'%s\'', $fileInfo->getUuid(), $fileInfo->getDatetimeRemoved()->format(\DateTimeInterface::ATOM));
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
files = [
'21975c81-7f57-4c7a-aef9-acfe28779f78',
'cbaf2d73-5169-4b2b-a543-496cf2813dff'
]
uploadcare.delete_files(files)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
uuids = %w[21975c81-7f57-4c7a-aef9-acfe28779f78 cbaf2d73-5169-4b2b-a543-496cf2813dff]
puts Uploadcare::FileList.batch_delete(uuids)
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let uuids = ["21975c81-7f57-4c7a-aef9-acfe28779f78", "cbaf2d73-5169-4b2b-a543-496cf2813dff"]
try await uploadcare.deleteFiles(withUUIDs: uuids)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val uuids = listOf("21975c81-7f57-4c7a-aef9-acfe28779f78", "cbaf2d73-5169-4b2b-a543-496cf2813dff")
uploadcare.deleteFiles(fileIds = uuids)
/files/local_copy/:
post:
summary: Copy file to local storage
description: |
POST requests are used to copy original files or their modified versions to a default storage.
Source files MAY either be stored or just uploaded and MUST NOT be deleted.
Copying of large files is not supported at the moment. If the file CDN URL includes transformation operators, its size MUST NOT exceed 100 MB. If not, the size MUST NOT exceed 5 GB.
Note: In the immediate 201 response, the `result.size` can be `0` and the `result.mime_type` can be `application/octet-stream`. This indicates the copy has been initiated but is not yet completed.
Once the copy finishes, fetching the file info (e.g., `GET /files/{uuid}/`) will return the actual size and MIME type.
tags:
- File
operationId: createLocalCopy
requestBody:
required: true
content:
application/json:
schema:
required:
- source
type: object
properties:
source:
description: A CDN URL or just UUID of a file subjected to copy.
type: string
format: uri
example:
uuid:
value: 85b5644f-e692-4855-9db0-8c5a83096e25
cdn:
value: http://www.ucarecdn.com/85b5644f-e692-4855-9db0-8c5a83096e25/-/resize/200x/roof.jpg
store:
description: The parameter only applies to the Uploadcare storage and MUST be either true or false.
type: string
enum:
- 'true'
- 'false'
default: 'false'
example: 'true'
metadata:
description: Arbitrary additional metadata.
type: object
example:
subsystem: uploader
example:
source: 03ccf9ab-f266-43fb-973d-a6529c55c2ae
store: 'true'
metadata:
subsystem: uploader
pet: cat
parameters:
- $ref: '#/components/parameters/acceptHeader'
responses:
'201':
description: The file was copied successfully. HTTP response contains `result` field with information about the copy.
content:
application/json:
schema:
$ref: '#/components/schemas/localCopyResponse'
'400':
$ref: '#/components/responses/fileCopyErrors'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'429':
$ref: '#/components/responses/requestWasThrottledError'
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
copyFileToLocalStorage,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await copyFileToLocalStorage(
{
source: '1bac376c-aa7e-4356-861b-dd2657b5bfd2',
store: true,
},
{ authSchema: uploadcareSimpleAuthSchema }
)
- lang: PHP
label: PHP
source: |
file();
$fileInfo = $api->copyToLocalStorage('03ccf9ab-f266-43fb-973d-a6529c55c2ae', true);
echo \sprintf('File \'%s\' copied to local storage', $fileInfo->getUuid());
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
file = uploadcare.file("1bac376c-aa7e-4356-861b-dd2657b5bfd2")
copied_file = file.create_local_copy(store=True)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
source = '1bac376c-aa7e-4356-861b-dd2657b5bfd2'
copied_file = Uploadcare::File.local_copy(source, store: true)
puts copied_file.uuid
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let response = try await uploadcare.copyFileToLocalStorage(source: "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
print(response)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val copyFile = uploadcare.copyFileLocalStorage(source = "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
Log.d("TAG", copyFile.toString())
/files/remote_copy/:
post:
summary: Copy file to remote storage
description: |
POST requests are used to copy original files or their modified versions to the S3 bucket.
Source files MAY either be stored or just uploaded and MUST NOT be deleted.
Copying of large files is not supported at the moment. File size MUST NOT exceed 5 GB.
tags:
- File
operationId: createRemoteCopy
requestBody:
required: true
content:
application/json:
schema:
required:
- source
- target
type: object
properties:
source:
description: A CDN URL or just UUID of a file subjected to copy.
type: string
format: uri
example:
uuid:
value: 85b5644f-e692-4855-9db0-8c5a83096e25
cdn:
value: http://www.ucarecdn.com/85b5644f-e692-4855-9db0-8c5a83096e25/-/resize/200x/roof.jpg
target:
description: Identifies a custom storage name related to your project. It implies that you are copying a file to a specified custom storage. Keep in mind that you can have multiple storages associated with a single S3 bucket.
type: string
example: mytarget
make_public:
description: MUST be either `true` or `false`. The `true` value makes copied files available via public links, `false` does the opposite.
type: boolean
default: true
example: true
pattern:
description: |
The parameter is used to specify file names Uploadcare passes to the S3 bucket. If the parameter is omitted, your S3 bucket pattern is used. Use any combination of allowed values.
Parameter values:
- `${default}` = `${uuid}/${auto_filename}`
- `${auto_filename}` = `${filename}${effects}${ext}`
- `${effects}` = processing operations put into a CDN URL
- `${filename}` = original filename without extension
- `${uuid}` = file UUID
- `${ext}` = file extension, including period, e.g. .jpg
type: string
default: ${default}
enum:
- ${default}
- ${auto_filename}
- ${effects}
- ${filename}
- ${uuid}
- ${ext}
example: ${uuid}.${ext}
example:
source: 03ccf9ab-f266-43fb-973d-a6529c55c2ae
target: mytarget
parameters:
- $ref: '#/components/parameters/acceptHeader'
responses:
'200':
$ref: '#/components/responses/remoteCopyResponse'
'201':
$ref: '#/components/responses/remoteCopyResponse201'
'400':
description: Simple HTTP auth. on HTTP or file copy errors.
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/simpleAuthHTTPForbidden'
- $ref: '#/components/responses/fileCopyErrors/content/application~1json/schema'
examples:
Authentication Error:
$ref: '#/components/examples/simpleAuthHTTPForbidden'
Copy Error:
value:
detail: Bad `source` parameter. Use UUID or CDN URL.
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'429':
$ref: '#/components/responses/requestWasThrottledError'
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
copyFileToRemoteStorage,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await copyFileToRemoteStorage(
{
source: '1bac376c-aa7e-4356-861b-dd2657b5bfd2',
target: 'custom_storage_connected_to_the_project',
},
{ authSchema: uploadcareSimpleAuthSchema }
)
- lang: PHP
label: PHP
source: |
file();
$result = $api->copyToRemoteStorage('03ccf9ab-f266-43fb-973d-a6529c55c2ae', true);
echo \sprintf('File \'%s\' copied to local storage', $result);
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
file = uploadcare.file("1bac376c-aa7e-4356-861b-dd2657b5bfd2")
r_copied_file = file.create_remote_copy(
target='custom_storage_connected_to_the_project',
make_public=True,
pattern='${uuid}/${filename}${ext}',
)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
source_object = '1bac376c-aa7e-4356-861b-dd2657b5bfd2'
target = 'custom_storage_connected_to_the_project'
copied_file_url = Uploadcare::File.remote_copy(source_object, target, make_public: true)
puts copied_file_url
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let response = try await uploadcare.copyFileToRemoteStorage(source: "03ccf9ab-f266-43fb-973d-a6529c55c2ae", target: "mytarget", pattern: .uuid)
print(response)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val copyFile = uploadcare.copyFileRemoteStorage(
source = "1bac376c-aa7e-4356-861b-dd2657b5bfd2",
target = "custom_storage_connected_to_the_project"
)
Log.d("TAG", copyFile.toString())
/addons/aws_rekognition_detect_labels/execute/:
post:
summary: Execute AWS Rekognition
description: Execute [AWS Rekognition](https://docs.aws.amazon.com/rekognition/latest/dg/labels-detect-labels-image.html) Add-On for a given target to detect labels in an image. **Note:** Detected labels are stored in the file's appdata.
tags:
- Add-Ons
operationId: awsRekognitionExecute
parameters:
- $ref: '#/components/parameters/acceptHeader'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
target:
description: Unique ID of the file to process
type: string
format: uuid
example: 21975c81-7f57-4c7a-aef9-acfe28779f78
required:
- target
responses:
'200':
$ref: '#/components/responses/executeAddonResponse'
'400':
$ref: '#/components/responses/simpleAuthHTTPForbiddenResponse'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'409':
$ref: '#/components/responses/executeAddonConcurrentCallResponse'
'429':
$ref: '#/components/responses/requestWasThrottledError'
x-codeSamples:
- lang: PHP
label: PHP
source: |
addons();
$resultKey = $api->requestAwsRecognition('1bac376c-aa7e-4356-861b-dd2657b5bfd2');
echo \sprintf('Recognition requested. Key is \'%s\'', $resultKey);
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
target_file = uploadcare.file("1bac376c-aa7e-4356-861b-dd2657b5bfd2")
aws_recognition_result = uploadcare.addons_api.execute(
target_file,
AddonLabels.AWS_LABEL_RECOGNITION,
)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
uuid = '1bac376c-aa7e-4356-861b-dd2657b5bfd2'
Uploadcare::Addons.ws_rekognition_detect_labels(uuid)
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let response = try await uploadcare.executeAWSRekognition(fileUUID: "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
print(response) // contains requestID
// Execute and wait for completion:
let status = try await uploadcare.performAWSRekognition(fileUUID: "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
print(status)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val addOn = AWSRekognitionAddOn(uploadcare)
val response = addOn.execute(fileId = "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
Log.d("TAG", response.toString())
/addons/aws_rekognition_detect_labels/execute/status/:
get:
summary: Check AWS Rekognition execution status
description: |
Check the status of an Add-On execution request that had been started
using the [Execute Add-On](#operation/awsRekognitionExecute) operation.
tags:
- Add-Ons
operationId: awsRekognitionExecutionStatus
parameters:
- $ref: '#/components/parameters/acceptHeader'
- in: query
name: request_id
description: |
Request ID returned by the Add-On execution request described above.
schema:
type: string
format: uuid
required: true
responses:
'200':
$ref: '#/components/responses/addonExecutionStatusResponse'
'400':
$ref: '#/components/responses/simpleAuthHTTPForbiddenResponse'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
x-codeSamples:
- lang: PHP
label: PHP
source: |
addons();
$status = $api->checkAwsRecognition('request-id');
echo \sprintf('Recognition status: %s', $status);
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
addon_task_status = uploadcare.addons_api.status(request_id, AddonLabels.AWS_LABEL_RECOGNITION)
print(addon_task_status)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
request_id = 'd1fb31c6-ed34-4e21-bdc3-4f1485f58e21'
result = Uploadcare::Addons.ws_rekognition_detect_labels_status(request_id)
puts result.status
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let status = try await uploadcare.checkAWSRekognitionStatus(requestID: "requestID")
print(status)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val addOn = AWSRekognitionAddOn(uploadcare)
val status = addOn.check(requestId = "d1fb31c6-ed34-4e21-bdc3-4f1485f58e21")
Log.d("TAG", status.toString())
/addons/aws_rekognition_detect_moderation_labels/execute/:
post:
summary: Execute AWS Rekognition Moderation
description: Execute [AWS Rekognition Moderation](https://docs.aws.amazon.com/rekognition/latest/dg/moderation.html) Add-On for a given target to detect moderation labels in an image. **Note:** Detected moderation labels are stored in the file's appdata.
tags:
- Add-Ons
operationId: awsRekognitionDetectModerationLabelsExecute
parameters:
- $ref: '#/components/parameters/acceptHeader'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
target:
description: Unique ID of the file to process
type: string
format: uuid
example: 21975c81-7f57-4c7a-aef9-acfe28779f78
required:
- target
responses:
'200':
$ref: '#/components/responses/executeAddonResponse'
'400':
$ref: '#/components/responses/simpleAuthHTTPForbiddenResponse'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'409':
$ref: '#/components/responses/executeAddonConcurrentCallResponse'
'429':
$ref: '#/components/responses/requestWasThrottledError'
x-codeSamples:
- lang: PHP
label: PHP
source: |
addons();
$resultKey = $api->requestAwsRecognitionModeration('1bac376c-aa7e-4356-861b-dd2657b5bfd2');
echo \sprintf('Recognition requested. Key is \'%s\'', $resultKey);
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
target_file = uploadcare.file("1bac376c-aa7e-4356-861b-dd2657b5bfd2")
aws_recognition_result = uploadcare.addons_api.execute(
target_file,
AddonLabels.AWS_MODERATION_LABELS,
)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
uuid = '1bac376c-aa7e-4356-861b-dd2657b5bfd2'
Uploadcare::Addons.ws_rekognition_detect_moderation_labels(uuid)
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let response = try await uploadcare.executeAWSRekognitionModeration(fileUUID: "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
print(response) // contains requestID
// Execute and wait for completion:
let status = try await uploadcare.performAWSRekognitionModeration(fileUUID: "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
print(status)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val addOn = AWSRekognitionModerationAddOn(uploadcare)
val response = addOn.execute(fileId = "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
Log.d("TAG", response.toString())
/addons/aws_rekognition_detect_moderation_labels/execute/status/:
get:
summary: Check AWS Rekognition Moderation execution status
description: |
Check the status of an Add-On execution request that had been started
using the [Execute Add-On](#operation/awsRekognitionDetectModerationLabelsExecute) operation.
tags:
- Add-Ons
operationId: awsRekognitionDetectModerationLabelsExecutionStatus
parameters:
- $ref: '#/components/parameters/acceptHeader'
- in: query
name: request_id
description: |
Request ID returned by the Add-On execution request described above.
schema:
type: string
format: uuid
required: true
responses:
'200':
$ref: '#/components/responses/addonExecutionStatusResponse'
'400':
$ref: '#/components/responses/simpleAuthHTTPForbiddenResponse'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
x-codeSamples:
- lang: PHP
label: PHP
source: |
addons();
$status = $api->checkAwsRecognitionModeration('request-id');
echo \sprintf('Recognition status: %s', $status);
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
addon_task_status = uploadcare.addons_api.status(request_id, AddonLabels.AWS_MODERATION_LABEL)
print(addon_task_status)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
request_id = 'd1fb31c6-ed34-4e21-bdc3-4f1485f58e21'
result = Uploadcare::Addons.ws_rekognition_detect_moderation_labels_status(request_id)
puts result.status
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let status = try await uploadcare.checkAWSRekognitionModerationStatus(requestID: "requestID")
print(status)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val addOn = AWSRekognitionModerationAddOn(uploadcare)
val status = addOn.check(requestId = "d1fb31c6-ed34-4e21-bdc3-4f1485f58e21")
Log.d("TAG", status.toString())
/addons/uc_clamav_virus_scan/execute/:
post:
summary: Execute ClamAV
description: Execute [ClamAV](https://www.clamav.net/) virus checking Add-On for a given target.
tags:
- Add-Ons
operationId: ucClamavVirusScanExecute
parameters:
- $ref: '#/components/parameters/acceptHeader'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
target:
description: Unique ID of the file to process
type: string
format: uuid
example: 21975c81-7f57-4c7a-aef9-acfe28779f78
params:
description: Optional object with Add-On specific parameters
type: object
default: {}
properties:
purge_infected:
type: boolean
description: Purge infected file.
example: true
example:
purge_infected: true
required:
- target
responses:
'200':
$ref: '#/components/responses/executeAddonResponse'
'400':
$ref: '#/components/responses/simpleAuthHTTPForbiddenResponse'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'409':
$ref: '#/components/responses/executeAddonConcurrentCallResponse'
'429':
$ref: '#/components/responses/requestWasThrottledError'
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
executeAddon,
AddonName,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await executeAddon(
{
addonName: AddonName.UC_CLAMAV_VIRUS_SCAN,
target: '1bac376c-aa7e-4356-861b-dd2657b5bfd2',
},
{ authSchema: uploadcareSimpleAuthSchema }
)
- lang: PHP
label: PHP
source: |
addons();
$resultKey = $api->requestAntivirusScan('21975c81-7f57-4c7a-aef9-acfe28779f78');
echo \sprintf('Antivirus scan requested. Key is \'%s\'', $resultKey);
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
clamav_params = AddonClamAVExecutionParams(purge_infected=True)
target_file = uploadcare.file("1bac376c-aa7e-4356-861b-dd2657b5bfd2")
clamav_result = uploadcare.addons_api.execute(
target_file.uuid,
AddonLabels.CLAM_AV,
clamav_params
)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
uuid = '1bac376c-aa7e-4356-861b-dd2657b5bfd2'
Uploadcare::Addons.uc_clamav_virus_scan(uuid, purge_infected: true)
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let parameters = ClamAVAddonExecutionParams(purgeInfected: true)
let response = try await uploadcare.executeClamav(fileUUID: "1bac376c-aa7e-4356-861b-dd2657b5bfd2", parameters: parameters)
print(response) // contains requestID
// Execute and wait for completion:
let status = try await uploadcare.performClamav(fileUUID: "1bac376c-aa7e-4356-861b-dd2657b5bfd2", parameters: parameters)
print(status)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val addOn = ClamAVAddOn(uploadcare)
val response = addOn.execute(fileId = "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
Log.d("TAG", response.toString())
/addons/uc_clamav_virus_scan/execute/status/:
get:
summary: Check ClamAV execution status
description: |
Check the status of an Add-On execution request that had been started
using the [Execute Add-On](#operation/ucClamavVirusScanExecute) operation.
tags:
- Add-Ons
operationId: ucClamavVirusScanExecutionStatus
parameters:
- $ref: '#/components/parameters/acceptHeader'
- in: query
name: request_id
description: |
Request ID returned by the Add-On execution request described above.
schema:
type: string
format: uuid
required: true
responses:
'200':
$ref: '#/components/responses/addonExecutionStatusResponse'
'400':
$ref: '#/components/responses/simpleAuthHTTPForbiddenResponse'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
addonExecutionStatus,
AddonName,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await addonExecutionStatus(
{
addonName: AddonName.UC_CLAMAV_VIRUS_SCAN,
requestId: '1bac376c-aa7e-4356-861b-dd2657b5bfd2',
},
{ authSchema: uploadcareSimpleAuthSchema }
)
- lang: PHP
label: PHP
source: |
addons();
$status = $api->checkAntivirusScan('request-id');
echo \sprintf('Antivirus scan status: %s', $status);
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
addon_task_status = uploadcare.addons_api.status(request_id, AddonLabels.CLAM_AV)
print(addon_task_status)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
request_id = '1bac376c-aa7e-4356-861b-dd2657b5bfd2'
result = Uploadcare::Addons.uc_clamav_virus_scan_status(request_id)
puts result.status
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let status = try await uploadcare.checkClamAVStatus(requestID: "requestID")
print(status)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val addOn = ClamAVAddOn(uploadcare)
val status = addOn.check(requestId = "d1fb31c6-ed34-4e21-bdc3-4f1485f58e21")
Log.d("TAG", status.toString())
/addons/remove_bg/execute/:
post:
summary: Execute Remove.bg
description: Execute [remove.bg](https://remove.bg/) background image removal Add-On for a given target.
tags:
- Add-Ons
operationId: removeBgExecute
parameters:
- $ref: '#/components/parameters/acceptHeader'
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
target:
description: Unique ID of the file to process
type: string
format: uuid
example: 21975c81-7f57-4c7a-aef9-acfe28779f78
params:
description: Optional object with Add-On specific parameters
type: object
properties:
crop:
type: boolean
default: false
description: Whether to crop off all empty regions
crop_margin:
type: string
default: '0'
description: Adds a margin around the cropped subject, e.g 30px or 30%
scale:
type: string
description: Scales the subject relative to the total image size, e.g 80%
example: 30%
add_shadow:
type: boolean
description: Whether to add an artificial shadow to the result
default: false
type_level:
type: string
enum:
- none
- '1'
- '2'
- latest
description: |
"none" = No classification (foreground_type won't bet set in the application data)
"1" = Use coarse classification classes: [person, product, animal, car, other]
"2" = Use more specific classification classes: [person, product, animal, car,
car_interior, car_part, transportation, graphics, other]
"latest" = Always use the latest classification classes available
default: none
type:
type: string
enum:
- auto
- person
- product
- car
description: Foreground type.
semitransparency:
type: boolean
description: Whether to have semi-transparent regions in the result
default: true
channels:
type: string
enum:
- rgba
- alpha
description: Request either the finalized image ('rgba', default) or an alpha mask ('alpha').
default: rgba
roi:
type: string
description: |
Region of interest: Only contents of this rectangular region can be detected
as foreground. Everything outside is considered background and will be removed.
The rectangle is defined as two x/y coordinates in the format "x1 y1 x2 y2".
The coordinates can be in absolute pixels (suffix 'px') or relative to the
width/height of the image (suffix '%'). By default, the whole image is the
region of interest ("0% 0% 100% 100%").
example: 0% 0% 90% 90%
position:
type: string
description: |
Positions the subject within the image canvas. Can be "original"
(default unless "scale" is given), "center" (default when "scale" is given) or a value from "0%" to "100%"
(both horizontal and vertical) or two values (horizontal, vertical).
default: {}
example:
crop: true
type_level: '2'
required:
- target
responses:
'200':
$ref: '#/components/responses/executeAddonResponse'
'400':
$ref: '#/components/responses/simpleAuthHTTPForbiddenResponse'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'409':
$ref: '#/components/responses/executeAddonConcurrentCallResponse'
'429':
$ref: '#/components/responses/requestWasThrottledError'
x-codeSamples:
- lang: PHP
label: PHP
source: |
addons();
$resultKey = $api->requestRemoveBackground('21975c81-7f57-4c7a-aef9-acfe28779f78');
echo \sprintf('Remove background requested. Key is \'%s\'', $resultKey);
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
remove_bg_params = AddonRemoveBGExecutionParams(
crop=True,
crop_margin="20px",
scale="15%",
position ='',
roi = ''
)
target_file = uploadcare.file("1bac376c-aa7e-4356-861b-dd2657b5bfd2")
remove_bg_result = uploadcare.addons_api.execute(
target_file,
AddonLabels.REMOVE_BG,
remove_bg_params
)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
uuid = '1bac376c-aa7e-4356-861b-dd2657b5bfd2'
Uploadcare::Addons.remove_bg(uuid, crop: true)
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let parameters = RemoveBGAddonExecutionParams(crop: true, typeLevel: .two)
let response = try await uploadcare.executeRemoveBG(fileUUID: "1bac376c-aa7e-4356-861b-dd2657b5bfd2", parameters: parameters)
print(response) // contains requestID
// Execute and wait for completion:
let status = try await uploadcare.performRemoveBG(fileUUID: "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
print(status)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val addOn = RemoveBgAddOn(uploadcare)
val response = addOn.execute(fileId = "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
Log.d("TAG", response.toString())
/addons/remove_bg/execute/status/:
get:
summary: Check Remove.bg execution status
description: |
Check the status of an Add-On execution request that had been started
using the [Execute Add-On](#operation/removeBgExecute) operation.
tags:
- Add-Ons
operationId: removeBgExecutionStatus
parameters:
- $ref: '#/components/parameters/acceptHeader'
- in: query
name: request_id
description: |
Request ID returned by the Add-On execution request described above.
schema:
type: string
format: uuid
required: true
responses:
'200':
description: Add-On execution response. See `file_id` in response in order to get image without background.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/addonExecutionStatus'
- type: object
properties:
result:
type: object
properties:
file_id:
type: string
description: UUID of the file with removed background.
example: 21975c81-7f57-4c7a-aef9-acfe28779f78
example:
result:
file_id: 21975c81-7f57-4c7a-aef9-acfe28779f78
status: done
'400':
$ref: '#/components/responses/simpleAuthHTTPForbiddenResponse'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
x-codeSamples:
- lang: PHP
label: PHP
source: |
addons();
$status = $api->checkRemoveBackground('request-id');
echo \sprintf('Remove background status: %s', $status);
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
addon_task_status = uploadcare.addons_api.status(request_id, AddonLabels.REMOVE_BG)
print(addon_task_status)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
request_id = '1bac376c-aa7e-4356-861b-dd2657b5bfd2'
result = Uploadcare::Addons.remove_bg_status(request_id)
puts result.status
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let status = try await uploadcare.checkRemoveBGStatus(requestID: "requestID")
print(status)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val addOn = RemoveBgAddOn(uploadcare)
val status = addOn.check(requestId = "d1fb31c6-ed34-4e21-bdc3-4f1485f58e21")
Log.d("TAG", status.toString())
/files/{uuid}/metadata/:
get:
summary: Get file's metadata
description: Get file's metadata keys and values.
tags:
- File metadata
operationId: _fileMetadata
parameters:
- $ref: '#/components/parameters/acceptHeader'
- in: path
name: uuid
description: File UUID.
required: true
schema:
type: string
format: uuid
example: 21975c81-7f57-4c7a-aef9-acfe28779f78
responses:
'200':
$ref: '#/components/responses/fileMetadataResponse'
'400':
$ref: '#/components/responses/simpleAuthHTTPForbiddenResponse'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
getMetadata,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await getMetadata(
{
uuid: '1bac376c-aa7e-4356-861b-dd2657b5bfd2',
},
{ authSchema: uploadcareSimpleAuthSchema }
)
- lang: PHP
label: PHP
source: |
file();
$fileInfo = $api->fileInfo('1bac376c-aa7e-4356-861b-dd2657b5bfd2');
echo \sprintf("File %s metadata:\n", $fileInfo->getUuid());
foreach ($fileInfo->getMetadata() as $metaKey => $metaItem) {
echo \sprintf("%s: %s\n", $metaKey, $metaItem);
}
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
value = uploadcare.metadata_api.get_all_metadata("1bac376c-aa7e-4356-861b-dd2657b5bfd2")
print(value)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
uuid = '1bac376c-aa7e-4356-861b-dd2657b5bfd2'
puts Uploadcare::FileMetadata.show(uuid, 'pet')
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let metadata = try await uploadcare.fileMetadata(withUUID: "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
print(metadata)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val metadata = uploadcare.getFileMetadata(fileId = "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
Log.d("TAG", metadata.toString())
/files/{uuid}/metadata/{key}/:
get:
summary: Get metadata key's value
description: Get the value of a single metadata key.
tags:
- File metadata
operationId: fileMetadataKey
parameters:
- $ref: '#/components/parameters/acceptHeader'
- $ref: '#/components/parameters/fileUUID'
- $ref: '#/components/parameters/fileMetadataKey'
responses:
'200':
description: Value of a file's metadata key.
content:
application/json:
schema:
$ref: '#/components/schemas/metadataItemValue'
'400':
$ref: '#/components/responses/simpleAuthHTTPForbiddenResponse'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
getMetadataValue,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await getMetadataValue(
{
uuid: '1bac376c-aa7e-4356-861b-dd2657b5bfd2',
key: 'pet'
},
{ authSchema: uploadcareSimpleAuthSchema }
)
- lang: PHP
label: PHP
source: |
metadata();
$metadata = $api->getMetadata('1bac376c-aa7e-4356-861b-dd2657b5bfd2');
echo \sprintf('Value for key \'pet\' %s', $metadata['pet'] ?? 'does not exists');
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
value = uploadcare.metadata_api.get_key("1bac376c-aa7e-4356-861b-dd2657b5bfd2", "pet")
print(value)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
uuid = '1bac376c-aa7e-4356-861b-dd2657b5bfd2'
puts Uploadcare::FileMetadata.index(uuid).inspect
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let value = try await uploadcare.fileMetadataValue(forKey: "pet", withUUID: "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
print(value)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val value = uploadcare.getFileMetadataKeyValue(
fileId = "1bac376c-aa7e-4356-861b-dd2657b5bfd2",
key = "pet"
)
Log.d("TAG", value)
put:
summary: Update metadata key's value
description: Update the value of a single metadata key. If the key does not exist, it will be created.
tags:
- File metadata
operationId: updateFileMetadataKey
parameters:
- $ref: '#/components/parameters/acceptHeader'
- $ref: '#/components/parameters/fileUUID'
- $ref: '#/components/parameters/fileMetadataKey'
requestBody:
required: true
content:
application/json:
schema:
type: string
minLength: 1
maxLength: 512
responses:
'200':
description: Value of a file's metadata key successfully updated.
content:
application/json:
schema:
$ref: '#/components/schemas/metadataItemValue'
'201':
description: Key of a file metadata successfully added.
content:
application/json:
schema:
$ref: '#/components/schemas/metadataItemValue'
'400':
$ref: '#/components/responses/simpleAuthHTTPForbiddenResponse'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
updateMetadata,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await updateMetadata(
{
uuid: '1bac376c-aa7e-4356-861b-dd2657b5bfd2',
key: 'pet',
value: 'dog',
},
{ authSchema: uploadcareSimpleAuthSchema }
)
- lang: PHP
label: PHP
source: |
metadata();
$result = $api->setKey('1bac376c-aa7e-4356-861b-dd2657b5bfd2', 'pet', 'dog');
echo \sprintf('Metadata key \'pet\' is set to %s', $result['pet']);
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
file_uuid = '1bac376c-aa7e-4356-861b-dd2657b5bfd2'
key, value = "pet", "dog"
uploadcare.metadata_api.update_or_create_key(file_uuid, key, value)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
uuid = '1bac376c-aa7e-4356-861b-dd2657b5bfd2'
key = 'pet'
value = 'dog'
Uploadcare::FileMetadata.update(uuid, key, value)
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let response = try await uploadcare.updateFileMetadata(
withUUID: "1bac376c-aa7e-4356-861b-dd2657b5bfd2",
key: "pet",
value: dog
)
print(response)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val value = uploadcare.updateFileMetadataKeyValue(
fileId = "1bac376c-aa7e-4356-861b-dd2657b5bfd2",
key = "pet",
value = "dog"
)
Log.d("TAG", value)
delete:
summary: Delete metadata key
description: Delete a file's metadata key.
tags:
- File metadata
operationId: deleteFileMetadataKey
parameters:
- $ref: '#/components/parameters/acceptHeader'
- $ref: '#/components/parameters/fileUUID'
- $ref: '#/components/parameters/fileMetadataKey'
responses:
'204':
description: Key of a file metadata successfully deleted.
'400':
$ref: '#/components/responses/simpleAuthHTTPForbiddenResponse'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
deleteMetadata,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await deleteMetadata(
{
uuid: '1bac376c-aa7e-4356-861b-dd2657b5bfd2',
key: 'delete_key',
},
{ authSchema: uploadcareSimpleAuthSchema }
)
- lang: PHP
label: PHP
source: |
metadata();
try {
$metadataApi->removeKey('1bac376c-aa7e-4356-861b-dd2657b5bfd2', 'pet');
} catch (\Throwable $e) {
echo \sprintf('Error while key removing: %s', $e->getMessage());
}
echo 'Key was successfully removed';
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
file_uuid = '1bac376c-aa7e-4356-861b-dd2657b5bfd2'
uploadcare.metadata_api.delete_key(file_uuid, mkey='pet')
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
puts Uploadcare::FileMetadata.delete('1bac376c-aa7e-4356-861b-dd2657b5bfd2', 'pet')
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
try await uploadcare.deleteFileMetadata(forKey: "pet", withUUID: "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
uploadcare.deleteFileMetadataKey(fileId = "1bac376c-aa7e-4356-861b-dd2657b5bfd2", key = "pet")
/groups/:
get:
tags:
- Group
summary: List of groups
description: Get a paginated list of groups.
operationId: groupsList
parameters:
- in: header
name: Accept
description: Version header.
schema:
type: string
nullable: true
enum:
- application/vnd.uploadcare-v0.7+json
example: application/vnd.uploadcare-v0.7+json
required: true
- in: query
name: limit
description: |
A preferred amount of groups in a list for a single response.
Defaults to 100, while the maximum is 1000.
schema:
type: integer
example: 150
- in: query
name: from
description: |
A starting point for filtering the list of groups.
If passed, MUST be a date and time value in ISO-8601 format.
schema:
type: string
format: date-time
example: '2015-01-02T10:00:00.463352Z'
- in: query
name: ordering
description: |
Specifies the way groups should be sorted in the returned list.
`datetime_created` for the ascending order (default),
`-datetime_created` for the descending one.
schema:
type: string
enum:
- datetime_created
- '-datetime_created'
default: datetime_created
example: '-datetime_created'
responses:
'200':
$ref: '#/components/responses/paginatedGroupsResponse'
'400':
$ref: '#/components/responses/simpleAuthHTTPForbiddenResponse'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'429':
$ref: '#/components/responses/requestWasThrottledError'
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
listOfGroups,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await listOfGroups({}, { authSchema: uploadcareSimpleAuthSchema })
- lang: PHP
label: PHP
source: |
group();
$list = $api->listGroups();
foreach ($list->getResults() as $group) {
\sprintf('Group URL: %s, ID: %s', $group->getUrl(), $group->getUuid());
}
while (($next = $api->nextPage($list)) !== null) {
foreach ($next->getResults() as $group) {
\sprintf('Group URL: %s, ID: %s', $group->getUrl(), $group->getUuid());
}
}
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
groups_list = uploadcare.list_file_groups()
print('Number of groups is', groups_list.count())
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
groups = Uploadcare::GroupList.list(limit: 10)
groups.each { |group| puts group.inspect }
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let query = GroupsListQuery()
.limit(10)
.ordering(.datetimeCreatedDESC)
let groupsList = uploadcare.listOfGroups()
let list = try await groupsList.get(withQuery: query)
print(list)
// Next page
let next = try await groupsList.nextPage()
print(list)
// Previous page
let previous = try await groupsList.previousPage()
print(list)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val groupsQueryBuilder = uploadcare.getGroups()
val groups = groupsQueryBuilder
.ordering(Order.UPLOAD_TIME_DESC)
.asList()
Log.d("TAG", groups.toString())
/groups/{uuid}/:
get:
summary: Group info
description: |
Get a file group by its ID.
Groups are identified in a way similar to individual files. A group ID consists of a UUID
followed by a “~” (tilde) character and a group size: integer number of the files in the group.
operationId: groupInfo
tags:
- Group
parameters:
- in: header
name: Accept
description: Version header.
schema:
type: string
nullable: true
enum:
- application/vnd.uploadcare-v0.7+json
example: application/vnd.uploadcare-v0.7+json
required: true
- in: path
name: uuid
description: Group UUID.
required: true
schema:
type: string
example: badfc9f7-f88f-4921-9cc0-22e2c08aa2da~12
responses:
'200':
description: Group's info
content:
application/json:
schema:
$ref: '#/components/schemas/groupWithFiles'
'400':
$ref: '#/components/responses/simpleAuthHTTPForbiddenResponse'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'404':
$ref: '#/components/responses/groupNotFound'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'429':
$ref: '#/components/responses/requestWasThrottledError'
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
groupInfo,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await groupInfo(
{
uuid: 'c5bec8c7-d4b6-4921-9e55-6edb027546bc~1',
},
{ authSchema: uploadcareSimpleAuthSchema }
)
- lang: PHP
label: PHP
source: |
group();
$groupInfo = $api->groupInfo('c5bec8c7-d4b6-4921-9e55-6edb027546bc~1');
echo \sprintf("Group: %s files:\n", $groupInfo->getUrl());
foreach ($groupInfo->getFiles() as $file) {
\sprintf('File: %s (%s)', $file->getUrl(), $file->getUuid());
}
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
group = uploadcare.file_group("c5bec8c7-d4b6-4921-9e55-6edb027546bc~1")
print(group.info)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
uuid = 'c5bec8c7-d4b6-4921-9e55-6edb027546bc~1'
puts Uploadcare::Group.info(uuid).inspect
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let group = try await uploadcare.groupInfo(withUUID: "c5bec8c7-d4b6-4921-9e55-6edb027546bc~1")
print(group)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val group = uploadcare.getGroup(groupId = "c5bec8c7-d4b6-4921-9e55-6edb027546bc~1")
Log.d("TAG", group.toString())
delete:
summary: Delete group
description: |
Delete a file group by its ID.
**Note**: The operation only removes the group object itself. **All the files that were part of the group are left as is.**
operationId: deleteGroup
tags:
- Group
parameters:
- in: header
name: Accept
description: Version header.
schema:
type: string
nullable: true
enum:
- application/vnd.uploadcare-v0.7+json
example: application/vnd.uploadcare-v0.7+json
required: true
- in: path
name: uuid
description: Group UUID.
required: true
schema:
type: string
example: badfc9f7-f88f-4921-9cc0-22e2c08aa2da~12
responses:
'204':
description: The group has been deleted successfully.
'400':
$ref: '#/components/responses/simpleAuthHTTPForbiddenResponse'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'404':
$ref: '#/components/responses/groupNotFound'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'429':
$ref: '#/components/responses/requestWasThrottledError'
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
deleteGroup,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await deleteGroup(
{
uuid: 'c5bec8c7-d4b6-4921-9e55-6edb027546bc~1',
},
{ authSchema: uploadcareSimpleAuthSchema }
)
- lang: PHP
label: PHP
source: |
group();
try {
$api->removeGroup('c5bec8c7-d4b6-4921-9e55-6edb027546bc~1');
} catch (\Throwable $e) {
echo \sprintf('Error while group deletion: %s', $e->getMessage());
}
echo 'Group successfully deleted';
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
file_group = uploadcare.file_group("c5bec8c7-d4b6-4921-9e55-6edb027546bc~1")
file_group.delete()
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
puts Uploadcare::Group.delete('c5bec8c7-d4b6-4921-9e55-6edb027546bc~1')
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
try await uploadcare.deleteGroup(withUUID: "c5bec8c7-d4b6-4921-9e55-6edb027546bc~1")
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
uploadcare.deleteGroup(groupId = "c5bec8c7-d4b6-4921-9e55-6edb027546bc~1")
/project/:
get:
tags:
- Project
summary: Project info
description: Getting info about account project.
operationId: projectInfo
parameters:
- $ref: '#/components/parameters/acceptHeader'
responses:
'200':
description: Your project details.
content:
application/json:
schema:
$ref: '#/components/schemas/project'
'400':
$ref: '#/components/responses/simpleAuthHTTPForbiddenResponse'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'429':
$ref: '#/components/responses/requestWasThrottledError'
x-codeSamples:
- lang: PHP
label: PHP
source: |
project();
$projectInfo = $api->getProjectInfo();
echo \sprintf("Project %s info:\n", $projectInfo->getName());
echo \sprintf("Public key: %s\n", $projectInfo->getPubKey());
echo \sprintf("Auto-store enabled: %s\n", $projectInfo->isAutostoreEnabled() ? 'yes' : 'no');
foreach ($projectInfo->getCollaborators() as $email => $name) {
echo \sprintf("%s: %s\n", $name, $email);
}
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare, ProjectInfo
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
project_info = uploadcare.get_project_info()
print(project_info)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
project_info = Uploadcare::Project.show
puts project_info.inspect
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let project = try await uploadcare.getProjectInfo()
print(project)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val project = uploadcare.getProject()
Log.d("TAG", project.toString())
/webhooks/:
get:
summary: List of webhooks
description: List of project webhooks.
tags:
- Webhook
operationId: webhooksList
parameters:
- $ref: '#/components/parameters/acceptHeader'
responses:
'200':
description: List of project webhooks.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/webhook_of_list_response'
'400':
description: Simple HTTP Auth or webhook permission errors.
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/simpleAuthHTTPForbidden'
- $ref: '#/components/schemas/cantUseWebhooksError'
examples:
Authentication Error:
$ref: '#/components/examples/simpleAuthHTTPForbidden'
Permission Error:
$ref: '#/components/examples/cantUseWebhooksError'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'429':
$ref: '#/components/responses/requestWasThrottledError'
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
listOfWebhooks,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await listOfWebhooks({}, { authSchema: uploadcareSimpleAuthSchema })
- lang: PHP
label: PHP
source: |
webhook();
foreach ($api->listWebhooks() as $webhook) {
\sprintf("Webhook with url %s is %s\n", $webhook->getTargetUrl(), $webhook->isActive() ? 'active' : 'not active');
}
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare, Webhook
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
webhooks: list[Webhook] = list(uploadcare.list_webhooks(limit=10))
for w in webhooks:
print(w.id)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
webhooks = Uploadcare::Webhook.list
webhooks.each { |webhook| puts webhook.inspect }
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let webhooks = try await uploadcare.getListOfWebhooks()
for webhook in webhooks {
print(webhook)
}
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val webhooks = uploadcare.getWebhooks()
Log.d("TAG", webhooks.toString())
post:
summary: Create webhook
description: Create and subscribe to a webhook. You can use webhooks to receive notifications about your uploads. For instance, once a file gets uploaded to your project, we can notify you by sending a message to a target URL.
operationId: webhookCreate
parameters:
- $ref: '#/components/parameters/acceptHeader'
tags:
- Webhook
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
required:
- target_url
- event
type: object
properties:
target_url:
$ref: '#/components/schemas/webhook_target'
event:
$ref: '#/components/schemas/webhook_event'
is_active:
$ref: '#/components/schemas/webhook_is_active'
signing_secret:
$ref: '#/components/schemas/webhook_signing_secret'
version:
$ref: '#/components/schemas/webhook_version_of_request'
callbacks:
file-uploaded:
'{$request.body#/target_url}':
post:
summary: file.uploaded event payload
description: file.uploaded event payload
parameters:
- $ref: '#/components/parameters/webhookSignature'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/webhookFilePayload'
responses:
2XX:
description: Webhook has been received successfully
file-infected:
'{$request.body#/target_url}':
post:
summary: file.infected event payload
description: file.infected event payload
parameters:
- $ref: '#/components/parameters/webhookSignature'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/webhookFilePayload'
responses:
2XX:
description: Webhook has been received successfully
file-stored:
'{$request.body#/target_url}':
post:
summary: file.stored event payload
description: file.stored event payload
parameters:
- $ref: '#/components/parameters/webhookSignature'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/webhookFilePayload'
responses:
2XX:
description: Webhook has been received successfully
file-deleted:
'{$request.body#/target_url}':
post:
summary: file.deleted event payload
description: file.deleted event payload
parameters:
- $ref: '#/components/parameters/webhookSignature'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/webhookFilePayload'
responses:
2XX:
description: Webhook has been received successfully
file-info-updated:
'{$request.body#/target_url}':
post:
summary: file.info_updated event payload
description: file.info_updated event payload
parameters:
- $ref: '#/components/parameters/webhookSignature'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/webhookFileInfoUpdatedPayload'
responses:
2XX:
description: Webhook has been received successfully
responses:
'201':
description: Webhook successfully created.
content:
application/json:
schema:
$ref: '#/components/schemas/webhook_of_list_response'
'400':
description: Simple HTTP Auth or webhook permission or endpoint errors.
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/simpleAuthHTTPForbidden'
- $ref: '#/components/schemas/cantUseWebhooksError'
- $ref: '#/components/schemas/webhookTargetUrlError'
examples:
Authentication Error:
$ref: '#/components/examples/simpleAuthHTTPForbidden'
Permission Error:
$ref: '#/components/examples/cantUseWebhooksError'
Target URL Error:
$ref: '#/components/examples/webhookTargetUrlError'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'429':
$ref: '#/components/responses/requestWasThrottledError'
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
createWebhook,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await createWebhook(
{
targetUrl: 'https://yourwebhook.com',
event: 'file.uploaded',
isActive: true,
},
{ authSchema: uploadcareSimpleAuthSchema }
)
- lang: PHP
label: PHP
source: |
webhook();
$result = $api->createWebhook('https://yourwebhook.com', true, 'sign-secret', 'file.uploaded');
echo \sprintf('Webhook %s created', $result->getId());
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare, Webhook
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
webhook = uploadcare.webhooks_api.create(
{
"event": "file.uploaded",
"target_url": "https://yourwebhook.com",
"is_active": True,
}
)
print(webhook)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
options = {
target_url: 'https://yourwebhook.com',
event: 'file.uploaded',
is_active: true
}
Uploadcare::Webhook.create(**options)
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let url = URL(string: "https://yourwebhook.com")!
let webhook = try await uploadcare.createWebhook(targetUrl: url, event: .fileUploaded, isActive: true, signingSecret: "sign-secret")
print(webhook)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val url = URI("https://yourwebhook.com")
val webhook = uploadcare.createWebhook(
targetUrl = url,
event = EventType.UPLOADED,
isActive = true,
signingSecret = "sign-secret"
)
Log.d("TAG", webhook.toString())
/webhooks/{id}/:
put:
summary: Update webhook
description: Update webhook attributes.
operationId: updateWebhook
tags:
- Webhook
parameters:
- $ref: '#/components/parameters/acceptHeader'
- in: path
name: id
description: Webhook ID.
schema:
type: integer
example: 143
required: true
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
target_url:
$ref: '#/components/schemas/webhook_target'
event:
$ref: '#/components/schemas/webhook_event'
is_active:
$ref: '#/components/schemas/webhook_is_active'
signing_secret:
$ref: '#/components/schemas/webhook_signing_secret'
responses:
'200':
description: Webhook attributes successfully updated.
content:
application/json:
schema:
$ref: '#/components/schemas/webhook'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'404':
description: Webhook with ID {id} not found.
content:
application/json:
schema:
type: object
properties:
detail:
type: string
description: Not found.
example: Not found.
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'429':
$ref: '#/components/responses/requestWasThrottledError'
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
updateWebhook,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await updateWebhook(
{
id: 1473151,
targetUrl: 'https://yourwebhook.com',
event: 'file.uploaded',
isActive: true,
signingSecret: 'webhook-secret',
},
{ authSchema: uploadcareSimpleAuthSchema }
)
- lang: PHP
label: PHP
source: |
webhook();
$webhook = $api->updateWebhook(1473151, [
'target_url' => 'https://yourwebhook.com',
'event' => 'file.uploaded',
'is_active' => true,
'signing_secret' => 'webhook-secret',
]);
\sprintf("Webhook with url %s is %s\n", $webhook->getTargetUrl(), $webhook->isActive() ? 'active' : 'not active');
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare, Webhook
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
webhook_id = 1473151
webhook = uploadcare.webhooks_api.update(webhook_id, {"is_active": False})
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
webhook_id = 1_473_151
options = {
target_url: 'https://yourwebhook.com',
event: 'file.uploaded',
is_active: true,
signing_secret: 'webhook-secret'
}
Uploadcare::Webhook.update(webhook_id, options)
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let url = URL(string: "https://yourwebhook.com")!
let webhook = try await uploadcare.updateWebhook(id: 1473151, targetUrl: url, event: .fileInfoUpdated, isActive: true, signingSecret: "webhook-secret")
print(webhook)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val url = URI("https://yourwebhook.com")
val webhook = uploadcare.updateWebhook(
webhookId = 1473151,
targetUrl = url,
event = EventType.UPLOADED,
isActive = true,
signingSecret = "",
)
Log.d("TAG", webhook.toString())
/webhooks/unsubscribe/:
delete:
summary: Delete webhook
description: Unsubscribe and delete a webhook.
tags:
- Webhook
operationId: webhookUnsubscribe
parameters:
- $ref: '#/components/parameters/acceptHeader'
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
required:
- target_url
type: object
properties:
target_url:
$ref: '#/components/schemas/webhook_target'
responses:
'204':
description: Webhook successfully deleted.
'400':
description: Simple HTTP Auth or webhook permission or endpoint errors.
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/simpleAuthHTTPForbidden'
- $ref: '#/components/schemas/cantUseWebhooksError'
- $ref: '#/components/schemas/webhookTargetUrlError'
examples:
Authentication Error:
$ref: '#/components/examples/simpleAuthHTTPForbidden'
Permission Error:
$ref: '#/components/examples/cantUseWebhooksError'
Target URL Error:
$ref: '#/components/examples/webhookTargetUrlError'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'429':
$ref: '#/components/responses/requestWasThrottledError'
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
deleteWebhook,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await deleteWebhook(
{
targetUrl: 'https://yourwebhook.com',
},
{ authSchema: uploadcareSimpleAuthSchema }
)
- lang: PHP
label: PHP
source: |
webhook();
$result = $api->deleteWebhook('https://yourwebhook.com');
echo $result ? 'Webhook has been deleted' : 'Webhook is not deleted, something went wrong';
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare, Webhook
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
webhook_id = 1473151
uploadcare.delete_webhook(webhook_id)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
puts Uploadcare::Webhook.delete('https://yourwebhook.com')
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let url = URL(string: "https://yourwebhook.com")!
try await uploadcare.deleteWebhook(forTargetUrl: url)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val url = URI("https://yourwebhook.com")
uploadcare.deleteWebhook(url)
/convert/document/{uuid}/:
get:
tags:
- Conversion
summary: Document info
description: The endpoint allows you to determine the document format and possible conversion formats.
operationId: documentConvertInfo
x-codeSamples:
- lang: cURL
label: cURL
source: |
curl -X GET "https://api.uploadcare.com/convert/document/UUID/" \
-H "Content-Type: application/json" \
-H "Accept: application/vnd.uploadcare-v0.7+json" \
-H "Authorization: Uploadcare.Simple YOUR_PUBLIC_KEY:YOUR_SECRET_KEY"
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
uuid = '740e1b8c-1ad8-4324-b7ec-112c79d8eac2'
document_convert_info = uploadcare.document_convert_api.retrieve(uuid)
print(document_convert_info)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
uuid = '740e1b8c-1ad8-4324-b7ec-112c79d8eac2'
puts Uploadcare::DocumentConverter.info(uuid)
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let conversionToken = "YOUR_CONVERSION_TOKEN"
let conversionStatus = try await uploadcare.documentConversionJobStatus(token: conversionToken)
print(conversionStatus)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val documentInfo = uploadcare.getDocumentConversionInfo("YOUR_FILE_UUID")
Log.d("TAG", status.toString())
parameters:
- $ref: '#/components/parameters/acceptHeader'
- name: uuid
description: File uuid.
in: path
required: true
schema:
type: string
example: 86c91c35-58e1-41f7-9b23-2d7652cfcd17
responses:
'200':
$ref: '#/components/responses/documentInfoResponse'
'400':
description: Simple HTTP Auth or document conversion permission errors.
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/simpleAuthHTTPForbidden'
- $ref: '#/components/schemas/cantUseDocsConversionError'
examples:
Authentication Error:
$ref: '#/components/examples/simpleAuthHTTPForbidden'
Permission Error:
$ref: '#/components/examples/cantUseDocsConversionError'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'404':
description: Document with specified ID is not found.
content:
application/json:
schema:
type: object
properties:
detail:
type: string
example: Not found.
default: Not found.
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'429':
$ref: '#/components/responses/requestWasThrottledError'
'503':
description: Conversion service error.
content:
text/plain:
schema:
type: string
/convert/document/:
post:
tags:
- Conversion
summary: Convert document
description: Uploadcare allows you to convert files to different target formats. Check out the [conversion capabilities](https://uploadcare.com/docs/transformations/file-conversion/#document-file-formats) for each supported format.
operationId: documentConvert
parameters:
- $ref: '#/components/parameters/acceptHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/documentJobSubmitParameters'
responses:
'200':
$ref: '#/components/responses/documentJobSubmitResponse'
'400':
description: Simple HTTP Auth or document conversion permission errors.
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/simpleAuthHTTPForbidden'
- $ref: '#/components/schemas/cantUseDocsConversionError'
- $ref: '#/components/schemas/jsonObjectParseError'
- type: object
properties:
detail:
type: string
default: “paths” parameter is required.
examples:
Authentication Error:
$ref: '#/components/examples/simpleAuthHTTPForbidden'
Permission Error:
$ref: '#/components/examples/cantUseDocsConversionError'
json-parse-error:
$ref: '#/components/examples/jsonObjectParseError'
path-error:
value:
detail: “paths” parameter is required.
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
x-codeSamples:
- lang: PHP
label: PHP
source: |
conversion();
$request = new Uploadcare\Conversion\DocumentConversionRequest('pdf');
$result = $api->convertDocument('1bac376c-aa7e-4356-861b-dd2657b5bfd2', $request);
if ($result instanceof ConvertedItemInterface) {
echo \sprintf('Conversion requested. Key is \'%s\'', $result->getToken());
}
if ($result instanceof ResponseProblemInterface) {
echo \sprintf('Error in request: %s', $result->getReason());
}
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
file = uploadcare.file('1bac376c-aa7e-4356-861b-dd2657b5bfd2')
transformation = DocumentTransformation().format(DocumentFormat.pdf)
converted_file = file.convert(transformation)
print(converted_file.info)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
document_params = { uuid: '1bac376c-aa7e-4356-861b-dd2657b5bfd2', format: :pdf }
options = { store: true }
Uploadcare::DocumentConverter.convert(document_params, options)
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let file = try await uploadcare.fileInfo(withUUID: "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
let settings = DocumentConversionJobSettings(forFile: file)
.format(.pdf)
let response = try await uploadcare.convertDocumentsWithSettings([settings])
print(response)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val conversionJob = DocumentConversionJob(fileId = "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
.apply { setFormat(DocumentFormat.PDF) }
val converter = DocumentConverter(uploadcare, listOf(conversionJob))
val response = converter.convertWithResultData()
Log.d("TAG", response.toString())
/convert/document/status/{token}/:
get:
tags:
- Conversion
summary: Document conversion job status
description: Once you get a conversion job result, you can acquire a conversion job status via token. Just put it in your request URL as `:token`.
operationId: documentConvertStatus
parameters:
- $ref: '#/components/parameters/acceptHeader'
- name: token
description: Job token.
in: path
schema:
type: integer
required: true
example: 426339926
responses:
'200':
$ref: '#/components/responses/documentJobStatusResponse'
'400':
description: Simple HTTP Auth or document conversion permission errors.
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/simpleAuthHTTPForbidden'
- $ref: '#/components/schemas/cantUseDocsConversionError'
examples:
Authentication Error:
$ref: '#/components/examples/simpleAuthHTTPForbidden'
Permission Error:
$ref: '#/components/examples/cantUseDocsConversionError'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'404':
description: Job with specified ID is not found.
content:
application/json:
schema:
type: object
properties:
detail:
type: string
example: Not found.
default: Not found.
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'429':
$ref: '#/components/responses/requestWasThrottledError'
'503':
description: Conversion service error.
content:
text/plain:
schema:
type: string
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
conversionJobStatus,
ConversionType,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await conversionJobStatus(
{
type: ConversionType.DOCUMENT,
token: 32921143
},
{ authSchema: uploadcareSimpleAuthSchema }
)
- lang: PHP
label: PHP
source: |
conversion();
$status = $api->documentJobStatus(32921143);
echo \sprintf('Conversion status: %s', $status->getError() ?? $status->getStatus());
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
token = 32921143
document_convert_status = uploadcare.document_convert_api.status(token)
print(document_convert_status.status)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
token = 32_921_143
puts Uploadcare::DocumentConverter.status(token)
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let job = try await uploadcare.documentConversionJobStatus(token: 32921143)
print(job.statusString)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val status = uploadcare.getDocumentConversionStatus(token = 32921143)
Log.d("TAG", status.toString())
/convert/video/:
post:
tags:
- Conversion
summary: Convert video
description: Uploadcare video processing adjusts video quality, format (mp4, webm, ogg), and size, cuts it, and generates thumbnails. Processed video is instantly available over CDN.
operationId: videoConvert
parameters:
- $ref: '#/components/parameters/acceptHeader'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/videoJobSubmitParameters'
responses:
'200':
$ref: '#/components/responses/videoJobSubmitResponse'
'400':
description: Simple HTTP Auth or video conversion permission errors.
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/simpleAuthHTTPForbidden'
- $ref: '#/components/schemas/cantUseVideoConversionError'
- $ref: '#/components/schemas/jsonObjectParseError'
- type: object
properties:
detail:
type: string
default: “paths” parameter is required.
examples:
Authentication Error:
$ref: '#/components/examples/simpleAuthHTTPForbidden'
Permission Error:
$ref: '#/components/examples/cantUseVideoConversionError'
json-parse-error:
$ref: '#/components/examples/jsonObjectParseError'
path-error:
value:
detail: “paths” parameter is required.
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'406':
$ref: '#/components/responses/invalidAcceptHeader'
x-codeSamples:
- lang: PHP
label: PHP
source: |
conversion();
$request = (new Uploadcare\Conversion\VideoEncodingRequest())
->setHorizontalSize(1024)
->setVerticalSize(768)
->setResizeMode('preserve_ratio')
->setTargetFormat('mp4');
$result = $api->convertVideo('1bac376c-aa7e-4356-861b-dd2657b5bfd2', $request);
if ($result instanceof ConvertedItemInterface) {
echo \sprintf('Conversion requested. Key is \'%s\'', $result->getToken());
}
if ($result instanceof ResponseProblemInterface) {
echo \sprintf('Error in request: %s', $result->getReason());
}
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
transformation = (
VideoTransformation()
.format(VideoFormat.mp4)
.size(width=640, height=480, resize_mode=ResizeMode.add_padding)
.quality(Quality.lighter)
.cut(start_time="0:1.535", length="0:10.0")
.thumbs(10)
)
path = transformation.path('1bac376c-aa7e-4356-861b-dd2657b5bfd2')
response = uploadcare.video_convert_api.convert([path])
video_convert_info = response.result[0]
converted_file = uploadcare.file(video_convert_info.uuid)
video_convert_status = uploadcare.video_convert_api.status(video_convert_info.token)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
video_params = {
uuid: '1bac376c-aa7e-4356-861b-dd2657b5bfd2',
format: :mp4,
quality: :lighter
}
options = { store: true }
Uploadcare::VideoConverter.convert(video_params, options)
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let file = try await uploadcare.fileInfo(withUUID: "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
let settings = VideoConversionJobSettings(forFile: videoFile)
.format(.mp4)
.size(VideoSize(width: 640, height: 480))
.resizeMode(.addPadding)
.quality(.lighter)
.cut( VideoCut(startTime: "0:0:5.000", length: "15") )
.thumbs(10)
let response = try await uploadcare.convertVideosWithSettings([settings])
print(response)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val conversionJob = VideoConversionJob(fileId = "1bac376c-aa7e-4356-861b-dd2657b5bfd2")
.apply {
setFormat(VideoFormat.MP4)
resize(width = 640, height = 480, resizeMode = VideoResizeMode.LETTERBOX)
quality(VideoQuality.LIGHTER)
cut(startTime = "0:0:5.000", length = "15")
thumbnails(10)
}
val converter = VideoConverter(uploadcare, listOf(conversionJob))
val response = converter.convertWithResultData()
Log.d("TAG", response.toString())
/convert/video/status/{token}/:
get:
tags:
- Conversion
summary: Video conversion job status
description: Once you get a processing job result, you can acquire a processing job status via token. Just put it in your request URL as `:token`.
operationId: videoConvertStatus
parameters:
- $ref: '#/components/parameters/acceptHeader'
- name: token
description: Job token.
in: path
schema:
type: integer
required: true
example: 426339926
responses:
'200':
$ref: '#/components/responses/videoJobStatusResponse'
'400':
description: Simple HTTP Auth or video conversion permission errors.
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/simpleAuthHTTPForbidden'
- $ref: '#/components/schemas/cantUseVideoConversionError'
examples:
Authentication Error:
$ref: '#/components/examples/simpleAuthHTTPForbidden'
Permission Error:
$ref: '#/components/examples/cantUseVideoConversionError'
'401':
$ref: '#/components/responses/authorizationProblemsResponse'
'404':
description: Job with specified ID is not found.
content:
application/json:
schema:
type: object
properties:
detail:
type: string
example: Not found.
default: Not found.
'406':
$ref: '#/components/responses/invalidAcceptHeader'
'429':
$ref: '#/components/responses/requestWasThrottledError'
'503':
description: Conversion service error.
content:
text/plain:
schema:
type: string
x-codeSamples:
- lang: JavaScript
label: JS
source: |
import {
conversionJobStatus,
ConversionType,
UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: 'YOUR_PUBLIC_KEY',
secretKey: 'YOUR_SECRET_KEY',
});
const result = await conversionJobStatus(
{
type: ConversionType.VIDEO,
token: 1201016744
},
{ authSchema: uploadcareSimpleAuthSchema }
)
- lang: PHP
label: PHP
source: |
conversion();
$status = $api->videoJobStatus(1201016744);
echo \sprintf('Conversion status: %s', $status->getError() ?? $status->getStatus());
- lang: Python
label: Python
source: |
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')
token = 1201016744
video_convert_status = uploadcare.video_convert_api.status(token)
print(video_convert_status.status)
- lang: Ruby
label: Ruby
source: |
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'
token = 1_201_016_744
puts Uploadcare::VideoConverter.status(token)
- lang: Swift
label: Swift
source: |
import Uploadcare
let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")
let job = try await uploadcare.videoConversionJobStatus(token: 1201016744)
print(job.statusString)
- lang: Kotlin
label: Kotlin
source: |
import com.uploadcare.android.library.api.UploadcareClient
val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")
val status = uploadcare.getVideoConversionStatus(token = 1201016744)
Log.d("TAG", status.toString())
components:
securitySchemes:
apiKeyAuth:
type: apiKey
in: header
name: Authorization
description: |
Every request made to `https://api.uploadcare.com/` MUST be signed. HTTPS SHOULD be used with any authorization scheme.
Requests MUST contain the `Authorization` header defining `auth-scheme` and `auth-param`: `Authorization: auth-scheme auth-param`.
Every request MUST contain the `Accept` header identifying the REST API version: `Accept: application/vnd.uploadcare-v0.7+json`.
There are two available authorization schemes:
* For production: `Uploadcare`, a scheme where a `signature`, not your Secret API Key MUST be specified. Signatures SHOULD be generated on backend.
* For quick tests: `Uploadcare.Simple`, a simple scheme where your [Secret API Key](https://app.uploadcare.com/projects/-/api-keys/) MUST be specified in every request's `auth-param`.
Uploadcare:
type: apiKey
in: header
name: Uploadcare
description: |
With the `Uploadcare` authentication method:
* `auth-param` is a `public_key:signature` pair, where your `secret_key` is used to derive `signature` but is _not included in every request_ itself.
* You MUST also provide the `Date` header in [RFC2822](https://datatracker.ietf.org/doc/html/rfc2822#section-3.3) format with the time zone set to `GMT` (see the example below).
* The date you provide MUST NOT exceed the 15-minute offset from the server time of the API endpoint.
```http
Accept: application/vnd.uploadcare-v0.7+json
Date: Fri, 30 Sep 2016 11:10:54 GMT
Authorization: Uploadcare public_key:6ff75027649aadd4dc98c1f784444445d1e6ed82
```
The `signature` part of the `Uploadcare` authentication method `auth-param` MUST be constructed from the following components:
* Request type (`POST`, `GET`, `HEAD`, `OPTIONS`)
* Hex md5 hash of the request body
* `Content-Type` header value
* `Date` header value
* URI including path and parameters
The parameters are then concatenated in textual order using LF: every value sits in a separate line. The result is then signed with [HMAC/SHA1](https://en.wikipedia.org/wiki/HMAC) using your project's `secret_key`.
Take a look at the Python example of deriving `signature`; the example request is made to get a list of files:
```py
import time
import hashlib
import hmac
from email import utils
# Specifying the project’s key
SECRET_KEY = 'YOUR_SECRET_KEY'
# Specifying request type
verb = 'GET'
# Calculate [md5](https://en.wikipedia.org/wiki/MD5) checksum for the request's HTTP body.
# Note: Taking into account that in our example, we are sending an HTTP GET request,
# and the request does not have anything in its HTTP body, we use an empty string as an input to the md5 hash function.
# If we were to send an HTTP POST request with, for example, JSON in the request's body,
# we would have to pass the JSON as the input to the md5 hash function.
content_md5 = hashlib.md5(b'').hexdigest()
# Content-Type header
content_type = 'application/json'
# Current time, e.g. 1541423681
timestamp = int(time.time())
# Date header ('Mon, 05 Nov 2018 13:14:41 GMT')
date_header = utils.formatdate(timestamp, usegmt=True)
# The request URI
uri = '/files/?limit=1&stored=true'
# Forming the final string: concatenating
sign_string = '\n'.join([verb, content_md5, content_type, date_header, uri])
# Calculating the signature,
# the result may look like this: "3cbc4d2cf91f80c1ba162b926f8a975e8bec7995"
signature = hmac.new(SECRET_KEY.encode(), sign_string.encode(), hashlib.sha1).hexdigest()
```
Once `signature` is derived, it SHOULD be implemented into the request body:
```bash
curl \
-H 'Content-Type: application/json' \
-H 'Accept: application/vnd.uploadcare-v0.7+json' \
-H 'Date: Mon, 05 Nov 2018 13:14:41 GMT' \
-H 'Authorization: Uploadcare YOUR_PUBLIC_KEY:SIGNATURE' \
'https://api.uploadcare.com/files/?limit=1&stored=true'
```
Uploadcare.Simple:
type: apiKey
in: header
name: Uploadcare.Simple
description: |
Note: We DO NOT recommend using this authentication method in production.
With the `Uploadcare.Simple` authentication method, `auth-param` is your `public_key:secret_key` pair. Note that in this scheme, your Uploadcare project `secret_key` is _included in every request as plain text_.
```http
Accept: application/vnd.uploadcare-v0.7+json
Authorization: Uploadcare.Simple public_key:secret_key
```
responses:
invalidAcceptHeader:
description: Invalid version header `Accept` for this endpoint.
content:
application/json:
schema:
type: object
properties:
detail:
type: string
example: Incorrect Accept header provided. Make sure to specify API version. Refer to REST API docs for details.
default: Incorrect Accept header provided. Make sure to specify API version. Refer to REST API docs for details.
authorizationProblemsResponse:
description: Authorization errors.
content:
application/json:
schema:
type: object
properties:
detail:
type: string
enum:
- Incorrect authentication credentials.
- Public key {public_key} not found.
- Secret key not found.
- Invalid signature. Please check your Secret key.
example: Incorrect authentication credentials.
simpleAuthHTTPForbiddenResponse:
description: Simple authentication over HTTP is forbidden. Please, use HTTPS or signed requests instead.
content:
application/json:
schema:
$ref: '#/components/schemas/simpleAuthHTTPForbidden'
requestWasThrottledError:
description: Request was throttled.
headers:
Retry-After:
description: Number of seconds to wait before the next request.
schema:
type: integer
example: 10
content:
application/json:
schema:
type: object
properties:
detail:
type: string
example: Request was throttled. Expected available in 10 seconds.
executeAddonResponse:
description: Add-On execution response.
content:
application/json:
schema:
type: object
properties:
request_id:
type: string
format: uuid
description: Request ID.
example: 8db3c8b4-2dea-4146-bcdb-63387e2b33c1
executeAddonConcurrentCallResponse:
description: Add-On concurrent call attempt.
content:
application/json:
schema:
type: object
properties:
detail:
type: string
example: Concurrent call attempted
default: Concurrent call attempted
addonExecutionStatusResponse:
description: Add-On execution status response.
content:
application/json:
schema:
type: object
properties:
status:
type: string
enum:
- in_progress
- error
- done
- unknown
description: |-
Defines the status of an Add-On execution.
In most cases, once the status changes to `done`, [Application Data](#operation/fileInfo) of the file that had been specified as a `appdata`, will contain the result of the execution.
fileMetadataResponse:
description: File metadata in JSON.
content:
application/json:
schema:
type: object
example:
subsystem: uploader
pet: cat
paginatedFilesResponse:
description: A list of files, paginated.
content:
application/json:
schema:
type: object
properties:
next:
type: string
format: uri
description: Next page URL.
nullable: true
example: https://api.uploadcare.com/files/?from=2018-11-27T01%3A00%3A24.296613%2B00%3A00&limit=3&offset=0
previous:
type: string
format: uri
description: Previous page URL.
nullable: true
example: https://api.uploadcare.com/files/?limit=3&to=2018-11-27T01%3A00%3A36.436838%2B00%3A00&offset=0
total:
type: integer
minimum: 0
description: Total number of the files of the queried type. The queried type depends on the stored and removed query parameters.
example: 26
totals:
type: object
properties:
removed:
type: integer
minimum: 0
description: Total number of the files that are marked as removed.
default: 0
example: 0
stored:
type: integer
minimum: 0
description: Total number of the files that are marked as stored.
default: 0
example: 25
unstored:
type: integer
minimum: 0
description: Total number of the files that are not marked as stored.
default: 0
example: 1
required:
- removed
- stored
- unstored
per_page:
type: integer
description: Number of the files per page.
example: 100
results:
type: array
items:
$ref: '#/components/schemas/file'
examples:
With App Data:
$ref: '#/components/examples/file_list_w_appdata'
Without App Data:
$ref: '#/components/examples/file_list'
paginatedGroupsResponse:
description: A list of groups, paginated.
content:
application/json:
schema:
type: object
properties:
next:
type: string
format: uri
description: Next page URL.
nullable: true
example: https://api.uploadcare.com/groups/?limit=3&from=2018-11-27T01%3A00%3A24.296613%2B00%3A00&offset=0
previous:
type: string
format: uri
description: Previous page URL.
nullable: true
example: https://api.uploadcare.com/groups/?limit=3&to=2018-11-27T01%3A00%3A36.436838%2B00%3A00&offset=0
total:
type: integer
minimum: 0
description: Total number of groups in the project.
example: 26
per_page:
type: integer
description: Number of groups per page.
example: 100
results:
type: array
items:
$ref: '#/components/schemas/group'
examples:
List:
$ref: '#/components/examples/group_list'
filesStoreUUIDSError:
description: File UUIDs list validation errors.
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/simpleAuthHTTPForbidden'
- type: object
description: File UUIDs list validation errors.
properties:
detail:
type: string
enum:
- Expected list of UUIDs
- List of UUIDs can not be empty
- Maximum UUIDs per request is exceeded. The limit is 100
example: Expected list of UUIDs
fileNotFoundError:
description: File not found.
content:
application/json:
schema:
type: object
properties:
detail:
type: string
description: Not found.
example: Not found.
filesStorageResponse:
description: OK. See `problems` and `result` fields in the response. In case a file list provided in a request holds invalid UUIDs, they'll be included in the `problems` structure. Invalid UUIDs can be incomplete, associated with files that no longer exist, etc.
content:
application/json:
schema:
type: object
properties:
status:
type: string
example: ok
problems:
type: object
description: Dictionary of passed files UUIDs and problems associated with these UUIDs.
example:
21975c81-7f57-4c7a-aef9-acfe28779f78: Missing in the project
4j334o01-8bs3: Invalid
result:
description: List of file objects that have been stored/deleted.
type: array
items:
$ref: '#/components/schemas/file'
fileCopyErrors:
description: Possible errors for file copy endpoint.
content:
application/json:
schema:
type: object
properties:
detail:
type: string
enum:
- Bad `source` parameter. Use UUID or CDN URL.
- '`source` parameter is required.'
- Project has no storage with provided name.
- '`store` parameter should be `true` or `false`.'
- 'Invalid pattern provided: `pattern_value`'
- 'Invalid pattern provided: Invalid character in a pattern.'
- File is not ready yet.
- Copying of large files is not supported at the moment.
- Not allowed on your current plan.
example: File is not ready yet.
groupNotFound:
description: Group with `uuid` not found.
content:
application/json:
schema:
type: object
properties:
detail:
type: string
description: Group not found.
example: Not found.
documentJobSubmitResponse:
description: Success.
content:
application/json:
schema:
type: object
properties:
problems:
type: object
description: Dictionary of problems related to your processing job, if any. A key is the `path` you requested.
additionalProperties:
type: string
format: uuid
result:
type: array
description: Result for each requested path, in case of no errors for that path.
items:
type: object
properties:
original_source:
type: string
description: Source file identifier including a target format, if present.
uuid:
type: string
description: A UUID of your converted document.
format: uuid
token:
type: integer
description: A conversion job token that can be used to get a job status.
example:
problems:
8ddbbb48-0927-4df7-afac-c6031668b01b: Bad path "8ddbbb48-0927-4df7-afac-c6031668b01b". Use UUID or CDN URL
result:
- original_source: https://cdn.uploadcare.com/5ffa2545-ea40-4e71-a9e4-3a8e49b7b737/document/-/format/jpg/-/page/1/
token: 445630631
uuid: d52d7136-a2e5-4338-9f45-affbf83b857d
- original_source: 88a51210-bd69-4411-bc72-a9952d9512cd/document/-/format/pdf/
token: 445630637
uuid: 28843a09-dd3d-4b8a-ad4f-8aa5f8f60ff2
documentJobStatusResponse:
description: Success.
content:
application/json:
schema:
type: object
properties:
status:
type: string
description: 'Conversion job status, can have one of the following values: - `pending` — a source file is being prepared for conversion. - `processing` — conversion is in progress. - `finished` — the conversion is finished. - `failed` — failed to convert the source, see `error` for details. - `canceled` — the conversion was canceled.'
enum:
- pending
- processing
- finished
- failed
- cancelled
error:
type: string
nullable: true
description: Holds a conversion error if your file can't be handled.
result:
type: object
description: Repeats the contents of your processing output.
properties:
uuid:
type: string
format: uuid
description: A UUID of a converted target file.
example:
status: processing
error: null
result:
uuid: 500196bc-9da5-4aaf-8f3e-70a4ce86edae
documentInfoResponse:
description: Success.
content:
application/json:
schema:
type: object
properties:
error:
type: string
nullable: true
description: Holds an error if your document can't be handled.
format:
type: object
description: Document format details.
properties:
name:
type: string
description: A detected document format.
conversion_formats:
type: array
description: The conversions that are supported for the document.
items:
type: object
properties:
name:
type: string
description: Supported target document format.
converted_groups:
type: object
description: Information about already converted groups.
properties:
'{conversion_format}':
type: string
description: Converted group UUID.
example:
error: null
format:
name: txt
conversion_formats:
- name: epub
- name: pdf
converted_groups:
pdf: 49732da8-1530-470c-8743-998c4c634718~5
videoJobStatusResponse:
description: Success.
content:
application/json:
schema:
type: object
properties:
status:
type: string
description: 'Processing job status, can have one of the following values: - `pending` — video file is being prepared for conversion. - `processing` — video file processing is in progress. - `finished` — the processing is finished. - `failed` — we failed to process the video, see `error` for details. - `canceled` — video processing was canceled.'
enum:
- pending
- processing
- finished
- failed
- cancelled
error:
type: string
nullable: true
description: Holds a processing error if we failed to handle your video.
result:
type: object
description: Repeats the contents of your processing output.
properties:
uuid:
type: string
format: uuid
description: A UUID of your processed video file.
thumbnails_group_uuid:
type: string
format: uuid
description: A UUID of a file group with thumbnails for an output video, based on the `thumbs` operation parameters.
example:
status: processing
error: null
result:
thumbnails_group_uuid: 575ed4e8-f4e8-4c14-a58b-1527b6d9ee46~1
uuid: 500196bc-9da5-4aaf-8f3e-70a4ce86edae
videoJobSubmitResponse:
description: Success.
content:
application/json:
schema:
type: object
properties:
problems:
type: object
description: Dictionary of problems related to your processing job, if any. Key is the `path` you requested.
additionalProperties:
type: string
format: uuid
result:
type: array
description: Result for each requested path, in case of no errors for that path.
items:
type: object
properties:
original_source:
type: string
description: Input file identifier including operations, if present.
uuid:
type: string
description: A UUID of your processed video file.
format: uuid
token:
type: integer
description: A processing job token that can be used to get a job status.
thumbnails_group_uuid:
description: UUID of a file group with thumbnails for an output video, based on the `thumbs` operation parameters.
type: string
format: uuid
example:
problems:
13cd56e2-f6d7-4c66-ab1b-ffd13cd6646d: Bad path "13cd56e2-f6d7-4c66-ab1b-ffd13cd6646d". Use UUID or CDN URL
result:
- original_source: d52d7136-a2e5-4338-9f45-affbf83b857d/video/-/format/ogg/-/quality/best/
token: 445630631
thumbnails_group_uuid: 575ed4e8-f4e8-4c14-a58b-1527b6d9ee46~1
uuid: d52d7136-a2e5-4338-9f45-affbf83b857d
- original_source: 500196bc-9da5-4aaf-8f3e-70a4ce86edae/video/
token: 445630637
thumbnails_group_uuid: be3b4d5e-179d-460e-8a5d-69112ac86cbb~1
uuid: 28843a09-dd3d-4b8a-ad4f-8aa5f8f60ff2
remoteCopyResponse:
description: Destination file with that name already exists. Check the `pattern` parameter.
content:
application/json:
schema:
$ref: '#/components/schemas/copiedFileURL'
remoteCopyResponse201:
description: The file was copied successfully. HTTP response contains `result` field with the URL of the file on the remote storage.
content:
application/json:
schema:
$ref: '#/components/schemas/copiedFileURL'
schemas:
addonExecutionStatus:
type: object
properties:
status:
type: string
enum:
- in_progress
- error
- done
- unknown
description: |-
Defines the status of an Add-On execution.
In most cases, once the status changes to `done`, [Application Data](#operation/fileInfo) of the file that had been specified as a `appdata`, will contain the result of the execution.
webhookFilePayload:
type: object
required:
- initiator
- hook
- data
- file
properties:
initiator:
$ref: '#/components/schemas/webhookInitiator'
hook:
$ref: '#/components/schemas/webhookPublicInfo'
data:
$ref: '#/components/schemas/file'
file:
description: File CDN URL.
type: string
format: uri
webhookFileInfoUpdatedPayload:
type: object
required:
- initiator
- hook
- data
- file
- previous_values
properties:
initiator:
$ref: '#/components/schemas/webhookInitiator'
hook:
$ref: '#/components/schemas/webhookPublicInfo'
data:
$ref: '#/components/schemas/file'
file:
description: File CDN URL.
type: string
format: uri
previous_values:
type: object
description: Object containing the values of the updated file data attributes and their values prior to the event.
properties:
appdata:
$ref: '#/components/schemas/applicationDataObject'
metadata:
$ref: '#/components/schemas/metadata'
fileCopy:
type: object
required:
- datetime_removed
- datetime_stored
- datetime_uploaded
- is_image
- is_ready
- mime_type
- original_file_url
- original_filename
- size
- url
- uuid
- variations
- content_info
- metadata
properties:
datetime_removed:
type: string
format: date-time
nullable: true
description: Date and time when a file was removed, if any.
datetime_stored:
type: string
format: date-time
nullable: true
description: Date and time of the last store request, if any.
datetime_uploaded:
type: string
format: date-time
description: Date and time when a file was uploaded.
is_image:
type: boolean
description: Is file is image.
example: true
is_ready:
type: boolean
description: Is file is ready to be used after upload.
example: true
mime_type:
type: string
description: File MIME-type. In the immediate response after starting a local copy, it can be `application/octet-stream` until the copy completes.
example: image/jpeg
original_file_url:
type: string
format: uri
description: Publicly available file CDN URL. Available if a file is not deleted.
nullable: true
original_filename:
type: string
description: Original file name taken from uploaded file.
example: EU_4.jpg
size:
type: integer
enum:
- 0
description: File size in bytes. In the immediate response after starting a local copy, it can be `0` until the copy completes.
example: 0
url:
type: string
format: uri
description: API resource URL for a particular file.
uuid:
type: string
format: uuid
description: File UUID.
example: 575ed4e8-f4e8-4c14-a58b-1527b6d9ee46
variations:
enum:
- null
content_info:
enum:
- null
metadata:
$ref: '#/components/schemas/metadata'
file:
type: object
required:
- datetime_removed
- datetime_stored
- datetime_uploaded
- is_image
- is_ready
- mime_type
- original_file_url
- original_filename
- size
- url
- uuid
- variations
- content_info
- metadata
properties:
datetime_removed:
type: string
format: date-time
nullable: true
description: Date and time when a file was removed, if any.
datetime_stored:
type: string
format: date-time
nullable: true
description: Date and time of the last store request, if any.
datetime_uploaded:
type: string
format: date-time
description: Date and time when a file was uploaded.
is_image:
type: boolean
description: Is file is image.
example: true
is_ready:
type: boolean
description: Is file is ready to be used after upload.
example: true
mime_type:
type: string
description: File MIME-type.
example: image/jpeg
original_file_url:
type: string
format: uri
description: Publicly available file CDN URL. Available if a file is not deleted.
nullable: true
example: https://ucarecdn.com/e575ed4e8-f4e8-4c14-a58b-1527b6d9ee46/EU_4.jpg
original_filename:
type: string
description: Original file name taken from uploaded file.
example: EU_4.jpg
size:
type: integer
description: File size in bytes.
example: 145212
url:
type: string
format: uri
description: API resource URL for a particular file.
example: https://api.uploadcare.com/files/e10ce759-42c3-4185-bae5-e22a9143d68f/
uuid:
type: string
format: uuid
description: File UUID.
example: 575ed4e8-f4e8-4c14-a58b-1527b6d9ee46
appdata:
$ref: '#/components/schemas/applicationDataObject'
variations:
type: object
nullable: true
description: 'Dictionary of other files that were created using this file as a source. It''s used for video processing and document conversion jobs. E.g., `: `.'
content_info:
$ref: '#/components/schemas/contentInfo'
metadata:
$ref: '#/components/schemas/metadata'
example:
datetime_removed: null
datetime_stored: '2018-11-26T12:49:10.477888Z'
datetime_uploaded: '2018-11-26T12:49:09.945335Z'
variations: null
is_image: true
is_ready: true
mime_type: image/jpeg
original_file_url: https://ucarecdn.com/22240276-2f06-41f8-9411-755c8ce926ed/pineapple.jpg
original_filename: pineapple.jpg
size: 642
url: https://api.uploadcare.com/files/22240276-2f06-41f8-9411-755c8ce926ed/
uuid: 22240276-2f06-41f8-9411-755c8ce926ed
content_info:
mime:
mime: image/jpeg
type: image
subtype: jpeg
image:
format: JPEG
width: 500
height: 500
sequence: false
color_mode: RGB
orientation: 6
geo_location:
latitude: 55.62013611111111
longitude: 37.66299166666666
datetime_original: '2018-08-20T08:59:50'
dpi:
- 72
- 72
metadata:
subsystem: uploader
pet: cat
appdata:
aws_rekognition_detect_labels:
data:
LabelModelVersion: '2.0'
Labels:
- Confidence: 93.41645812988281
Instances: []
Name: Home Decor
Parents: []
- Confidence: 70.75951385498047
Instances: []
Name: Linen
Parents:
- Name: Home Decor
- Confidence: 64.7123794555664
Instances: []
Name: Sunlight
Parents: []
- Confidence: 56.264793395996094
Instances: []
Name: Flare
Parents:
- Name: Light
- Confidence: 50.47153854370117
Instances: []
Name: Tree
Parents:
- Name: Plant
version: '2016-06-27'
datetime_created: '2021-09-21T11:25:31.259763Z'
datetime_updated: '2021-09-21T11:27:33.359763Z'
aws_rekognition_detect_moderation_labels:
data:
ModerationModelVersion: '6.0'
ModerationLabels:
- Confidence: 93.41645812988281
Name: Weapons
ParentName: Violence
version: '2016-06-27'
datetime_created: '2023-02-21T11:25:31.259763Z'
datetime_updated: '2023-02-21T11:27:33.359763Z'
remove_bg:
data:
foreground_type: person
version: '1.0'
datetime_created: '2021-07-25T12:24:33.159663Z'
datetime_updated: '2021-07-25T12:24:33.159663Z'
uc_clamav_virus_scan:
data:
infected: true
infected_with: Win.Test.EICAR_HDB-1
version: 0.104.2
datetime_created: '2021-09-21T11:24:33.159663Z'
datetime_updated: '2021-09-21T11:24:33.159663Z'
metadata:
type: object
nullable: true
description: Arbitrary metadata associated with a file.
metadataItemValue:
type: string
minLength: 1
maxLength: 512
description: Value of metadata key.
example: uploader
contentInfo:
type: object
nullable: true
description: Information about file content.
properties:
mime:
type: object
description: MIME type.
required:
- mime
- type
- subtype
properties:
mime:
type: string
description: Full MIME type.
example: image/jpeg
type:
type: string
description: Type of MIME type.
example: image
subtype:
type: string
description: Subtype of MIME type.
example: jpeg
image:
$ref: '#/components/schemas/imageInfo'
video:
$ref: '#/components/schemas/videoInfo'
imageInfo:
type: object
description: Image metadata.
required:
- color_mode
- orientation
- format
- height
- width
- geo_location
- datetime_original
- dpi
- sequence
properties:
color_mode:
type: string
description: Image color mode.
enum:
- RGB
- RGBA
- RGBa
- RGBX
- L
- LA
- La
- P
- PA
- CMYK
- YCbCr
- HSV
- LAB
example: RGBA
orientation:
type: integer
description: Image orientation from EXIF.
nullable: true
minimum: 0
maximum: 8
example: 6
format:
type: string
description: Image format.
example: JPEG
sequence:
type: boolean
description: Set to true if a file contains a sequence of images (GIF for example).
example: false
height:
type: integer
description: Image height in pixels.
example: 2352
width:
type: integer
description: Image width in pixels.
example: 2935
geo_location:
description: Geo-location of image from EXIF.
type: object
nullable: true
required:
- latitude
- longitude
properties:
latitude:
type: number
description: Location latitude.
example: -1.1884555555555556
longitude:
type: number
description: Location longitude.
example: 52.66996666666667
datetime_original:
type: string
description: Image date and time from EXIF. Please be aware that this data is not always formatted and displayed exactly as it appears in the EXIF.
nullable: true
format: date-time
example: '2018-09-13T16:23:40'
dpi:
type: array
description: Image DPI for two dimensions.
nullable: true
items:
type: number
example: 72
minItems: 2
maxItems: 2
example:
- 72
- 72
videoInfo:
type: object
description: Video metadata.
required:
- duration
- format
- bitrate
- audio
- video
properties:
duration:
type: integer
description: Video file's duration in milliseconds.
nullable: true
example: 261827
format:
type: string
description: Video file's format.
example: mp4
bitrate:
type: integer
description: Video file's bitrate.
nullable: true
example: 393
audio:
type: array
items:
type: object
description: Audio stream's metadata.
required:
- bitrate
- codec
- sample_rate
- channels
properties:
bitrate:
type: integer
description: Audio stream's bitrate.
nullable: true
example: 78
codec:
type: string
description: Audio stream's codec.
nullable: true
example: aac
sample_rate:
type: integer
description: Audio stream's sample rate.
nullable: true
example: 44100
channels:
type: integer
description: Audio stream's number of channels.
nullable: true
example: 2
video:
type: array
items:
type: object
description: Video stream's metadata.
required:
- height
- width
- frame_rate
- bitrate
- codec
properties:
height:
type: integer
description: Video stream's image height.
example: 360
width:
type: integer
description: Video stream's image width.
example: 640
frame_rate:
type: number
description: Video stream's frame rate.
example: 30
bitrate:
type: integer
description: Video stream's bitrate.
nullable: true
example: 315
codec:
type: string
description: Video stream's codec.
nullable: true
example: h264
copiedFileURL:
type: object
properties:
type:
type: string
default: url
example: url
result:
type: string
format: url
description: URL with an s3 scheme. Your bucket name is put as a host, and an s3 object path follows.
example: s3://mybucket/03ccf9ab-f266-43fb-973d-a6529c55c2ae/image.png
group:
type: object
properties:
id:
type: string
description: Group's identifier.
datetime_created:
type: string
format: date-time
description: ISO-8601 date and time when the group was created.
files_count:
type: integer
minimum: 1
description: Number of the files in the group.
cdn_url:
type: string
format: uri
description: Group's CDN URL.
url:
type: string
format: uri
description: Group's API resource URL.
example:
id: dd43982b-5447-44b2-86f6-1c3b52afa0ff~1
datetime_created: '2018-11-27T14:14:37.583654Z'
files_count: 1
cdn_url: https://ucarecdn.com/dd43982b-5447-44b2-86f6-1c3b52afa0ff~1/
url: https://api.uploadcare.com/groups/dd43982b-5447-44b2-86f6-1c3b52afa0ff~1/
groupWithFiles:
allOf:
- $ref: '#/components/schemas/group'
- type: object
properties:
files:
type: array
description: |
The list of files in the group. An array may contain null values if a file has been removed.
nullable: true
allOf:
- $ref: '#/components/schemas/file'
- type: object
properties:
default_effects:
type: string
format: uri
description: The field contains a set of processing operations applied to the file when the group was created. This set is applied by default when the file is reffered via a group CDN URL and `/nth/N/` operator.
example: resize/x800/
example:
id: dd43982b-5447-44b2-86f6-1c3b52afa0ff~1
datetime_created: '2018-11-27T14:14:37.583654Z'
files_count: 1
cdn_url: https://ucarecdn.com/dd43982b-5447-44b2-86f6-1c3b52afa0ff~1/
url: https://api.uploadcare.com/groups/dd43982b-5447-44b2-86f6-1c3b52afa0ff~1/
files:
- datetime_removed: null
datetime_stored: '2018-11-26T12:49:10.477888Z'
datetime_uploaded: '2018-11-26T12:49:09.945335Z'
variations: null
is_image: true
is_ready: true
mime_type: image/jpeg
original_file_url: https://ucarecdn.com/22240276-2f06-41f8-9411-755c8ce926ed/pineapple.jpg
original_filename: pineapple.jpg
size: 642
url: https://api.uploadcare.com/files/22240276-2f06-41f8-9411-755c8ce926ed/
uuid: 22240276-2f06-41f8-9411-755c8ce926ed
content_info:
mime:
mime: image/jpeg
type: image
subtype: jpeg
image:
format: JPEG
width: 500
height: 500
sequence: false
color_mode: RGB
orientation: 6
geo_location:
latitude: 55.62013611111111
longitude: 37.66299166666666
datetime_original: '2018-08-20T08:59:50'
dpi:
- 72
- 72
metadata:
subsystem: uploader
pet: cat
default_effects: resize/x800/
project:
type: object
properties:
collaborators:
type: array
nullable: true
items:
type: object
properties:
email:
type: string
format: email
description: Collaborator email.
name:
type: string
description: Collaborator name.
name:
type: string
description: Project login name.
pub_key:
type: string
description: Project public key.
autostore_enabled:
type: boolean
example: true
example:
collaborators: []
name: demo
pub_key: YOUR_PUBLIC_KEY
autostore_enabled: true
webhook_id:
type: integer
description: Webhook's ID.
example: 1234
webhook_project:
type: integer
description: Project ID the webhook belongs to.
example: 39123
webhook_project_pubkey:
type: string
description: Public project key the webhook belongs to.
example: 2d199fbf3896699a2639
webhook_created:
type: string
format: date-time
description: date-time when a webhook was created.
example: '2018-11-26T12:49:10.477888Z'
webhook_updated:
type: string
format: date-time
description: date-time when a webhook was updated.
example: '2018-11-26T12:49:10.477888Z'
webhook_target:
type: string
format: uri
maxLength: 255
description: A URL that is triggered by an event, for example, a file upload. A target URL MUST be unique for each `project` — `event type` combination.
example: http://example.com/hooks/receiver
webhook_event:
type: string
description: An event you subscribe to.
enum:
- file.uploaded
- file.infected
- file.stored
- file.deleted
- file.info_updated
example: file.uploaded
webhook_is_active:
type: boolean
description: Marks a subscription as either active or not, defaults to `true`, otherwise `false`.
default: true
example: false
webhook_signing_secret:
type: string
format: password
maxLength: 32
example: 7kMVZivndx0ErgvhRKAr
description: |
Optional [HMAC/SHA-256](https://en.wikipedia.org/wiki/HMAC) secret that, if set, will be used to
calculate signatures for the webhook payloads sent to the `target_url`.
Calculated signature will be sent to the `target_url` as a value of the `X-Uc-Signature` HTTP
header. The header will have the following format: `X-Uc-Signature: v1=`.
See [Secure Webhooks](https://uploadcare.com/docs/webhooks/#signed-webhooks) for details.
webhook_version:
type: string
description: Webhook payload's version.
enum:
- '0.7'
example: '0.7'
webhook_version_of_request:
type: string
description: Webhook payload's version.
enum:
- '0.7'
example: '0.7'
default: '0.7'
webhook_version_of_list_response:
type: string
description: Webhook payload's version.
enum:
- ''
- '0.5'
- '0.6'
- '0.7'
example: '0.7'
webhook:
description: Webhook.
type: object
properties:
id:
$ref: '#/components/schemas/webhook_id'
project:
$ref: '#/components/schemas/webhook_project'
created:
$ref: '#/components/schemas/webhook_created'
updated:
$ref: '#/components/schemas/webhook_updated'
event:
$ref: '#/components/schemas/webhook_event'
target_url:
$ref: '#/components/schemas/webhook_target'
is_active:
$ref: '#/components/schemas/webhook_is_active'
version:
$ref: '#/components/schemas/webhook_version'
signing_secret:
$ref: '#/components/schemas/webhook_signing_secret'
example:
id: 1
project: 13
created: '2016-04-27T11:49:54.948615Z'
updated: '2016-04-27T12:04:57.819933Z'
event: file.infected
target_url: http://example.com/hooks/receiver
is_active: true
signing_secret: 7kMVZivndx0ErgvhRKAr
version: '0.7'
webhook_of_list_response:
description: Webhook.
type: object
properties:
id:
$ref: '#/components/schemas/webhook_id'
project:
$ref: '#/components/schemas/webhook_project'
created:
$ref: '#/components/schemas/webhook_created'
updated:
$ref: '#/components/schemas/webhook_updated'
event:
$ref: '#/components/schemas/webhook_event'
target_url:
$ref: '#/components/schemas/webhook_target'
is_active:
$ref: '#/components/schemas/webhook_is_active'
version:
$ref: '#/components/schemas/webhook_version_of_list_response'
signing_secret:
$ref: '#/components/schemas/webhook_signing_secret'
example:
id: 1
project: 13
created: '2016-04-27T11:49:54.948615Z'
updated: '2016-04-27T12:04:57.819933Z'
event: file.infected
target_url: http://example.com/hooks/receiver
is_active: true
signing_secret: 7kMVZivndx0ErgvhRKAr
version: '0.7'
webhookInitiator:
description: Webhook event initiator.
type: object
required:
- type
- detail
properties:
type:
type: string
description: Initiator type name.
enum:
- api
- system
- addon
detail:
type: object
required:
- request_id
- addon_name
properties:
request_id:
type: string
format: uuid
description: Request ID.
example: 972654bd-a2ad-485a-bd27-c86126c1ed8c
nullable: true
addon_name:
type: string
description: Add-On name.
enum:
- aws_rekognition_detect_labels
- aws_rekognition_detect_moderation_labels
- uc_clamav_virus_scan
- remove_bg
- zamzar_convert_document
- zencoder_convert_video
example: aws_rekognition_detect_labels
nullable: true
source_file_uuid:
type: string
format: uuid
description: Source file UUID if the current is derivative.
example: 972654bd-a2ad-485a-bd27-c86126c1ed8c
webhookPublicInfo:
description: Public Webhook information (does not include secret data like `signing_secret`)
type: object
required:
- id
- project_id
- created_at
- updated_at
- event
- target
- is_active
- version
properties:
id:
$ref: '#/components/schemas/webhook_id'
project:
$ref: '#/components/schemas/webhook_project'
project_pub_key:
$ref: '#/components/schemas/webhook_project_pubkey'
created_at:
$ref: '#/components/schemas/webhook_created'
updated_at:
$ref: '#/components/schemas/webhook_updated'
event:
$ref: '#/components/schemas/webhook_event'
target:
$ref: '#/components/schemas/webhook_target'
is_active:
$ref: '#/components/schemas/webhook_is_active'
version:
$ref: '#/components/schemas/webhook_version'
example:
id: 1
project_id: 13
project_pub_key: 2d199fbf3896699a2639
created_at: '2016-04-27T11:49:54.948615Z'
updated_at: '2016-04-27T12:04:57.819933Z'
event: file.uploaded
target: http://example.com/hooks/receiver
is_active: true
version: '0.7'
documentJobSubmitParameters:
type: object
properties:
paths:
description: An array of UUIDs of your source documents to convert together with the specified target format (see [documentation](https://uploadcare.com/docs/transformations/file-conversion/)).
type: array
items:
type: string
example:
- https://cdn.uploadcare.com/5ffa2545-ea40-4e71-a9e4-3a8e49b7b737/document/-/format/jpg/-/page/1/
- 18574696-50b5-4d6a-84c2-48ffc3de1d40/document/-/format/jpg/-/dpi/150/
- 18574696-50b5-4d6a-84c2-48ffc3de1d40/document/-/format/jpg/-/quality/80/
- 18574696-50b5-4d6a-84c2-48ffc3de1d40/document/-/format/jpg/-/dpi/200/-/quality/90/
- 88a51210-bd69-4411-bc72-a9952d9512cd/document/-/format/pdf/
- 8ddbbb48-0927-4df7-afac-c6031668b01b/document/
store:
type: string
description: |
When `store` is set to `"0"`, the converted files will only be available for 24 hours. `"1"` makes converted files available permanently. If the parameter is omitted, it checks the `Auto file storing` setting of your Uploadcare project identified by the `public_key` provided in the `auth-param`.
enum:
- '0'
- 'false'
- '1'
- 'true'
example: '1'
save_in_group:
type: string
default: '0'
description: |
When `save_in_group` is set to `"1"`, multi-page documents additionally will be saved as a file group.
enum:
- '0'
- 'false'
- '1'
- 'true'
example: '1'
example:
paths:
- https://cdn.uploadcare.com/5ffa2545-ea40-4e71-a9e4-3a8e49b7b737/document/-/format/jpg/-/page/1/
- 18574696-50b5-4d6a-84c2-48ffc3de1d40/document/-/format/jpg/-/dpi/150/
- 18574696-50b5-4d6a-84c2-48ffc3de1d40/document/-/format/jpg/-/quality/80/
- 18574696-50b5-4d6a-84c2-48ffc3de1d40/document/-/format/jpg/-/dpi/200/-/quality/90/
- 88a51210-bd69-4411-bc72-a9952d9512cd/document/-/format/pdf/
- 8ddbbb48-0927-4df7-afac-c6031668b01b/document/
store: 1
save_in_group: '1'
videoJobSubmitParameters:
type: object
properties:
paths:
description: An array of UUIDs of your video files to process together with a set of assigned operations (see [documentation](https://uploadcare.com/docs/transformations/video-encoding/)).
type: array
items:
type: string
example:
- https://cdn.uploadcare.com/5ffa2545-ea40-4e71-a9e4-3a8e49b7b737/video/-/format/webm/
- 88a51210-bd69-4411-bc72-a9952d9512cd/video/-/format/ogg/-/quality/best/
- 8ddbbb48-0927-4df7-afac-c6031668b01b/video/
store:
type: string
description: |
When `store` is set to `"0"`, the converted files will only be available for 24 hours. `"1"` makes converted files available permanently. If the parameter is omitted, it checks the `Auto file storing` setting of your Uploadcare project identified by the `public_key` provided in the `auth-param`.
enum:
- '0'
- 'false'
- '1'
- 'true'
example: '1'
example:
paths:
- d52d7136-a2e5-4338-9f45-affbf83b857d/video/
- d52d7136-a2e5-4338-9f45-affbf83b857d/video/-/format/ogg/-/quality/best/
- 28843a09-dd3d-4b8a-ad4f-8aa5f8f60ff2
store: '1'
cantUseDocsConversionError:
type: object
properties:
detail:
type: string
default: Document conversion feature is not available for this project.
example:
detail: Document conversion feature is not available for this project.
cantUseVideoConversionError:
type: object
properties:
detail:
type: string
default: Video conversion feature is not available for this project.
example:
detail: Video conversion feature is not available for this project.
cantUseWebhooksError:
type: object
properties:
detail:
type: string
default: You can't use webhooks
example:
detail: You can't use webhooks
jsonObjectParseError:
type: object
properties:
detail:
type: string
description: Expected JSON object.
example:
detail: Expected JSON object.
localCopyResponse:
type: object
properties:
type:
type: string
default: file
example: file
result:
$ref: '#/components/schemas/fileCopy'
applicationData:
type: object
properties:
version:
type: string
description: An application version.
datetime_created:
type: string
format: date-time
description: Date and time when an application data was created.
datetime_updated:
type: string
format: date-time
description: Date and time when an application data was updated.
data:
type: object
description: Dictionary with a result of an application execution result.
required:
- version
- datetime_created
- datetime_updated
- data
removeBg_v1_0:
allOf:
- $ref: '#/components/schemas/applicationData'
- type: object
properties:
version:
type: string
enum:
- '1.0'
data:
type: object
description: Dictionary with a result of an remove.bg information about an image.
properties:
foreground_type:
type: string
description: foreground classification type (present if type_level was set)
example:
value:
remove_bg:
data:
foreground_type: person
version: '1.0'
datetime_created: '2021-07-25T12:24:33.159663Z'
datetime_updated: '2021-07-25T12:24:33.159663Z'
awsRekognitionDetectLabels_v2016_06_27:
allOf:
- $ref: '#/components/schemas/applicationData'
- type: object
properties:
version:
type: string
enum:
- '2016-06-27'
data:
type: object
description: Dictionary with a result of an aws rekognition detect labels execution result.
properties:
LabelModelVersion:
type: string
Labels:
type: array
items:
type: object
properties:
Confidence:
type: number
Instances:
type: array
items:
type: object
properties:
BoundingBox:
type: object
properties:
Height:
type: number
Left:
type: number
Top:
type: number
Width:
type: number
Confidence:
type: number
Name:
type: string
Parents:
type: array
items:
type: object
properties:
Name:
type: string
required:
- Name
- Parents
- Instances
- Confidence
required:
- Labels
- LabelModelVersion
example:
value:
aws_rekognition_detect_labels:
data:
LabelModelVersion: '2.0'
Labels:
- Confidence: 93.41645812988281
Instances: []
Name: Home Decor
Parents: []
- Confidence: 70.75951385498047
Instances: []
Name: Linen
Parents:
- Name: Home Decor
- Confidence: 64.7123794555664
Instances: []
Name: Sunlight
Parents: []
- Confidence: 56.264793395996094
Instances: []
Name: Flare
Parents:
- Name: Light
- Confidence: 50.47153854370117
Instances: []
Name: Tree
Parents:
- Name: Plant
version: '2016-06-27'
datetime_created: '2021-09-21T11:25:31.259763Z'
datetime_updated: '2021-09-21T11:27:33.359763Z'
awsRekognitionDetectModerationLabels_v2016_06_27:
allOf:
- $ref: '#/components/schemas/applicationData'
- type: object
properties:
version:
type: string
enum:
- '2016-06-27'
data:
type: object
description: Dictionary with a result of an aws rekognition detect moderation labels execution result.
properties:
ModerationModelVersion:
type: string
ModerationLabels:
type: array
items:
type: object
properties:
Confidence:
type: number
Name:
type: string
ParentName:
type: string
required:
- Name
- ParentName
- Confidence
required:
- ModerationLabels
- ModerationModelVersion
example:
value:
aws_rekognition_detect_moderation_labels:
data:
ModerationModelVersion: '6.0'
ModerationLabels:
- Confidence: 93.41645812988281
Name: Weapons
ParentName: Violence
version: '2016-06-27'
datetime_created: '2023-02-21T11:25:31.259763Z'
datetime_updated: '2023-02-21T11:27:33.359763Z'
ucClamavVirusScan:
allOf:
- $ref: '#/components/schemas/applicationData'
- type: object
properties:
version:
type: string
enum:
- 0.104.2
- 0.104.3
- 0.105.0
- 0.105.1
data:
type: object
description: Dictionary with a result of ClamAV execution result.
properties:
infected:
type: boolean
infected_with:
type: string
required:
- infected
example:
value:
uc_clamav_virus_scan:
data:
infected: true
infected_with: Win.Test.EICAR_HDB-1
version: 0.104.2
datetime_created: '2021-09-21T11:24:33.159663Z'
datetime_updated: '2021-09-21T11:24:33.159663Z'
applicationDataObject:
type: object
nullable: true
description: Dictionary of application names and data associated with these applications.
properties:
aws_rekognition_detect_labels:
$ref: '#/components/schemas/awsRekognitionDetectLabels_v2016_06_27'
aws_rekognition_detect_moderation_labels:
$ref: '#/components/schemas/awsRekognitionDetectModerationLabels_v2016_06_27'
remove_bg:
$ref: '#/components/schemas/removeBg_v1_0'
uc_clamav_virus_scan:
$ref: '#/components/schemas/ucClamavVirusScan'
simpleAuthHTTPForbidden:
type: object
properties:
detail:
type: string
default: Simple authentication over HTTP is forbidden. Please, use HTTPS or signed requests instead.
example:
detail: Simple authentication over HTTP is forbidden. Please, use HTTPS or signed requests instead.
webhookTargetUrlError:
type: object
properties:
detail:
type: string
description: '`target_url` is missing.'
default: '`target_url` is missing.'
example:
detail: '`target_url` is missing.'
examples:
simpleAuthHTTPForbidden:
value:
detail: Simple authentication over HTTP is forbidden. Please, use HTTPS or signed requests instead.
webhookTargetUrlError:
value:
detail: '`target_url` is missing.'
cantUseDocsConversionError:
value:
detail: Document conversion feature is not available for this project.
cantUseVideoConversionError:
value:
detail: Video conversion feature is not available for this project.
cantUseWebhooksError:
value:
detail: You can't use webhooks
jsonObjectParseError:
value:
detail: Expected JSON object.
file_list_w_appdata:
value:
next: https://api.uploadcare.com/files/?limit=1&from=2018-11-27T01%3A00%3A43.001705%2B00%3A00&offset=0
previous: https://api.uploadcare.com/files/?limit=1&to=2018-11-27T01%3A00%3A36.436838%2B00%3A00&offset=0
total: 2484
totals:
removed: 0
stored: 2480
unstored: 4
per_page: 1
results:
- datetime_removed: null
datetime_stored: '2018-11-26T12:49:10.477888Z'
datetime_uploaded: '2018-11-26T12:49:09.945335Z'
variations: null
is_image: true
is_ready: true
mime_type: image/jpeg
original_file_url: https://ucarecdn.com/22240276-2f06-41f8-9411-755c8ce926ed/pineapple.jpg
original_filename: pineapple.jpg
size: 642
url: https://api.uploadcare.com/files/22240276-2f06-41f8-9411-755c8ce926ed/
uuid: 22240276-2f06-41f8-9411-755c8ce926ed
content_info:
mime:
mime: image/jpeg
type: image
subtype: jpeg
image:
format: JPEG
width: 500
height: 500
sequence: false
color_mode: RGB
orientation: 6
geo_location:
latitude: 55.62013611111111
longitude: 37.66299166666666
datetime_original: '2018-08-20T08:59:50'
dpi:
- 72
- 72
metadata:
subsystem: uploader
pet: cat
appdata:
uc_clamav_virus_scan:
data:
infected: true
infected_with: Win.Test.EICAR_HDB-1
version: 0.104.2
datetime_created: '2021-09-21T11:24:33.159663Z'
datetime_updated: '2021-09-21T11:24:33.159663Z'
file_list:
value:
next: https://api.uploadcare.com/files/?limit=1&from=2018-11-27T01%3A00%3A43.001705%2B00%3A00&offset=0
previous: https://api.uploadcare.com/files/?limit=1&to=2018-11-27T01%3A00%3A36.436838%2B00%3A00&offset=0
total: 2484
totals:
removed: 0
stored: 2480
unstored: 4
per_page: 1
results:
- datetime_removed: null
datetime_stored: '2021-09-21T11:24:33.159663Z'
datetime_uploaded: '2021-09-21T11:24:33.159663Z'
is_image: false
is_ready: true
mime_type: video/mp4
original_file_url: https://ucarecdn.com/7ed2aed0-0482-4c13-921b-0557b193edc2/16317390663260.mp4
original_filename: 16317390663260.mp4
size: 14479722
url: https://api.uploadcare.com/files/7ed2aed0-0482-4c13-921b-0557b193edc2/
uuid: 7ed2aed0-0482-4c13-921b-0557b193edc2
variations: null
content_info:
mime:
mime: video/mp4
type: video
subtype: mp4
video:
audio:
- codec: aac
bitrate: 129
channels: 2
sample_rate: 44100
video:
- codec: h264
width: 640
height: 480
bitrate: 433
frame_rate: 30
format: mp4
bitrate: 579
duration: 200044
metadata:
subsystem: tester
pet: dog
file_removed:
value:
datetime_removed: '2018-11-26T12:49:11.477888Z'
datetime_stored: null
datetime_uploaded: '2018-11-26T12:49:09.945335Z'
variations: null
is_image: true
is_ready: true
mime_type: image/jpeg
original_file_url: https://ucarecdn.com/22240276-2f06-41f8-9411-755c8ce926ed/pineapple.jpg
original_filename: pineapple.jpg
size: 642
url: https://api.uploadcare.com/files/22240276-2f06-41f8-9411-755c8ce926ed/
uuid: 22240276-2f06-41f8-9411-755c8ce926ed
content_info:
mime:
mime: image/jpeg
type: image
subtype: jpeg
image:
format: JPEG
width: 500
height: 500
sequence: false
color_mode: RGB
orientation: 6
geo_location:
latitude: 55.62013611111111
longitude: 37.66299166666666
datetime_original: '2018-08-20T08:59:50'
dpi:
- 72
- 72
metadata:
subsystem: uploader
pet: cat
appdata:
uc_clamav_virus_scan:
data:
infected: true
infected_with: Win.Test.EICAR_HDB-1
version: 0.104.2
datetime_created: '2021-09-21T11:24:33.159663Z'
datetime_updated: '2021-09-21T11:24:33.159663Z'
file:
value:
datetime_removed: null
datetime_stored: '2018-11-26T12:49:10.477888Z'
datetime_uploaded: '2018-11-26T12:49:09.945335Z'
variations: null
is_image: true
is_ready: true
mime_type: image/jpeg
original_file_url: https://ucarecdn.com/22240276-2f06-41f8-9411-755c8ce926ed/pineapple.jpg
original_filename: pineapple.jpg
size: 642
url: https://api.uploadcare.com/files/22240276-2f06-41f8-9411-755c8ce926ed/
uuid: 22240276-2f06-41f8-9411-755c8ce926ed
content_info:
mime:
mime: image/jpeg
type: image
subtype: jpeg
image:
format: JPEG
width: 500
height: 500
sequence: false
color_mode: RGB
orientation: 6
geo_location:
latitude: 55.62013611111111
longitude: 37.66299166666666
datetime_original: '2018-08-20T08:59:50'
dpi:
- 72
- 72
metadata:
subsystem: uploader
pet: cat
appdata:
aws_rekognition_detect_labels:
data:
LabelModelVersion: '2.0'
Labels:
- Confidence: 93.41645812988281
Instances: []
Name: Home Decor
Parents: []
- Confidence: 70.75951385498047
Instances: []
Name: Linen
Parents:
- Name: Home Decor
- Confidence: 64.7123794555664
Instances: []
Name: Sunlight
Parents: []
- Confidence: 56.264793395996094
Instances: []
Name: Flare
Parents:
- Name: Light
- Confidence: 50.47153854370117
Instances: []
Name: Tree
Parents:
- Name: Plant
version: '2016-06-27'
datetime_created: '2021-09-21T11:25:31.259763Z'
datetime_updated: '2021-09-21T11:27:33.359763Z'
aws_rekognition_detect_moderation_labels:
data:
ModerationModelVersion: '6.0'
ModerationLabels:
- Confidence: 93.41645812988281
Name: Weapons
ParentName: Violence
version: '2016-06-27'
datetime_created: '2023-02-21T11:25:31.259763Z'
datetime_updated: '2023-02-21T11:27:33.359763Z'
remove_bg:
data:
foreground_type: person
version: '1.0'
datetime_created: '2021-07-25T12:24:33.159663Z'
datetime_updated: '2021-07-25T12:24:33.159663Z'
uc_clamav_virus_scan:
data:
infected: true
infected_with: Win.Test.EICAR_HDB-1
version: 0.104.2
datetime_created: '2021-09-21T11:24:33.159663Z'
datetime_updated: '2021-09-21T11:24:33.159663Z'
file_video:
value:
datetime_removed: null
datetime_stored: '2021-09-21T11:24:33.159663Z'
datetime_uploaded: '2021-09-21T11:24:33.159663Z'
is_image: false
is_ready: true
mime_type: video/mp4
original_file_url: https://ucarecdn.com/7ed2aed0-0482-4c13-921b-0557b193edc2/16317390663260.mp4
original_filename: 16317390663260.mp4
size: 14479722
url: https://api.uploadcare.com/files/7ed2aed0-0482-4c13-921b-0557b193edc2/
uuid: 7ed2aed0-0482-4c13-921b-0557b193edc2
variations: null
content_info:
mime:
mime: video/mp4
type: video
subtype: mp4
video:
audio:
- codec: aac
bitrate: 129
channels: 2
sample_rate: 44100
video:
- codec: h264
width: 640
height: 480
bitrate: 433
frame_rate: 30
format: mp4
bitrate: 579
duration: 200044
metadata:
subsystem: tester
pet: dog
group_list:
value:
next: https://api.uploadcare.com/groups/?limit=3&from=2016-11-09T14%3A30%3A22.421889%2B00%3A00&offset=0
previous: null
total: 100
per_page: 2
results:
- id: dd43982b-5447-44b2-86f6-1c3b52afa0ff~1
datetime_created: '2018-11-27T14:14:37.583654Z'
files_count: 1
cdn_url: https://ucarecdn.com/dd43982b-5447-44b2-86f6-1c3b52afa0ff~1/
url: https://api.uploadcare.com/groups/dd43982b-5447-44b2-86f6-1c3b52afa0ff~1/
- id: fd59dbcb-40a1-4f3a-8062-cc7d23f66885~1
datetime_created: '2018-11-27T15:14:39.586674Z'
files_count: 1
cdn_url: https://ucarecdn.com/fd59dbcb-40a1-4f3a-8062-cc7d23f66885~1/
url: https://api.uploadcare.com/groups/fd59dbcb-40a1-4f3a-8062-cc7d23f66885~1/
parameters:
webhookSignature:
in: header
name: X-Uc-Signature
description: |
Optional header with an HMAC-SHA256 signature that is sent to the `target_url`,
if the webhook has a `signing_secret` associated with it.
schema:
type: string
example: v1=01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b
acceptHeader:
in: header
name: Accept
description: Version header.
schema:
type: string
nullable: true
example: application/vnd.uploadcare-v0.7+json
required: true
fileUUID:
in: path
name: uuid
description: File UUID.
required: true
schema:
type: string
format: uuid
example: 21975c81-7f57-4c7a-aef9-acfe28779f78
fileMetadataKey:
in: path
name: key
description: |
Key of file metadata.
List of allowed characters for the key:
- Latin letters in lower or upper case (a-z,A-Z)
- digits (0-9)
- underscore `_`
- a hyphen `-`
- dot `.`
- colon `:`
required: true
schema:
type: string
minLength: 1
maxLength: 64
pattern: '[\w\-\.\:]+'
example: subsystem