# Computer Images **Page:** api/computer-images [Download Raw Markdown](./api/computer-images.md) --- # Computer Images This page covers the `/api/v1/images/` endpoints for browsing public computer images, reviewing imported and purchased images, retrieving image icons, importing free images, purchasing paid images, and rating images. Use these operations when selecting a base image, managing an image library, or recording an image rating. ## Browse public images ### `GET /api/v1/images/public` Get a paginated list of public computer images with optional filtering and sorting. ### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `os` | query | `string` | No | Filter by operating system, for example `debian`. The platform currently carries `debian/13` only. | | `architecture` | query | `string` | No | Filter by CPU architecture, for example `amd64`, `arm64`, or `armhf`. | | `min_price` | query | `number` | No | Minimum price filter for paid images. A value of `0` includes free images. | | `max_price` | query | `number` | No | Maximum price filter for paid images. | | `min_rating` | query | `number` | No | Minimum average rating filter. Accepts a value from `0` to `5`. | | `max_rating` | query | `number` | No | Maximum average rating filter. Accepts a value from `0` to `5`. | | `search` | query | `string` | No | Search term matched as a substring against the image alias, image name, and description. | | `page` | query | `integer` | No | Page number for pagination. Starts from `1`. Default: `1`. | | `limit` | query | `integer` | No | Number of images to return per page. Maximum: `100`. Default: `20`. | | `sort_by` | query | `string` | No | Sort field. Allowed values: `alias`, `added_date`, `price`, `rating`. | | `sort_order` | query | `string` | No | Sort direction. Allowed values: `asc`, `desc`. | ### Request ```bash curl --request GET \ --url 'https://api.hoody.com/api/v1/images/public?os=debian&architecture=amd64&page=1&limit=20&sort_by=alias&sort_order=asc' \ --header 'Accept: application/json' ``` ```typescript import { HoodyClient } from 'hoody-sdk'; const client = new HoodyClient({ baseURL: 'https://api.hoody.com', token: process.env.HOODY_TOKEN }); for await (const item of client.api.images.listPublicIterator({ os: 'debian', architecture: 'amd64', page: 1, limit: 20, sort_by: 'alias', sort_order: 'asc' })) { console.log(item); } ``` The SDK helper is an async iterator and sends no request until iteration begins. The HTTP endpoint returns one page per request. ### Response Returns one page of public computer images and pagination details. Media type: application/json ```json { "statusCode": 200, "message": "Public computer images retrieved successfully", "data": { "images": [ { "id": "507f1f77bcf86cd799439021", "alias": "debian/13", "description": "Debian 13 (Trixie) - Default base image", "image_name": "debian/13", "architecture": "amd64", "os": "debian", "release": "13", "variant": "default", "size": 512000000, "price": 0, "added_date": "2025-01-10T08:00:00.000Z", "average_rating": 4.5, "rating_count": 142, "icon_url": "/api/v1/images/507f1f77bcf86cd799439021/icon" } ], "pagination": { "total": 87, "page": 1, "limit": 20, "totalPages": 5 } } } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `message` | `string` | No | - | | `data` | `object` | No | - | | `data.images` | `array` | No | - | | `data.images[].id` | `string` | Yes | - | | `data.images[].alias` | `string` | No | - | | `data.images[].description` | `string` | No | - | | `data.images[].image_name` | `string` | No | - | | `data.images[].architecture` | `string` | No | - | | `data.images[].os` | `string` | No | - | | `data.images[].release` | `string` | No | - | | `data.images[].variant` | `string or null` | No | - | | `data.images[].size` | `number` | No | - | | `data.images[].price` | `number` | No | - | | `data.images[].added_date` | `string` | No | - | | `data.images[].average_rating` | `number` | No | - | | `data.images[].rating_count` | `number` | No | - | | `data.images[].icon_url` | `string or null` | No | - | | `data.pagination` | `object` | No | - | | `data.pagination.total` | `number` | No | - | | `data.pagination.page` | `number` | No | - | | `data.pagination.limit` | `number` | No | - | | `data.pagination.totalPages` | `number` | No | - | The request included a `filter` query parameter whose value was not a JSON object. Media type: application/json ```json { "statusCode": 400, "error": "Bad Request", "message": "filter must be a JSON object", "data": { "field": "filter" } } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `error` | `string` | No | - | | `message` | `string` | No | - | | `data` | `object` | No | - | | `data.field` | `string` | No | - | The request did not match the operation schema. Media type: application/json ```json { "statusCode": 422, "error": "Validation Error", "message": "Validation failed: /limit must be <= 100", "data": [ { "instancePath": "/limit", "schemaPath": "#/properties/limit/maximum", "keyword": "maximum", "params": { "comparison": "<=", "limit": 100 }, "message": "must be <= 100" } ] } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | Yes | - | | `error` | `string` | Yes | - | | `message` | `string` | Yes | - | | `data` | any JSON value | No | - | The server could not retrieve the public computer images. Media type: application/json ```json { "statusCode": 500, "error": "Internal Server Error", "message": "Error getting public computer images" } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `error` | `string` | No | - | | `message` | `string` | No | - | ### `GET /api/v1/images/public/{id}` Get details for a specific public computer image. ### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | `string` | Yes | Unique identifier of the public computer image to retrieve details for. | ### Request ```bash curl --request GET \ --url 'https://api.hoody.com/api/v1/images/public/67e89abc123def456789abcd' \ --header 'Accept: application/json' ``` ```typescript import { HoodyClient } from 'hoody-sdk'; const client = new HoodyClient({ baseURL: 'https://api.hoody.com', token: process.env.HOODY_TOKEN }); const id = '67e89abc123def456789abcd'; const image = await client.api.images.getPublic(id); console.log(image); ``` ### Response Returns the public computer image details. Media type: application/json ```json { "statusCode": 200, "message": "Computer image details retrieved successfully", "data": { "id": "507f1f77bcf86cd799439021", "alias": "debian/13", "description": "Debian 13 (Trixie) - Default base image", "image_name": "debian/13", "architecture": "amd64", "os": "debian", "release": "13", "serial": "20250110", "variant": "default", "size": 512000000, "price": 0, "added_date": "2025-01-10T08:00:00.000Z", "average_rating": 4.5, "rating_count": 142, "icon_url": "/api/v1/images/507f1f77bcf86cd799439021/icon" } } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `message` | `string` | No | - | | `data` | `object` | No | - | | `data.id` | `string` | No | - | | `data.alias` | `string` | No | - | | `data.description` | `string` | No | - | | `data.image_name` | `string` | No | - | | `data.architecture` | `string` | No | - | | `data.os` | `string` | No | - | | `data.release` | `string` | No | - | | `data.serial` | `string` | No | - | | `data.variant` | `string or null` | No | - | | `data.size` | `number` | No | - | | `data.price` | `number` | No | - | | `data.added_date` | `string` | No | - | | `data.average_rating` | `number` | No | - | | `data.rating_count` | `number` | No | - | | `data.icon_url` | `string or null` | No | - | No public computer image has the requested identifier. Media type: application/json ```json { "statusCode": 404, "error": "Not Found", "message": "Computer image not found" } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `error` | `string` | No | - | | `message` | `string` | No | - | The request did not match the operation schema. Media type: application/json ```json { "statusCode": 422, "error": "Validation Error", "message": "Validation failed: /id must match pattern \"^[0-9a-f]{24}$\"", "data": [ { "instancePath": "/id", "schemaPath": "#/properties/id/pattern", "keyword": "pattern", "params": { "pattern": "^[0-9a-f]{24}$" }, "message": "must match pattern ^[0-9a-f]{24}$" } ] } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | Yes | - | | `error` | `string` | Yes | - | | `message` | `string` | Yes | - | | `data` | any JSON value | No | - | The server could not retrieve the computer image details. Media type: application/json ```json { "statusCode": 500, "error": "Internal Server Error", "message": "Error getting computer image details" } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `error` | `string` | No | - | | `message` | `string` | No | - | ## Retrieve image icons ### `GET /api/v1/images/{id}/icon` Get the icon for a computer image. If the image has no icon, is not public, or does not exist, the endpoint returns a generic placeholder PNG. ### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | `string` | Yes | Unique identifier of the computer image to retrieve the icon for. | ### Request ```bash curl --request GET \ --url 'https://api.hoody.com/api/v1/images/67e89abc123def456789abcd/icon' \ --header 'Accept: image/png' \ --output 'image-icon.png' ``` ```typescript import { HoodyClient } from 'hoody-sdk'; const client = new HoodyClient({ baseURL: 'https://api.hoody.com', token: process.env.HOODY_TOKEN }); const id = '67e89abc123def456789abcd'; const icon = await client.api.images.getIcon(id); console.log(icon); ``` ### Response Returns PNG image bytes. The response uses a generic placeholder PNG when the image has no icon, is not public, or does not exist. Media type: image/png The image's stored icon is not a valid PNG. Media type: application/json ```json { "statusCode": 400, "error": "Bad Request", "message": "Invalid icon format" } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `error` | `string` | No | - | | `message` | `string` | No | - | The identifier did not match `^[0-9a-f]{24}$`. Media type: application/json ```json { "statusCode": 422, "error": "Validation Error", "message": "Validation failed: /id must match pattern \"^[0-9a-f]{24}$\"" } ``` The server could not retrieve the computer image icon. Media type: application/json ```json { "statusCode": 500, "error": "Internal Server Error", "message": "Error getting computer image icon" } ``` ## Manage your image library ### `GET /api/v1/images/user` Get a paginated list of computer images in the authenticated user's imported or purchased library. ### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `page` | query | `integer` | No | Page number for pagination. Starts from `1`. Default: `1`. | | `limit` | query | `integer` | No | Number of images to return per page. Maximum: `100`. Default: `20`. | | `sort_by` | query | `string` | No | Sort user images by creation date. Allowed value: `created_at`. | | `sort_order` | query | `string` | No | Sort direction. Allowed values: `asc`, `desc`. | ### Request ```bash curl --request GET \ --url 'https://api.hoody.com/api/v1/images/user?page=1&limit=20&sort_by=created_at&sort_order=desc' \ --header "Authorization: Bearer $HOODY_TOKEN" \ --header 'Accept: application/json' ``` ```typescript import { HoodyClient } from 'hoody-sdk'; const client = new HoodyClient({ baseURL: 'https://api.hoody.com', token: process.env.HOODY_TOKEN }); for await (const item of client.api.images.listMineIterator({ page: 1, limit: 20, sort_by: 'created_at', sort_order: 'desc' })) { console.log(item); } ``` The SDK helper is an async iterator and sends no request until iteration begins. The HTTP endpoint returns one page per request. ### Response Returns one page of user computer images and pagination details. Media type: application/json ```json { "statusCode": 200, "message": "User images retrieved successfully", "data": { "images": [ { "id": "507f1f77bcf86cd799439021", "alias": "debian/13", "description": "Debian 13 (Trixie) - Default base image", "image_name": "debian/13", "architecture": "amd64", "os": "debian", "release": "13", "variant": "default", "size": 512000000, "price": 0, "user_rating": 5, "has_rated": true, "average_rating": 4.5, "rating_count": 142, "icon_url": "/api/v1/images/507f1f77bcf86cd799439021/icon" } ], "pagination": { "total": 12, "page": 1, "limit": 20, "totalPages": 1 } } } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `message` | `string` | No | - | | `data` | `object` | No | - | | `data.images` | `array` | No | - | | `data.images[].id` | `string` | Yes | - | | `data.images[].alias` | `string` | No | - | | `data.images[].description` | `string` | No | - | | `data.images[].image_name` | `string` | No | - | | `data.images[].architecture` | `string` | No | - | | `data.images[].os` | `string` | No | - | | `data.images[].release` | `string` | No | - | | `data.images[].variant` | `string or null` | No | - | | `data.images[].size` | `number` | No | - | | `data.images[].price` | `number` | No | - | | `data.images[].user_rating` | `number or null` | No | - | | `data.images[].has_rated` | `boolean` | No | - | | `data.images[].average_rating` | `number` | No | - | | `data.images[].rating_count` | `number` | No | - | | `data.images[].icon_url` | `string or null` | No | - | | `data.pagination` | `object` | No | - | | `data.pagination.total` | `number` | No | - | | `data.pagination.page` | `number` | No | - | | `data.pagination.limit` | `number` | No | - | | `data.pagination.totalPages` | `number` | No | - | The request included a `filter` query parameter whose value was not a JSON object. Media type: application/json ```json { "statusCode": 400, "error": "Bad Request", "message": "filter must be a JSON object", "data": { "field": "filter" } } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `error` | `string` | No | - | | `message` | `string` | No | - | | `data` | `object` | No | - | | `data.field` | `string` | No | - | The request could not be authenticated. Media type: application/json ```json { "statusCode": 401, "error": "MISSING_TOKEN", "message": "Authorization header is required" } ``` | Error Code | Title | Description | Resolution | |------------|-------|-------------|------------| | `MISSING_TOKEN` | Authentication token missing | The request carries no Authorization header, or the header holds no token | Send an Authorization header as `Bearer ` with a sign-in token or an auth token | | `INVALID_TOKEN` | Invalid authentication token | The provided authentication token is malformed or invalid | Obtain a new token by logging in again or using a valid auth token | | `TOKEN_EXPIRED` | Authentication token expired | The provided authentication token has expired | Obtain a new token by logging in again or refreshing your session | | `AUTH_TOKEN_LINEAGE_REVOKED` | Parent auth token no longer valid | The auth token was created by another auth token, and that token, or one above it, has been revoked, disabled, or has expired, so this one no longer authenticates | Create a new auth token from a valid one, or sign in again | | `INVALID_CREDENTIALS` | Invalid credentials | The provided username/email or password is incorrect | Verify your credentials and try again, or use the password reset feature | | `EMAIL_NOT_VERIFIED` | Email not verified | Returned by the login endpoint when the password is correct but the account's email address has not been verified yet. It is only returned after the password has been checked. The response carries `data.email` so the client can offer a resend verification email action without asking again. | Complete email verification by clicking the link sent to your inbox, call `/api/v1/auth/resend-verification` to receive a new link, or complete a password reset, which also implicitly verifies the email. | | `INVALID_OTP_CODE` | Invalid OTP code | The provided 2FA code is incorrect or has expired | Generate a new code from your authenticator app and try again | | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `error` | `string` | No | - | | `message` | `string` | No | - | The credentials do not permit this operation. Media type: application/json ```json { "statusCode": 403, "error": "INSUFFICIENT_PERMISSIONS", "message": "Insufficient permissions" } ``` | Error Code | Title | Description | Resolution | |------------|-------|-------------|------------| | `INSUFFICIENT_PERMISSIONS` | Insufficient permissions | You do not have the required permissions to perform this action | Ask the resource owner to grant you access | | `ACCOUNT_BANNED` | Account banned | Your account has been banned and cannot access this resource | Contact support for information about your account status | | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | Yes | - | | `error` | `string` | Yes | - | | `message` | `string` | Yes | - | The request did not match the operation schema. Media type: application/json ```json { "statusCode": 422, "error": "Validation Error", "message": "Validation failed: /limit must be <= 100", "data": [ { "instancePath": "/limit", "schemaPath": "#/properties/limit/maximum", "keyword": "maximum", "params": { "comparison": "<=", "limit": 100 }, "message": "must be <= 100" } ] } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | Yes | - | | `error` | `string` | Yes | - | | `message` | `string` | Yes | - | | `data` | any JSON value | No | - | The server could not retrieve the user computer images. Media type: application/json ```json { "statusCode": 500, "error": "Internal Server Error", "message": "Error getting user computer images" } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `error` | `string` | No | - | | `message` | `string` | No | - | ## Import and purchase images ### `POST /api/v1/images/import/{id}` Import a free public computer image into the authenticated user's library. ### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | `string` | Yes | Unique identifier of the public computer image to import. | ### Request ```bash curl --request POST \ --url 'https://api.hoody.com/api/v1/images/import/67e89abc123def456789abcd' \ --header "Authorization: Bearer $HOODY_TOKEN" \ --header 'Accept: application/json' ``` ```typescript import { HoodyClient } from 'hoody-sdk'; const client = new HoodyClient({ baseURL: 'https://api.hoody.com', token: process.env.HOODY_TOKEN }); const id = '67e89abc123def456789abcd'; const result = await client.api.images.import(id); console.log(result); ``` ### Response The free computer image was imported successfully. Media type: application/json ```json { "statusCode": 200, "message": "Free computer image imported successfully", "data": {} } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `message` | `string` | No | - | | `data` | `object` | No | - | The image is already in the user's library. Media type: application/json ```json { "statusCode": 400, "error": "Bad Request", "message": "You already have this image" } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `error` | `string` | No | - | | `message` | `string` | No | - | The request could not be authenticated. Media type: application/json ```json { "statusCode": 401, "error": "MISSING_TOKEN", "message": "Authorization header is required" } ``` | Error Code | Title | Description | Resolution | |------------|-------|-------------|------------| | `MISSING_TOKEN` | Authentication token missing | The request carries no Authorization header, or the header holds no token | Send an Authorization header as `Bearer ` with a sign-in token or an auth token | | `INVALID_TOKEN` | Invalid authentication token | The provided authentication token is malformed or invalid | Obtain a new token by logging in again or using a valid auth token | | `TOKEN_EXPIRED` | Authentication token expired | The provided authentication token has expired | Obtain a new token by logging in again or refreshing your session | | `AUTH_TOKEN_LINEAGE_REVOKED` | Parent auth token no longer valid | The auth token was created by another auth token, and that token, or one above it, has been revoked, disabled, or has expired, so this one no longer authenticates | Create a new auth token from a valid one, or sign in again | | `INVALID_CREDENTIALS` | Invalid credentials | The provided username/email or password is incorrect | Verify your credentials and try again, or use the password reset feature | | `EMAIL_NOT_VERIFIED` | Email not verified | Returned by the login endpoint when the password is correct but the account's email address has not been verified yet. It is only returned after the password has been checked. The response carries `data.email` so the client can offer a resend verification email action without asking again. | Complete email verification by clicking the link sent to your inbox, call `/api/v1/auth/resend-verification` to receive a new link, or complete a password reset, which also implicitly verifies the email. | | `INVALID_OTP_CODE` | Invalid OTP code | The provided 2FA code is incorrect or has expired | Generate a new code from your authenticator app and try again | The credentials do not permit this operation. Media type: application/json ```json { "statusCode": 403, "error": "INSUFFICIENT_PERMISSIONS", "message": "Insufficient permissions" } ``` | Error Code | Title | Description | Resolution | |------------|-------|-------------|------------| | `INSUFFICIENT_PERMISSIONS` | Insufficient permissions | You do not have the required permissions to perform this action | Ask the resource owner to grant you access | | `ACCOUNT_BANNED` | Account banned | Your account has been banned and cannot access this resource | Contact support for information about your account status | | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | Yes | - | | `error` | `string` | Yes | - | | `message` | `string` | Yes | - | No free public image has the requested identifier. The image may not exist, may not be public, or may have a price. Media type: application/json ```json { "statusCode": 404, "error": "Not Found", "message": "Free computer image not found" } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `error` | `string` | No | - | | `message` | `string` | No | - | The request did not match the operation schema. Media type: application/json ```json { "statusCode": 422, "error": "Validation Error", "message": "Validation failed: /id must match pattern \"^[0-9a-f]{24}$\"", "data": [ { "instancePath": "/id", "schemaPath": "#/properties/id/pattern", "keyword": "pattern", "params": { "pattern": "^[0-9a-f]{24}$" }, "message": "must match pattern ^[0-9a-f]{24}$" } ] } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | Yes | - | | `error` | `string` | Yes | - | | `message` | `string` | Yes | - | | `data` | any JSON value | No | - | The request limit for this operation has been reached. Media type: application/json ```json { "statusCode": 429, "error": "Too Many Requests", "message": "Rate limit exceeded for this endpoint. Please try again later." } ``` | Error Code | Title | Description | Resolution | |------------|-------|-------------|------------| | `RATE_LIMIT_EXCEEDED` | Rate limit exceeded | Too many requests of this kind in a short time, counted per account, auth token, or address. The request was not carried out. | Wait the number of seconds in the `Retry-After` header, then try again. When there is no `Retry-After` header, the limit could not be checked: try again in a few seconds. | | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | Yes | - | | `error` | `string` | Yes | - | | `message` | `string` | Yes | - | The `Retry-After` response header contains the number of seconds to wait before retrying. The server could not import the free computer image. Media type: application/json ```json { "statusCode": 500, "error": "Internal Server Error", "message": "Error importing free computer image" } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `error` | `string` | No | - | | `message` | `string` | No | - | ### `POST /api/v1/images/purchase/{id}` Purchase a paid computer image for the authenticated user's account. ### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | `string` | Yes | Unique identifier of the paid computer image to purchase. | ### Request ```bash curl --request POST \ --url 'https://api.hoody.com/api/v1/images/purchase/67e89abc123def456789abcd' \ --header "Authorization: Bearer $HOODY_TOKEN" \ --header 'Accept: application/json' ``` ```typescript import { HoodyClient } from 'hoody-sdk'; const client = new HoodyClient({ baseURL: 'https://api.hoody.com', token: process.env.HOODY_TOKEN }); const id = '67e89abc123def456789abcd'; const result = await client.api.images.buy(id); console.log(result); ``` ### Response The paid computer image was purchased successfully. Media type: application/json ```json { "statusCode": 200, "message": "Computer image purchased successfully", "data": { "price_paid": 5.99, "remaining_balance": 44.01 } } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `message` | `string` | No | - | | `data` | `object` | No | - | | `data.price_paid` | `number` | No | - | | `data.remaining_balance` | `number` | No | Wallet balance after the purchase. Omitted when the caller is an auth token without `financial.wallet.read` or one limited to realms. | The wallet balance is below the image price, or the image is already in the user's library. Media type: application/json ```json { "statusCode": 400, "error": "Bad Request", "message": "Insufficient balance" } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `error` | `string` | No | - | | `message` | `string` | No | - | The request could not be authenticated. Media type: application/json ```json { "statusCode": 401, "error": "MISSING_TOKEN", "message": "Authorization header is required" } ``` | Error Code | Title | Description | Resolution | |------------|-------|-------------|------------| | `MISSING_TOKEN` | Authentication token missing | The request carries no Authorization header, or the header holds no token | Send an Authorization header as `Bearer ` with a sign-in token or an auth token | | `INVALID_TOKEN` | Invalid authentication token | The provided authentication token is malformed or invalid | Obtain a new token by logging in again or using a valid auth token | | `TOKEN_EXPIRED` | Authentication token expired | The provided authentication token has expired | Obtain a new token by logging in again or refreshing your session | | `AUTH_TOKEN_LINEAGE_REVOKED` | Parent auth token no longer valid | The auth token was created by another auth token, and that token, or one above it, has been revoked, disabled, or has expired, so this one no longer authenticates | Create a new auth token from a valid one, or sign in again | | `INVALID_CREDENTIALS` | Invalid credentials | The provided username/email or password is incorrect | Verify your credentials and try again, or use the password reset feature | | `EMAIL_NOT_VERIFIED` | Email not verified | Returned by the login endpoint when the password is correct but the account's email address has not been verified yet. It is only returned after the password has been checked. The response carries `data.email` so the client can offer a resend verification email action without asking again. | Complete email verification by clicking the link sent to your inbox, call `/api/v1/auth/resend-verification` to receive a new link, or complete a password reset, which also implicitly verifies the email. | | `INVALID_OTP_CODE` | Invalid OTP code | The provided 2FA code is incorrect or has expired | Generate a new code from your authenticator app and try again | The credentials do not permit this operation. Media type: application/json ```json { "statusCode": 403, "error": "INSUFFICIENT_PERMISSIONS", "message": "Insufficient permissions" } ``` | Error Code | Title | Description | Resolution | |------------|-------|-------------|------------| | `INSUFFICIENT_PERMISSIONS` | Insufficient permissions | You do not have the required permissions to perform this action | Ask the resource owner to grant you access | | `ACCOUNT_BANNED` | Account banned | Your account has been banned and cannot access this resource | Contact support for information about your account status | | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | Yes | - | | `error` | `string` | Yes | - | | `message` | `string` | Yes | - | No paid computer image has the requested identifier. Media type: application/json ```json { "statusCode": 404, "error": "Not Found", "message": "Paid computer image not found" } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `error` | `string` | No | - | | `message` | `string` | No | - | The request did not match the operation schema. Media type: application/json ```json { "statusCode": 422, "error": "Validation Error", "message": "Validation failed: /id must match pattern \"^[0-9a-f]{24}$\"", "data": [ { "instancePath": "/id", "schemaPath": "#/properties/id/pattern", "keyword": "pattern", "params": { "pattern": "^[0-9a-f]{24}$" }, "message": "must match pattern ^[0-9a-f]{24}$" } ] } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | Yes | - | | `error` | `string` | Yes | - | | `message` | `string` | Yes | - | | `data` | any JSON value | No | - | The request limit for this operation has been reached. Media type: application/json ```json { "statusCode": 429, "error": "Too Many Requests", "message": "Rate limit exceeded for this endpoint. Please try again later." } ``` | Error Code | Title | Description | Resolution | |------------|-------|-------------|------------| | `RATE_LIMIT_EXCEEDED` | Rate limit exceeded | Too many requests of this kind in a short time, counted per account, auth token, or address. The request was not carried out. | Wait the number of seconds in the `Retry-After` header, then try again. When there is no `Retry-After` header, the limit could not be checked: try again in a few seconds. | | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | Yes | - | | `error` | `string` | Yes | - | | `message` | `string` | Yes | - | The `Retry-After` response header contains the number of seconds to wait before retrying. The server could not purchase the computer image. Media type: application/json ```json { "statusCode": 500, "error": "Internal Server Error", "message": "Error purchasing computer image" } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `error` | `string` | No | - | | `message` | `string` | No | - | ## Rate images ### `POST /api/v1/images/rate/{id}` Rate a computer image in the authenticated user's library from `0` to `5` stars. ### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | `string` | Yes | Unique identifier of the computer image to rate. | ### Request body | Field | Type | Required | Description | |---|---|---|---| | `rating` | `integer` | Yes | Rating for the image, a whole number of stars from `0` to `5`. | ```json { "rating": 5 } ``` ### Request ```bash curl --request POST \ --url 'https://api.hoody.com/api/v1/images/rate/67e89abc123def456789abcd' \ --header "Authorization: Bearer $HOODY_TOKEN" \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{"rating":5}' ``` ```typescript import { HoodyClient } from 'hoody-sdk'; const client = new HoodyClient({ baseURL: 'https://api.hoody.com', token: process.env.HOODY_TOKEN }); const id = '67e89abc123def456789abcd'; const data = { rating: 5 }; const result = await client.api.images.rate(id, data); console.log(result); ``` ### Response The computer image was rated successfully. Media type: application/json ```json { "statusCode": 200, "message": "Computer image rated successfully", "data": { "new_rating": 5, "average_rating": 4.6, "rating_count": 143 } } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `message` | `string` | No | - | | `data` | `object` | No | - | | `data.new_rating` | `number` | No | - | | `data.average_rating` | `number` | No | - | | `data.rating_count` | `number` | No | - | The request could not be authenticated. Media type: application/json ```json { "statusCode": 401, "error": "MISSING_TOKEN", "message": "Authorization header is required" } ``` | Error Code | Title | Description | Resolution | |------------|-------|-------------|------------| | `MISSING_TOKEN` | Authentication token missing | The request carries no Authorization header, or the header holds no token | Send an Authorization header as `Bearer ` with a sign-in token or an auth token | | `INVALID_TOKEN` | Invalid authentication token | The provided authentication token is malformed or invalid | Obtain a new token by logging in again or using a valid auth token | | `TOKEN_EXPIRED` | Authentication token expired | The provided authentication token has expired | Obtain a new token by logging in again or refreshing your session | | `AUTH_TOKEN_LINEAGE_REVOKED` | Parent auth token no longer valid | The auth token was created by another auth token, and that token, or one above it, has been revoked, disabled, or has expired, so this one no longer authenticates | Create a new auth token from a valid one, or sign in again | | `INVALID_CREDENTIALS` | Invalid credentials | The provided username/email or password is incorrect | Verify your credentials and try again, or use the password reset feature | | `EMAIL_NOT_VERIFIED` | Email not verified | Returned by the login endpoint when the password is correct but the account's email address has not been verified yet. It is only returned after the password has been checked. The response carries `data.email` so the client can offer a resend verification email action without asking again. | Complete email verification by clicking the link sent to your inbox, call `/api/v1/auth/resend-verification` to receive a new link, or complete a password reset, which also implicitly verifies the email. | | `INVALID_OTP_CODE` | Invalid OTP code | The provided 2FA code is incorrect or has expired | Generate a new code from your authenticator app and try again | | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `error` | `string` | No | - | | `message` | `string` | No | - | The credentials do not permit this operation. Media type: application/json ```json { "statusCode": 403, "error": "INSUFFICIENT_PERMISSIONS", "message": "Insufficient permissions" } ``` | Error Code | Title | Description | Resolution | |------------|-------|-------------|------------| | `INSUFFICIENT_PERMISSIONS` | Insufficient permissions | You do not have the required permissions to perform this action | Ask the resource owner to grant you access | | `ACCOUNT_BANNED` | Account banned | Your account has been banned and cannot access this resource | Contact support for information about your account status | | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | Yes | - | | `error` | `string` | Yes | - | | `message` | `string` | Yes | - | The image is not in the user's library, or it no longer exists. Media type: application/json ```json { "statusCode": 404, "error": "Not Found", "message": "You do not have access to this image" } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `error` | `string` | No | - | | `message` | `string` | No | - | The request did not match the operation schema. Media type: application/json ```json { "statusCode": 422, "error": "Validation Error", "message": "Validation failed: /rating must be <= 5", "data": [ { "instancePath": "/rating", "schemaPath": "#/properties/rating/maximum", "keyword": "maximum", "params": { "comparison": "<=", "maximum": 5 }, "message": "must be <= 5" } ] } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | Yes | - | | `error` | `string` | Yes | - | | `message` | `string` | Yes | - | | `data` | any JSON value | No | - | The request limit for this operation has been reached. Media type: application/json ```json { "statusCode": 429, "error": "Too Many Requests", "message": "Rate limit exceeded for this endpoint. Please try again later." } ``` | Error Code | Title | Description | Resolution | |------------|-------|-------------|------------| | `RATE_LIMIT_EXCEEDED` | Rate limit exceeded | Too many requests of this kind in a short time, counted per account, auth token, or address. The request was not carried out. | Wait the number of seconds in the `Retry-After` header, then try again. When there is no `Retry-After` header, the limit could not be checked: try again in a few seconds. | | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | Yes | - | | `error` | `string` | Yes | - | | `message` | `string` | Yes | - | The `Retry-After` response header contains the number of seconds to wait before retrying. The server could not rate the computer image. Media type: application/json ```json { "statusCode": 500, "error": "Internal Server Error", "message": "Error rating computer image" } ``` | Field | Type | Required | Description | |---|---|---|---| | `statusCode` | `number` | No | - | | `error` | `string` | No | - | | `message` | `string` | No | - |