Claim a server from a pool
Claim the oldest warm server of the pool. The server is already running on the addresses it booted with, and the pool's default keys work at once. Keys in ssh_keys and a root_password the claim adds reach the server a few seconds later. The server has already booted, so a claim accepts no user_data, reserved IPs, server type or disk.
The ID of the server pool to claim.
Bearer $TOKEN
application/json
The server's name, unique among the organization's live servers.
The slugs of SSH keys of the pool's team to add to the pool's default keys.
Whether to set a root password. The response shows the password once.
Tags for the server, added to the pool's default tags. Accepts any keys.
The ID of one firewall of the pool's team to attach. Refused when the pool's defaults already attach a firewall.
The IDs of private networks of the pool's team to join. Each one gets a private IP and is attached shortly after the response, as when you create a server.
Whether the server gets its generic subdomain.
{
"root_password": "example"
}
{
"error": {
"message": "Malformed JSON body.",
"code": "bad_request"
}
}
{
"error": {
"message": "Missing or invalid token.",
"code": "unauthorized"
}
}
{
"error": {
"message": "We require at least one successful credit card transaction before allowing billable actions via the API. This significantly helps us to prevent fraud. Once your first transaction is processed, you will be able to use the API unrestricted. Please add credit to your account at https://betterstack.com/settings/billing/card/new?credits=10&activate_api=true. Need help? We're here for you at hello@betterstack.com.",
"code": "payment_required"
}
}
{
"error": {
"message": "This token is read-only and cannot be used for write operations.",
"code": "read_only_token"
}
}
{
"error": {
"message": "The request could not be completed right now. Please try again in a few moments.",
"code": "internal_error"
}
}
Returns the server.
The body isn't valid JSON.
The API token is missing or invalid.
The organization hasn't made its first payment yet, and the request creates a resource we charge for. The code is payment_required. A request that creates a server, load balancer, object cache, database, reserved IP or volume can also return first_purchase. The url in first_purchase opens a page where you make the payment. The resource is created after the payment. The page works until expires_at, 24 hours after the response.
The request would go over a quota, with the code quota_exceeded. Or a read-only token tried to make a change, with the code read_only_token. Or a rule of the resource forbids it.
We couldn't find the pool, an SSH key, a firewall or a network. The error code is not_found.
The pool is disabled. The error code is pool_disabled.
The name is missing or taken, the request names more than one firewall, or the pool's defaults already attach a firewall. The error code is validation_failed.
We've locked the resource, with the code locked. Every change to a locked resource is refused, and so is a change that involves one.
Too many requests, with the code rate_limited. We limit requests per client IP and per organization, and some costly endpoints have a stricter limit. Wait as long as the Retry-After header says.
An unexpected, temporary error on our side, with the code internal_error. Try again.
The pool has no warm server now. The error code is pool_empty. The pool grows its target, so try again shortly, or create a server.
The root password, shown only this once, when the request sets root_password to true.