### API Overview and Example Request Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Provides general information about the Linode API v4, including its use of standard HTTP methods, JSON responses, and an example request for fetching regions. ```APIDOC ## GET /v4/regions ### Description Retrieves a list of available regions for Linode services. ### Method GET ### Endpoint https://api.linode.com/v4/regions ### Parameters #### Query Parameters - **page** (integer) - Optional - The page number to retrieve. - **limit** (integer) - Optional - The number of results per page. ### Request Example ```bash curl -X GET https://api.linode.com/v4/regions \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" ``` ### Response #### Success Response (200) - **data** (array) - A list of region objects. - **id** (string) - The unique identifier for the region. - **label** (string) - The human-readable name of the region. - **country** (string) - The country code where the region is located. - **capabilities** (array of strings) - Services supported in this region. - **status** (string) - The operational status of the region. - **page** (integer) - The current page number. - **pages** (integer) - The total number of pages. - **results** (integer) - The total number of results. #### Response Example ```json { "data": [ { "id": "us-east", "label": "Newark, NJ", "country": "us", "capabilities": ["Linodes", "Block Storage", "Kubernetes"], "status": "ok" } ], "page": 1, "pages": 1, "results": 1 } ``` ``` -------------------------------- ### Manage Linode Instances API Requests Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Provides examples for common Linode instance management operations: listing all instances, rebooting a specific instance, and deleting an instance. Requires an API token. ```bash # List all Linode instances curl -X GET https://api.linode.com/v4/linode/instances \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ```bash # Reboot a Linode curl -X POST https://api.linode.com/v4/linode/instances/123456/reboot \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ```bash # Delete a Linode curl -X DELETE https://api.linode.com/v4/linode/instances/123456 \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` -------------------------------- ### Get Linode Regions API Request Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Demonstrates how to list available regions for Linode services using a GET request. Requires an API token for authentication. Returns a JSON object with region data. ```bash curl -X GET https://api.linode.com/v4/regions \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" ``` -------------------------------- ### Get Account Information using Linode API Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Retrieves detailed information about your Linode account, including contact details, balance, and account creation date. Requires an API token. ```bash curl -X GET https://api.linode.com/v4/account \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` -------------------------------- ### Error Handling Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Describes the error handling mechanism in Linode API v4, including common status codes and example error response. ```APIDOC ## Error Handling ### Description Describes error handling with HTTP status codes and JSON error details. ### Status Codes - 200 - Success - 400 - Bad Request (validation errors) - 401 - Unauthorized (invalid or missing token) - 403 - Forbidden (insufficient permissions) - 404 - Not Found (resource doesn't exist) - 429 - Too Many Requests (rate limit exceeded) - 500 - Internal Server Error ### Response Example ```json { "errors": [ { "field": "region", "reason": "Region is required" } ] } ``` ``` -------------------------------- ### GET /profile/tokens Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Retrieves a list of all API tokens associated with the authenticated user. Requires a valid API token for authorization. ```APIDOC ## GET /profile/tokens ### Description Lists all API tokens. ### Method GET ### Endpoint /v4/profile/tokens ### Parameters None ### Request Example ``` N/A ``` ### Response #### Success Response (200) - **data** (array) - Array of token objects #### Response Example ```json { "data": [ { "id": 123, "label": "automation-script-token", "scopes": "linodes:read_write volumes:read_write lke:read_write", "created": "2025-10-09T19:00:00", "expiry": "2026-12-31T23:59:59" } ] } ``` ``` -------------------------------- ### Get Events (Activity Log) using Linode API Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Retrieves a list of recent events and activities on your Linode account. Requires an API token. This is useful for auditing and monitoring actions performed on your resources. ```bash curl -X GET https://api.linode.com/v4/account/events \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` -------------------------------- ### Get Current Month's Usage using Linode API Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Retrieves your current month's network transfer usage and quota. Requires an API token. This helps monitor data consumption against your plan limits. ```bash curl -X GET https://api.linode.com/v4/account/transfer \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` -------------------------------- ### Create Linode Instance API Request Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Shows how to create a new Linode virtual machine instance. Specifies instance type, region, image, root password, label, tags, backups, and private IP. Requires an API token. ```bash curl -X POST https://api.linode.com/v4/linode/instances \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "type": "g6-standard-2", "region": "us-east", "image": "linode/ubuntu22.04", "root_pass": "your_secure_password_here", "label": "my-production-server", "tags": ["production", "web-server"], "backups_enabled": true, "private_ip": true }' ``` -------------------------------- ### Linode Compute Instances API Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Manages Linode virtual machine instances, including creation, listing, rebooting, and deletion. ```APIDOC ## POST /v4/linode/instances ### Description Creates a new Linode compute instance. ### Method POST ### Endpoint https://api.linode.com/v4/linode/instances ### Parameters #### Request Body - **type** (string) - Required - The instance type (e.g., 'g6-standard-2'). - **region** (string) - Required - The region where the instance will be created (e.g., 'us-east'). - **image** (string) - Required - The distribution image to use (e.g., 'linode/ubuntu22.04'). - **root_pass** (string) - Required - The root password for the instance. - **label** (string) - Optional - A user-defined label for the instance. - **tags** (array of strings) - Optional - Tags to apply to the instance. - **backups_enabled** (boolean) - Optional - Whether backups are enabled. - **private_ip** (boolean) - Optional - Whether to enable private IP networking. ### Request Example ```json { "type": "g6-standard-2", "region": "us-east", "image": "linode/ubuntu22.04", "root_pass": "your_secure_password_here", "label": "my-production-server", "tags": ["production", "web-server"], "backups_enabled": true, "private_ip": true } ``` ### Response #### Success Response (200) - **id** (integer) - The unique ID of the created Linode. - **label** (string) - The label of the Linode. - **status** (string) - The current status of the Linode (e.g., 'provisioning'). - **ipv4** (array of strings) - The public IPv4 addresses assigned. - **ipv6** (string) - The public IPv6 address assigned. - **type** (string) - The instance type. - **region** (string) - The region of the instance. - **specs** (object) - Specifications of the instance. - **disk** (integer) - Disk size in MB. - **memory** (integer) - Memory in MB. - **vcpus** (integer) - Number of virtual CPUs. - **transfer** (integer) - Transfer quota in GB. #### Response Example ```json { "id": 123456, "label": "my-production-server", "status": "provisioning", "ipv4": ["192.0.2.1"], "ipv6": "2600:3c01::f03c:91ff:fe24:3a2f/64", "type": "g6-standard-2", "region": "us-east", "specs": { "disk": 81920, "memory": 4096, "vcpus": 2, "transfer": 4000 } } ``` ## GET /v4/linode/instances ### Description Retrieves a list of all Linode instances associated with the account. ### Method GET ### Endpoint https://api.linode.com/v4/linode/instances ### Parameters #### Query Parameters - **page** (integer) - Optional - The page number to retrieve. - **limit** (integer) - Optional - The number of results per page. ### Response #### Success Response (200) - **data** (array) - A list of Linode instance objects. - **page** (integer) - The current page number. - **pages** (integer) - The total number of pages. - **results** (integer) - The total number of results. ### Request Example ```bash curl -X GET https://api.linode.com/v4/linode/instances \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ## POST /v4/linode/instances/{LinodeID}/reboot ### Description Reboots a specific Linode instance. ### Method POST ### Endpoint https://api.linode.com/v4/linode/instances/{LinodeID}/reboot ### Parameters #### Path Parameters - **LinodeID** (integer) - Required - The ID of the Linode to reboot. ### Request Example ```bash curl -X POST https://api.linode.com/v4/linode/instances/123456/reboot \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ## DELETE /v4/linode/instances/{LinodeID} ### Description Deletes a specific Linode instance. ### Method DELETE ### Endpoint https://api.linode.com/v4/linode/instances/{LinodeID} ### Parameters #### Path Parameters - **LinodeID** (integer) - Required - The ID of the Linode to delete. ### Request Example ```bash curl -X DELETE https://api.linode.com/v4/linode/instances/123456 \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ``` -------------------------------- ### Create NodeBalancer Configuration using Linode API Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Creates a configuration for a NodeBalancer, defining backend nodes and port settings. Requires the NodeBalancer ID, port, protocol, algorithm, and a list of nodes. This allows traffic to be directed to specific backend servers. ```bash curl -X POST https://api.linode.com/v4/nodebalancers/234567/configs \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "port": 80, "protocol": "http", "algorithm": "roundrobin", "stickiness": "table", "check": "http", "check_interval": 5, "check_timeout": 3, "check_attempts": 2, "check_path": "/health", "nodes": [ { "label": "web-1", "address": "192.0.2.10:80", "weight": 100, "mode": "accept" }, { "label": "web-2", "address": "192.0.2.11:80", "weight": 100, "mode": "accept" } ] }' ``` -------------------------------- ### Create Block Storage Volume API Request Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Demonstrates the creation of a new block storage volume. Specifies volume label, size in GB, region, and tags. Requires an API token. ```bash curl -X POST https://api.linode.com/v4/volumes \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "label": "database-volume", "size": 100, "region": "us-east", "tags": ["database", "production"] }' ``` -------------------------------- ### Create Kubernetes Cluster API Request Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Demonstrates how to create a new Linode Kubernetes Engine (LKE) cluster. Defines cluster label, region, Kubernetes version, and node pool configuration with autoscaling. Requires an API token. ```bash curl -X POST https://api.linode.com/v4/lke/clusters \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "label": "production-k8s-cluster", "region": "us-east", "k8s_version": "1.28", "node_pools": [ { "type": "g6-standard-4", "count": 3, "autoscaler": { "enabled": true, "min": 3, "max": 10 } } ], "tags": ["production", "kubernetes"] }' ``` -------------------------------- ### Manage LKE Cluster Access and Scaling API Requests Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Shows how to retrieve kubeconfig for accessing an LKE cluster and how to scale a node pool. Requires an API token and cluster/pool IDs. ```bash # Get kubeconfig for cluster access curl -X GET https://api.linode.com/v4/lke/clusters/456789/kubeconfig \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ```bash # Scale node pool curl -X PUT https://api.linode.com/v4/lke/clusters/456789/pools/789012 \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "count": 5, "autoscaler": { "enabled": true, "min": 3, "max": 15 } }' ``` -------------------------------- ### Create New User using Linode API Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Creates a new user on your Linode account. Requires a username, email address, and an API token. The `restricted` flag determines if the user has limited access by default. ```bash curl -X POST https://api.linode.com/v4/account/users \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "username": "developer1", "email": "developer1@example.com", "restricted": true }' ``` -------------------------------- ### Create NodeBalancer using Linode API Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Creates a new NodeBalancer to distribute traffic. Requires a label, region, and an API token. Optional tags can be provided for organization. ```bash curl -X POST https://api.linode.com/v4/nodebalancers \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "label": "web-load-balancer", "region": "us-east", "tags": ["production", "web"] }' ``` -------------------------------- ### Linode Kubernetes Engine (LKE) API Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Manages Linode Kubernetes Engine clusters, including creation, retrieving kubeconfig, and scaling node pools. ```APIDOC ## POST /v4/lke/clusters ### Description Creates a new Linode Kubernetes Engine (LKE) cluster. ### Method POST ### Endpoint https://api.linode.com/v4/lke/clusters ### Parameters #### Request Body - **label** (string) - Required - A user-defined label for the cluster. - **region** (string) - Required - The region where the cluster will be deployed. - **k8s_version** (string) - Required - The Kubernetes version for the cluster. - **node_pools** (array of objects) - Required - Configuration for the node pools. - **type** (string) - Required - The instance type for the nodes. - **count** (integer) - Required - The number of nodes in the pool. - **autoscaler** (object) - Optional - Node pool autoscaler configuration. - **enabled** (boolean) - Required - Whether autoscaling is enabled. - **min** (integer) - Required - The minimum number of nodes. - **max** (integer) - Required - The maximum number of nodes. - **tags** (array of strings) - Optional - Tags to apply to the cluster. ### Request Example ```json { "label": "production-k8s-cluster", "region": "us-east", "k8s_version": "1.28", "node_pools": [ { "type": "g6-standard-4", "count": 3, "autoscaler": { "enabled": true, "min": 3, "max": 10 } } ], "tags": ["production", "kubernetes"] } ``` ### Response #### Success Response (200) - **id** (integer) - The unique ID of the cluster. - **label** (string) - The label of the cluster. - **region** (string) - The region of the cluster. - **k8s_version** (string) - The Kubernetes version. - **status** (string) - The current status of the cluster (e.g., 'provisioning'). - **created** (string) - The date and time the cluster was created. - **updated** (string) - The date and time the cluster was last updated. #### Response Example ```json { "id": 456789, "label": "production-k8s-cluster", "region": "us-east", "k8s_version": "1.28", "status": "provisioning", "created": "2025-10-09T19:00:00", "updated": "2025-10-09T19:00:00" } ``` ## GET /v4/lke/clusters/{ClusterID}/kubeconfig ### Description Retrieves the kubeconfig file for accessing a specific LKE cluster. ### Method GET ### Endpoint https://api.linode.com/v4/lke/clusters/{ClusterID}/kubeconfig ### Parameters #### Path Parameters - **ClusterID** (integer) - Required - The ID of the LKE cluster. ### Request Example ```bash curl -X GET https://api.linode.com/v4/lke/clusters/456789/kubeconfig \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` ## PUT /v4/lke/clusters/{ClusterID}/pools/{PoolID} ### Description Updates a node pool within an LKE cluster, including scaling and autoscaler settings. ### Method PUT ### Endpoint https://api.linode.com/v4/lke/clusters/{ClusterID}/pools/{PoolID} ### Parameters #### Path Parameters - **ClusterID** (integer) - Required - The ID of the LKE cluster. - **PoolID** (integer) - Required - The ID of the node pool to update. #### Request Body - **count** (integer) - Required - The desired number of nodes in the pool. - **autoscaler** (object) - Optional - Node pool autoscaler configuration. - **enabled** (boolean) - Required - Whether autoscaling is enabled. - **min** (integer) - Required - The minimum number of nodes. - **max** (integer) - Required - The maximum number of nodes. ### Request Example ```json { "count": 5, "autoscaler": { "enabled": true, "min": 3, "max": 15 } } ``` ``` -------------------------------- ### Linode API v4 Overview Source: https://techdocs.akamai.com/linode-api/index The Linode API v4 allows developers and system administrators to automate tasks, manage cloud infrastructure, and interact with Akamai's cloud computing services. ```APIDOC ## Linode API v4 ### Description The Linode API v4 enables programmatic management of Akamai cloud computing products and services. This includes creating and managing Linodes, deploying Linode Kubernetes Engine clusters, attaching Block Storage volumes, configuring NodeBalancers, managing users, and viewing account details. ### Key Capabilities * **Automation**: Build scripts and applications for repeatable tasks. * **Resource Management**: Create, configure, and manage Linodes, LKE clusters, Block Storage, and NodeBalancers. * **User Management**: Manage user accounts and permissions. * **Account Monitoring**: View details on your account status and usage. ### Access API operations are described with request syntax and examples using standard HTTP requests. Response data is returned in JSON format. Download the [Linode OpenAPI specification](link_to_openapi_spec). ### Changelog Refer to the [API Changelog](link_to_changelog) for release notes on all changes made to the API. ``` -------------------------------- ### List Linode API Tokens Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Retrieves a list of all existing API tokens associated with the account. Requires a valid API token for authentication. ```bash curl -X GET https://api.linode.com/v4/profile/tokens \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` -------------------------------- ### POST /profile/tokens Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Creates a new API token. Requires existing authentication and specifies the token's label, scopes, and expiry. ```APIDOC ## POST /profile/tokens ### Description Creates a new API token with specified label, scopes, and expiry. ### Method POST ### Endpoint /v4/profile/tokens ### Parameters #### Request Body - **label** (string) - Required - A label for the token - **scopes** (string) - Required - Comma-separated list of scopes (e.g., `linodes:read_write volumes:read_write`) - **expiry** (string) - Optional - Expiry date in `YYYY-MM-DDTHH:MM:SS` format. ### Request Example ```json { "label": "automation-script-token", "scopes": "linodes:read_write volumes:read_write lke:read_write", "expiry": "2026-12-31T23:59:59" } ``` ### Response #### Success Response (200) - **id** (integer) - The ID of the token - **label** (string) - The label of the token - **scopes** (string) - The scopes of the token - **created** (string) - Creation timestamp - **expiry** (string) - Expiry timestamp - **token** (string) - The generated API token #### Response Example ```json { "id": 123, "label": "automation-script-token", "scopes": "linodes:read_write volumes:read_write lke:read_write", "created": "2025-10-09T19:00:00", "expiry": "2026-12-31T23:59:59", "token": "abcdef123456789..." } ``` ``` -------------------------------- ### Attach Volume to Linode using Linode API Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Attaches a specified volume to a Linode instance. Requires the volume ID, Linode ID, and an API token. The `persist_across_boots` parameter determines if the volume should remain attached after reboots. ```bash curl -X POST https://api.linode.com/v4/volumes/789123/attach \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "linode_id": 123456, "persist_across_boots": true }' ``` -------------------------------- ### Pagination Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Describes how to handle large result sets using pagination parameters. ```APIDOC ## Pagination ### Description Describes how to handle large result sets with pagination. ### Parameters #### Query Parameters - **page** (integer) - Optional - The page number to retrieve. - **page_size** (integer) - Optional - The number of results per page. ### Request Example ``` N/A ``` ### Response Example ```json { "data": [...], "page": 2, "pages": 5, "results": 234 } ``` ``` -------------------------------- ### List Users on Account using Linode API Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Retrieves a list of all users associated with your Linode account. Requires an API token. This endpoint returns basic information about each user. ```bash curl -X GET https://api.linode.com/v4/account/users \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` -------------------------------- ### Set User Permissions using Linode API Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Sets specific permissions for a user on your Linode account. Requires the username, a JSON payload defining global and per-Linode permissions, and an API token. Permissions can include adding resources or read/write access. ```bash curl -X PUT https://api.linode.com/v4/account/users/developer1/grants \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "global": { "add_linodes": true, "add_volumes": true, "account_access": "read_only" }, "linode": [ { "id": 123456, "permissions": "read_write" } ] }' ``` -------------------------------- ### Create Linode API Token Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Creates a new API token with specified scopes and expiry. Requires an existing authentication token. The response includes the new token's details, including the generated token value. ```bash curl -X POST https://api.linode.com/v4/profile/tokens \ -H "Authorization: Bearer YOUR_EXISTING_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "label": "automation-script-token", "scopes": "linodes:read_write volumes:read_write lke:read_write", "expiry": "2026-12-31T23:59:59" }' ``` -------------------------------- ### Account Information API Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Endpoints for retrieving account details, usage, and billing information. ```APIDOC ## GET /v4/account ### Description Retrieves general account information. ### Method GET ### Endpoint /v4/account ### Parameters (No parameters) ### Response #### Success Response (200) - **email** (string) - The account's primary email address. - **first_name** (string) - The account owner's first name. - **last_name** (string) - The account owner's last name. - **company** (string) - The company name associated with the account. - **address_1** (string) - The first line of the billing address. - **city** (string) - The city of the billing address. - **state** (string) - The state/province of the billing address. - **zip** (string) - The zip/postal code of the billing address. - **country** (string) - The country of the billing address. - **balance** (number) - The current account balance. - **balance_uninvoiced** (number) - Uninvoiced balance. - **active_since** (string) - The date the account became active. ### Response Example ```json { "email": "admin@example.com", "first_name": "John", "last_name": "Doe", "company": "Example Corp", "address_1": "123 Main St", "city": "Philadelphia", "state": "PA", "zip": "19102", "country": "US", "balance": 0, "balance_uninvoiced": 0, "active_since": "2020-01-15T00:00:00" } ``` ## GET /v4/account/transfer ### Description Retrieves current month's network transfer usage. ### Method GET ### Endpoint /v4/account/transfer ### Parameters (No parameters) ### Response #### Success Response (200) - **used** (integer) - Data used in GB. - **quota** (integer) - Data quota in GB. - **billable** (integer) - Billable data usage in GB. ### Response Example ```json { "used": 1024, "quota": 20000, "billable": 0 } ``` ## GET /v4/account/invoices ### Description Lists all invoices for the account. ### Method GET ### Endpoint /v4/account/invoices ### Parameters (No parameters) ### Response #### Success Response (200) (Response body not detailed in example) ## GET /v4/account/events ### Description Retrieves a list of recent account events (activity log). ### Method GET ### Endpoint /v4/account/events ### Parameters (No parameters) ### Response #### Success Response (200) - **data** (array) - A list of event objects. - **id** (integer) - The ID of the event. - **action** (string) - The type of action performed. - **created** (string) - The timestamp when the event occurred. - **entity** (object) - The entity related to the event. - **id** (integer) - The ID of the entity. - **label** (string) - The label of the entity. - **type** (string) - The type of the entity. - **status** (string) - The status of the event. - **username** (string) - The username of the user who performed the action. ### Response Example ```json { "data": [ { "id": 12345, "action": "linode_create", "created": "2025-10-09T19:00:00", "entity": { "id": 123456, "label": "my-production-server", "type": "linode" }, "status": "finished", "username": "admin" } ] } ``` ``` -------------------------------- ### User Management API Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Endpoints for managing users and their permissions within your Linode account. ```APIDOC ## GET /v4/account/users ### Description Lists all users on the account. ### Method GET ### Endpoint /v4/account/users ### Parameters (No parameters) ### Response #### Success Response (200) (Response body not detailed in example) ## POST /v4/account/users ### Description Creates a new user on the account. ### Method POST ### Endpoint /v4/account/users ### Parameters #### Request Body - **username** (string) - Required - The username for the new user. - **email** (string) - Required - The email address for the new user. - **restricted** (boolean) - Optional - Whether the user is restricted (default is false). ### Request Example ```json { "username": "developer1", "email": "developer1@example.com", "restricted": true } ``` ### Response #### Success Response (200) - **username** (string) - The username of the created user. - **email** (string) - The email address of the created user. - **restricted** (boolean) - Whether the user is restricted. - **ssh_keys** (array) - A list of SSH keys associated with the user. ### Response Example ```json { "username": "developer1", "email": "developer1@example.com", "restricted": true, "ssh_keys": [] } ``` ## PUT /v4/account/users/:username/grants ### Description Sets or updates the permissions for a specific user. ### Method PUT ### Endpoint /v4/account/users/:username/grants ### Parameters #### Path Parameters - **username** (string) - Required - The username of the user to update grants for. #### Request Body - **global** (object) - Global permissions for the user. - **add_linodes** (boolean) - Whether the user can add Linodes. - **add_volumes** (boolean) - Whether the user can add volumes. - **account_access** (string) - Account access level ('read_only', 'mutate', 'none'). - **linode** (array of objects) - Specific Linode permissions. - **id** (integer) - Required - The ID of the Linode. - **permissions** (string) - Required - Permissions for this Linode ('read_only', 'read_write', 'none'). ### Request Example ```json { "global": { "add_linodes": true, "add_volumes": true, "account_access": "read_only" }, "linode": [ { "id": 123456, "permissions": "read_write" } ] } ``` ### Response #### Success Response (200) (No specific response body shown in example) ## DELETE /v4/account/users/:username ### Description Revokes a user's access to the account. ### Method DELETE ### Endpoint /v4/account/users/:username ### Parameters #### Path Parameters - **username** (string) - Required - The username of the user to revoke access for. ### Request Example (No request body) ### Response #### Success Response (200) (No specific response body shown in example) ``` -------------------------------- ### Paginated API Request Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Fetches a list of resources with specific pagination parameters. This is useful for handling large datasets by retrieving them in smaller, manageable chunks. The response includes metadata about the current page, total pages, and results. ```bash curl -X GET "https://api.linode.com/v4/linode/instances?page=2&page_size=50" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` -------------------------------- ### Resize Volume using Linode API Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Resizes a specified volume to a new size. Requires the volume ID, the desired new size in GB, and an API token. This operation is irreversible and may incur costs. ```bash curl -X POST https://api.linode.com/v4/volumes/789123/resize \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "size": 200 }' ``` -------------------------------- ### NodeBalancer Operations Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Endpoints for creating and configuring NodeBalancers (Load Balancers). ```APIDOC ## POST /v4/nodebalancers ### Description Creates a new NodeBalancer. ### Method POST ### Endpoint /v4/nodebalancers ### Parameters #### Request Body - **label** (string) - Required - A label for the NodeBalancer. - **region** (string) - Required - The region for the NodeBalancer. - **tags** (array of strings) - Optional - Tags to apply to the NodeBalancer. ### Request Example ```json { "label": "web-load-balancer", "region": "us-east", "tags": ["production", "web"] } ``` ### Response #### Success Response (200) - **id** (integer) - The ID of the NodeBalancer. - **label** (string) - The label of the NodeBalancer. - **region** (string) - The region of the NodeBalancer. - **hostname** (string) - The hostname of the NodeBalancer. - **ipv4** (string) - The IPv4 address of the NodeBalancer. - **ipv6** (string) - The IPv6 address of the NodeBalancer. - **created** (string) - The creation timestamp. ### Response Example ```json { "id": 234567, "label": "web-load-balancer", "region": "us-east", "hostname": "nb-192-0-2-1.newark.nodebalancer.linode.com", "ipv4": "192.0.2.1", "ipv6": "2600:3c01::192:0:2:1", "created": "2025-10-09T19:00:00" } ``` ## POST /v4/nodebalancers/:id/configs ### Description Creates a configuration for a NodeBalancer, including backend nodes or SSL/TLS settings. ### Method POST ### Endpoint /v4/nodebalancers/:id/configs ### Parameters #### Path Parameters - **id** (integer) - Required - The ID of the NodeBalancer to configure. #### Request Body (Backend Nodes) - **port** (integer) - Required - The port to listen on. - **protocol** (string) - Required - The protocol to use (e.g., 'http', 'https'). - **algorithm** (string) - Optional - The balancing algorithm (e.g., 'roundrobin', 'leastconn'). - **stickiness** (string) - Optional - The stickiness setting (e.g., 'table', 'http_cookie'). - **check** (string) - Optional - The health check protocol (e.g., 'http', 'tcp'). - **check_interval** (integer) - Optional - The health check interval in seconds. - **check_timeout** (integer) - Optional - The health check timeout in seconds. - **check_attempts** (integer) - Optional - The number of health check attempts. - **check_path** (string) - Optional - The path for HTTP health checks. - **nodes** (array of objects) - Optional - A list of backend nodes. - **label** (string) - Required - Label for the node. - **address** (string) - Required - Address of the node (e.g., '192.0.2.10:80'). - **weight** (integer) - Optional - Weight for the node. - **mode** (string) - Optional - Mode for the node ('accept' or 'reject'). #### Request Body (SSL/TLS Configuration) - **port** (integer) - Required - The port to listen on (typically 443 for HTTPS). - **protocol** (string) - Required - The protocol to use ('https'). - **ssl_cert** (string) - Required - The SSL certificate content. - **ssl_key** (string) - Required - The SSL private key content. ### Request Example (Backend Nodes) ```json { "port": 80, "protocol": "http", "algorithm": "roundrobin", "stickiness": "table", "check": "http", "check_interval": 5, "check_timeout": 3, "check_attempts": 2, "check_path": "/health", "nodes": [ { "label": "web-1", "address": "192.0.2.10:80", "weight": 100, "mode": "accept" }, { "label": "web-2", "address": "192.0.2.11:80", "weight": 100, "mode": "accept" } ] } ``` ### Request Example (SSL/TLS Configuration) ```json { "port": 443, "protocol": "https", "ssl_cert": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----", "ssl_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----" } ``` ### Response #### Success Response (200) (No specific response body shown in example) ``` -------------------------------- ### List Invoices using Linode API Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Retrieves a list of all invoices associated with your Linode account. Requires an API token. This endpoint provides access to billing history. ```bash curl -X GET https://api.linode.com/v4/account/invoices \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` -------------------------------- ### Block Storage Volumes API Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Manages persistent block storage volumes, including creation and association with Linode instances. ```APIDOC ## POST /v4/volumes ### Description Creates a new block storage volume. ### Method POST ### Endpoint https://api.linode.com/v4/volumes ### Parameters #### Request Body - **label** (string) - Required - A user-defined label for the volume. - **size** (integer) - Required - The size of the volume in GB. - **region** (string) - Required - The region where the volume will be created. - **tags** (array of strings) - Optional - Tags to apply to the volume. ### Request Example ```json { "label": "database-volume", "size": 100, "region": "us-east", "tags": ["database", "production"] } ``` ### Response #### Success Response (200) - **id** (integer) - The unique ID of the volume. - **label** (string) - The label of the volume. - **size** (integer) - The size of the volume in GB. - **region** (string) - The region of the volume. - **status** (string) - The current status of the volume (e.g., 'active'). - **filesystem_path** (string) - The path to the volume's filesystem on a Linode. - **created** (string) - The date and time the volume was created. #### Response Example ```json { "id": 789123, "label": "database-volume", "size": 100, "region": "us-east", "status": "active", "filesystem_path": "/dev/disk/by-id/scsi-0Linode_Volume_database-volume", "created": "2025-10-09T19:00:00" } ``` ``` -------------------------------- ### Handle API Errors in Bash Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Demonstrates how to make a request using curl, capture the HTTP status code, and process the response body. This script checks for errors (status codes >= 400) and prints the error details or the successful response. ```bash if ! response=$(curl -s -w "\n%{http_code}" -X GET \ https://api.linode.com/v4/linode/instances \ -H "Authorization: Bearer $TOKEN"); then echo "Request failed" exit 1 fi http_code=$(echo "$response" | tail -n1) body=$(echo "$response" | sed '$d') if [ "$http_code" -ge 400 ]; then echo "API error: $body" exit 1 fi echo "$body" | jq '.' ``` -------------------------------- ### Filtering Source: https://context7.com/context7/techdocs_akamai_linode-api/llms.txt Describes how to filter API responses using the X-Filter header. ```APIDOC ## Filtering ### Description Describes how to filter API responses using the X-Filter header. ### Parameters #### Request Headers - **X-Filter** (string) - Optional - JSON object specifying filter criteria. ### Request Example ``` N/A ``` ### Response Example ```json { "data": [...] } ``` ```