ImageKit Account Management API API
The Account Management API API from ImageKit — 5 operation(s) for account management api.
The Account Management API API from ImageKit — 5 operation(s) for account management api.
openapi: 3.0.3
info:
title: ImageKit Account Management API API
version: 1.0.0
description: Checkout [API overview](/docs/api-overview) to learn about ImageKit's APIs, authentication, rate limits, and error codes etc.
contact:
email: developer@imagekit.io
name: ImageKit Team
url: https://imagekit.io
termsOfService: https://imagekit.io/terms/
servers:
- url: https://api.imagekit.io
security:
- basicAuth: []
tags:
- name: Account Management API
paths:
/v1/accounts/usage:
get:
tags:
- Account Management API
operationId: get-usage
summary: Get account usage information
description: 'Get the account usage information between two dates. Note that the API response includes data from the start date while excluding data from the end date. In other words, the data covers the period starting from the specified start date up to, but not including, the end date.
'
parameters:
- in: query
name: startDate
description: Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days.
schema:
type: string
format: date
required: true
- in: query
name: endDate
description: Specify a `endDate` in `YYYY-MM-DD` format. It should be after the `startDate`. The difference between `startDate` and `endDate` should be less than 90 days.
schema:
type: string
format: date
required: true
responses:
'200':
description: In the response, you will get different usage metrics.
content:
application/json:
schema:
type: object
properties:
bandwidthBytes:
type: integer
description: Amount of bandwidth used in bytes.
mediaLibraryStorageBytes:
type: integer
description: Storage used by media library in bytes.
videoProcessingUnitsCount:
type: integer
description: Number of video processing units used.
extensionUnitsCount:
type: integer
description: Number of extension units used.
originalCacheStorageBytes:
type: integer
description: Storage used by the original cache in bytes.
examples:
default:
value:
bandwidthBytes: 21991583578
mediaLibraryStorageBytes: 1878758298
videoProcessingUnitsCount: 0
extensionUnitsCount: 0
originalCacheStorageBytes: 0
'400':
description: Bad request.
content:
application/json:
schema:
type: object
properties:
message:
type: string
examples:
- startDate and endDate should be within 90 days.
- startDate and endDate are required in query parameters.
- startDate and endDate should be in format YYYY-MM-DD.
- startDate should be before endDate.
help:
type: string
example: For support kindly contact us at support@imagekit.io.
'429':
$ref: '#/components/responses/RateLimitExceeded'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
/v1/accounts/origins:
get:
summary: List origins
tags:
- Account Management API
operationId: list-origins
description: "**Note:** This API is currently in beta. \nReturns an array of all configured origins for the current account.\n"
responses:
'200':
description: Successful response.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/OriginResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/RateLimitExceeded'
post:
summary: Create origin
tags:
- Account Management API
operationId: create-origin
description: "**Note:** This API is currently in beta. \nCreates a new origin and returns the origin object.\n"
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/OriginRequest'
responses:
'201':
description: Origin created successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/OriginResponse'
'400':
description: Bad request. The request body is invalid.
content:
application/json:
schema:
type: object
properties:
message:
type: string
examples:
- Invalid origin type. Must be one of S3, S3_COMPATIBLE, CLOUDINARY_BACKUP, WEB_FOLDER, WEB_PROXY, GCS, AZURE_BLOB, AKENEO_PIM.
- name is required and must be a string
- bucket is required and must be a string
help:
type: string
example: For support kindly contact us at support@imagekit.io.
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/RateLimitExceeded'
/v1/accounts/origins/{id}:
get:
summary: Get origin
tags:
- Account Management API
operationId: get-origin
description: "**Note:** This API is currently in beta. \nRetrieves the origin identified by `id`.\n"
parameters:
- in: path
name: id
schema:
description: Unique identifier for the origin. This is generated by ImageKit when you create a new origin.
type: string
required: true
description: Unique identifier for the origin. This is generated by ImageKit when you create a new origin.
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/OriginResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
description: Resource not found
content:
application/json:
schema:
type: object
properties:
message:
type: string
examples:
- Origin not found.
help:
type: string
example: For support kindly contact us at support@imagekit.io.
'429':
$ref: '#/components/responses/RateLimitExceeded'
put:
summary: Update origin
tags:
- Account Management API
operationId: update-origin
description: "**Note:** This API is currently in beta. \nUpdates the origin identified by `id` and returns the updated origin object.\n"
parameters:
- in: path
name: id
schema:
description: Unique identifier for the origin. This is generated by ImageKit when you create a new origin.
type: string
required: true
description: Unique identifier for the origin. This is generated by ImageKit when you create a new origin.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/OriginRequest'
responses:
'200':
description: Origin updated successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/OriginResponse'
'400':
description: Bad request. The request body is invalid.
content:
application/json:
schema:
type: object
properties:
message:
type: string
examples:
- Invalid origin type. Must be one of S3, S3_COMPATIBLE, CLOUDINARY_BACKUP, WEB_FOLDER, WEB_PROXY, GCS, AZURE_BLOB, AKENEO_PIM.
- name is required and must be a string
- bucket is required and must be a string
help:
type: string
example: For support kindly contact us at support@imagekit.io.
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
description: Resource not found
content:
application/json:
schema:
type: object
properties:
message:
type: string
examples:
- Origin not found.
help:
type: string
example: For support kindly contact us at support@imagekit.io.
'429':
$ref: '#/components/responses/RateLimitExceeded'
delete:
summary: Delete origin
tags:
- Account Management API
operationId: delete-origin
description: "**Note:** This API is currently in beta. \nPermanently removes the origin identified by `id`. If the origin is in use by any URL‑endpoints, the API will return an error.\n"
parameters:
- in: path
name: id
schema:
description: Unique identifier for the origin. This is generated by ImageKit when you create a new origin.
type: string
required: true
description: Unique identifier for the origin. This is generated by ImageKit when you create a new origin.
responses:
'204':
description: Origin deleted successfully.
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
description: Resource not found
content:
application/json:
schema:
type: object
properties:
message:
type: string
examples:
- Origin not found.
help:
type: string
example: For support kindly contact us at support@imagekit.io.
'429':
$ref: '#/components/responses/RateLimitExceeded'
/v1/accounts/url-endpoints:
get:
summary: List URL‑endpoints
tags:
- Account Management API
operationId: list-url-endpoints
description: "**Note:** This API is currently in beta. \nReturns an array of all URL‑endpoints configured including the default URL-endpoint generated by ImageKit during account creation.\n"
responses:
'200':
description: Successful response.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/UrlEndpointResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
description: Resource not found
content:
application/json:
schema:
type: object
properties:
message:
type: string
examples:
- URL-endpoint not found.
help:
type: string
example: For support kindly contact us at support@imagekit.io.
'429':
$ref: '#/components/responses/RateLimitExceeded'
post:
summary: Create URL‑endpoint
tags:
- Account Management API
operationId: create-url-endpoint
description: "**Note:** This API is currently in beta. \nCreates a new URL‑endpoint and returns the resulting object.\n"
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UrlEndpointRequest'
responses:
'201':
description: URL‑endpoint created successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/UrlEndpointResponse'
'400':
description: Bad request. The request body is invalid.
content:
application/json:
schema:
type: object
properties:
message:
type: string
examples:
- description is required
- urlPrefix must be a string
- urlPrefix cannot be empty string. This is reserved for the default URL-endpoint created by ImageKit.
- Origin does not exists. Please create origin before using it in URL-endpoint.
help:
type: string
example: For support kindly contact us at support@imagekit.io.
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'429':
$ref: '#/components/responses/RateLimitExceeded'
/v1/accounts/url-endpoints/{id}:
get:
summary: Get URL‑endpoint
tags:
- Account Management API
operationId: get-url-endpoint
description: "**Note:** This API is currently in beta. \nRetrieves the URL‑endpoint identified by `id`.\n"
parameters:
- in: path
name: id
schema:
description: Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`.
type: string
required: true
description: Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`.
responses:
'200':
description: Successful response.
content:
application/json:
schema:
$ref: '#/components/schemas/UrlEndpointResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
description: Resource not found
content:
application/json:
schema:
type: object
properties:
message:
type: string
examples:
- URL-endpoint not found.
help:
type: string
example: For support kindly contact us at support@imagekit.io.
'429':
$ref: '#/components/responses/RateLimitExceeded'
put:
summary: Update URL‑endpoint
tags:
- Account Management API
operationId: update-url-endpoint
description: "**Note:** This API is currently in beta. \nUpdates the URL‑endpoint identified by `id` and returns the updated object.\n"
parameters:
- in: path
name: id
schema:
description: Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`.
type: string
required: true
description: Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UrlEndpointRequest'
responses:
'200':
description: URL‑endpoint updated successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/UrlEndpointResponse'
'400':
description: Bad request. The request body is invalid.
content:
application/json:
schema:
type: object
properties:
message:
type: string
examples:
- description is required
- urlPrefix must be a string
- urlPrefix cannot be empty string. This is reserved for the default URL-endpoint created by ImageKit.
- Origin does not exists. Please create origin before using it in URL-endpoint.
help:
type: string
example: For support kindly contact us at support@imagekit.io.
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
description: Resource not found
content:
application/json:
schema:
type: object
properties:
message:
type: string
examples:
- URL-endpoint not found.
help:
type: string
example: For support kindly contact us at support@imagekit.io.
'429':
$ref: '#/components/responses/RateLimitExceeded'
delete:
summary: Delete URL‑endpoint
tags:
- Account Management API
operationId: delete-url-endpoint
description: "**Note:** This API is currently in beta. \nDeletes the URL‑endpoint identified by `id`. You cannot delete the default URL‑endpoint created by ImageKit during account creation.\n"
parameters:
- in: path
name: id
schema:
description: Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`.
type: string
required: true
description: Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`.
responses:
'204':
description: URL‑endpoint deleted successfully.
'400':
description: Bad request. The request body is invalid.
content:
application/json:
schema:
type: object
properties:
message:
type: string
examples:
- Default URL-endpoint cannot be deleted.
help:
type: string
example: For support kindly contact us at support@imagekit.io.
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
'404':
description: Resource not found
content:
application/json:
schema:
type: object
properties:
message:
type: string
examples:
- URL-endpoint not found.
help:
type: string
example: For support kindly contact us at support@imagekit.io.
'429':
$ref: '#/components/responses/RateLimitExceeded'
components:
responses:
Forbidden:
description: Forbidden.
content:
application/json:
schema:
type: object
properties:
message:
type: string
examples:
- Your account cannot be authenticated.
- Your request contains expired private API key.
- Your account is disabled.
help:
type: string
example: For support kindly contact us at support@imagekit.io.
Unauthorized:
description: Unauthorized request.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: Your request does not contain private API key.
help:
type: string
example: For support kindly contact us at support@imagekit.io.
RateLimitExceeded:
description: The request exceeded the rate limit. Contains headers indicating the limits and a message detailing the error.
headers:
X-RateLimit-Limit:
schema:
type: integer
description: The maximum number of requests that can be made to this endpoint in the interval specified by `X-RateLimit-Interval` response header.
X-RateLimit-Reset:
schema:
type: integer
description: The amount of time in milliseconds before you can make another request to this endpoint. Pause/sleep your workflow for this duration.
X-RateLimit-Interval:
schema:
type: integer
description: The duration of the interval in milliseconds for which this rate limit was exceeded.
content:
application/json:
schema:
type: object
properties:
message:
type: string
description: A description of the error, providing details about why the rate limit has been exceeded.
schemas:
OriginRequest:
title: Origin request
description: Schema for origin request resources.
example:
name: My S3 Origin
type: S3
bucket: test-bucket
prefix: images
accessKey: AKIATEST123
secretKey: secrettest123
discriminator:
propertyName: type
oneOf:
- title: S3
type: object
properties:
name:
description: Display name of the origin.
example: US S3 Storage
type: string
minLength: 1
maxLength: 100
pattern: ^[a-zA-Z0-9 ]+$
type:
type: string
enum:
- S3
includeCanonicalHeader:
description: Whether to send a Canonical header.
example: false
default: false
type: boolean
baseUrlForCanonicalHeader:
description: URL used in the Canonical header (if enabled).
example: https://cdn.example.com
type: string
format: uri
bucket:
description: S3 bucket name.
example: product-images
type: string
minLength: 1
maxLength: 100
prefix:
description: Path prefix inside the bucket.
example: raw-assets
default: ''
type: string
maxLength: 100
accessKey:
description: Access key for the bucket.
example: AKIAIOSFODNN7EXAMPLE
type: string
minLength: 1
maxLength: 100
secretKey:
description: Secret key for the bucket.
example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
type: string
minLength: 1
maxLength: 100
required:
- name
- type
- bucket
- accessKey
- secretKey
additionalProperties: false
- title: S3 Compatible
type: object
properties:
name:
description: Display name of the origin.
example: US S3 Storage
type: string
minLength: 1
maxLength: 100
pattern: ^[a-zA-Z0-9 ]+$
type:
type: string
enum:
- S3_COMPATIBLE
includeCanonicalHeader:
description: Whether to send a Canonical header.
example: false
default: false
type: boolean
baseUrlForCanonicalHeader:
description: URL used in the Canonical header (if enabled).
example: https://cdn.example.com
type: string
format: uri
bucket:
description: S3 bucket name.
example: product-images
type: string
minLength: 1
maxLength: 100
prefix:
description: Path prefix inside the bucket.
example: raw-assets
default: ''
type: string
maxLength: 100
accessKey:
description: Access key for the bucket.
example: AKIAIOSFODNN7EXAMPLE
type: string
minLength: 1
maxLength: 100
secretKey:
description: Secret key for the bucket.
example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
type: string
minLength: 1
maxLength: 100
endpoint:
description: Custom S3-compatible endpoint.
example: https://s3.eu-central-1.wasabisys.com
type: string
format: uri
s3ForcePathStyle:
default: false
description: Use path-style S3 URLs?
example: true
type: boolean
required:
- name
- type
- bucket
- accessKey
- secretKey
- endpoint
additionalProperties: false
- title: Cloudinary Backup
type: object
properties:
name:
description: Display name of the origin.
example: US S3 Storage
type: string
minLength: 1
maxLength: 100
pattern: ^[a-zA-Z0-9 ]+$
type:
type: string
enum:
- CLOUDINARY_BACKUP
includeCanonicalHeader:
description: Whether to send a Canonical header.
example: false
default: false
type: boolean
baseUrlForCanonicalHeader:
description: URL used in the Canonical header (if enabled).
example: https://cdn.example.com
type: string
format: uri
bucket:
description: S3 bucket name.
example: product-images
type: string
minLength: 1
maxLength: 100
prefix:
description: Path prefix inside the bucket.
example: raw-assets
default: ''
type: string
maxLength: 100
accessKey:
description: Access key for the bucket.
example: AKIAIOSFODNN7EXAMPLE
type: string
minLength: 1
maxLength: 100
secretKey:
description: Secret key for the bucket.
example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
type: string
minLength: 1
maxLength: 100
required:
- name
- type
- bucket
- accessKey
- secretKey
additionalProperties: false
- title: Web Folder
type: object
properties:
name:
description: Display name of the origin.
example: US S3 Storage
type: string
minLength: 1
maxLength: 100
pattern: ^[a-zA-Z0-9 ]+$
type:
type: string
enum:
- WEB_FOLDER
includeCanonicalHeader:
description: Whether to send a Canonical header.
example: false
default: false
type: boolean
baseUrlForCanonicalHeader:
description: URL used in the Canonical header (if enabled).
example: https://cdn.example.com
type: string
format: uri
baseUrl:
description: Root URL for the web folder origin.
example: https://images.example.com/assets
type: string
format: uri
forwardHostHeaderToOrigin:
description: Forward the Host header to origin?
example: false
default: false
type: boolean
required:
- name
- type
- baseUrl
additionalProperties: false
- title: Web Proxy
type: object
properties:
name:
description: Display name of the origin.
example: US S3 Storage
type: string
minLength: 1
maxLength: 100
pattern: ^[a-zA-Z0-9 ]+$
type:
type: string
enum:
- WEB_PROXY
includeCanonicalHeader:
description: Whether to send a Canonical header.
example: false
default: false
type: boolean
baseUrlForCanonicalHeader:
description: URL used in the Canonical header (if enabled).
example: https://cdn.example.com
type: string
format: uri
required:
- name
- type
additionalProperties: false
- title: Google Cloud Storage (GCS)
type: object
properties:
name:
description: Display name of the origin.
example: US S3 Storage
type: string
minLength: 1
maxLength: 100
pattern: ^[a-zA-Z0-9 ]+$
type:
type: string
enum:
- GCS
includeCanonicalHeader:
description: Whether to send a Canonical header.
example: false
default: false
type: boolean
baseUrlForCanonicalHeader:
description: URL used in the Canonical header (if enabled).
example: https://cdn.example.com
type: string
format: uri
bucket:
example: gcs-media
type: string
minLength: 1
maxLength: 100
prefix:
example: products
default: ''
type: string
maxLength: 100
clientEmail:
example: service-account@project.iam.gserviceaccount.com
type: string
format: email
pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
privateKey:
example: '-----BEGIN PRIVATE KEY-----\nMIIEv...'
type: string
minLength: 1
required:
- name
- type
- bucket
- clientEmail
- privateKey
additionalProperties: false
- title: Azure Blob Storage
type: object
properties:
name:
description: Display name of the origin.
example: US S3 Storage
type: string
minLength: 1
maxLength: 100
pattern: ^[a-zA-Z0-9 ]+$
type:
type: string
enum:
- AZURE_BLOB
includeCanonicalHeader:
description: Whether to send a Canonical header.
example: false
default: false
type: boolean
baseUrlForCanonicalHeader:
description: URL used in the Canonical header (if enabled).
example: https://cdn.example.com
type: string
format: uri
container:
example: images
type: string
minLength: 1
maxLength: 100
prefix:
example: uploads
default: ''
type: string
maxLength: 100
accountName:
# --- truncated at 32 KB (51 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/apis-json-v1-9-imagekit/refs/heads/main/openapi/imagekit-account-management-api-api-openapi.yml