Scopes, URLs, and request format
How REST API URLs are built from a project ID, which headers requests and responses carry, and how bodies, timestamps, and amounts are formatted.
This reference describes how REST API URLs are built, which headers requests and responses carry, and how request and response bodies are formatted. For the operations themselves, see the API reference.
URL structure
A request URL has these parts:
https://<api-host>/api/v1/scopes/<project-id>/<service>/<collection>/<resource-id>/actions/<action>| Part | Meaning |
|---|---|
https://<api-host>/api/v1 | The base URL: /api/v1 on the API host. |
/scopes/<project-id> | The project that holds the resource. The API calls this ID the scope ID, scopeId. |
<service> | The service, such as compute, storage, or network. See Services. |
<collection> | A resource type in the service, such as instances or volumes. |
<resource-id> | One resource of the collection. Leave it out to address the whole collection. |
/actions/<action> | An action on the resource, such as start or stop. Actions are always POST requests. |
Some examples:
| Request | Meaning |
|---|---|
GET /scopes/<project-id>/compute/instances | List the project's instances. |
GET /scopes/<project-id>/compute/instances/<instance-id> | Read one instance. |
POST /scopes/<project-id>/compute/instances/<instance-id>/actions/stop | Stop an instance. |
DELETE /scopes/<project-id>/storage/volumes/<volume-id> | Delete a volume. |
Encode each path segment that you insert, such as an ID or a name, for use in a URL.
Find a project's ID
The scope ID in a path is the ID of a project. You can find it in two places:
- The console's address. Every page of a project has an address of the form
/t/<tenant-id>/s/<subscription-id>/project/<project-id>/…, after the language code. The part after/project/is the project ID. - The API.
GET /account/whoamireturns the tenants, subscriptions, and projects that you can access, with their IDs.
{
"tenants": [
{
"id": "acme",
"name": "Acme Corp",
"subscriptions": [
{
"id": "acme-production",
"tenantId": "acme",
"name": "Production",
"currency": "TRY",
"defaultRegion": "ist-1",
"projects": [
{
"id": "acme-production-web-platform",
"subscriptionId": "acme-production",
"name": "web-platform",
"region": "ist-1"
}
]
}
]
}
]
}Subscription and project IDs don't change when you rename them. Read them from GET /account/whoami instead of deriving them from names.
When you call whoami with an API token or a service account key, it lists only the tenant that the credential belongs to.
Services
| Service segment | Collections | Product |
|---|---|---|
compute | instances, flavors, key-pairs | Virtual Machines |
compute | images | Images |
compute, storage | snapshots | Snapshots |
storage | volumes, volume-transfers | Block Storage |
storage | buckets, temp-url-key | Object Storage |
storage | backup-plans | Backup Center |
network | networks, routers, network-interfaces | Virtual Networks |
network | security-groups | Security Groups |
network | load-balancers | Load Balancers |
network | vpn | Site-to-Site VPN |
network | floating-ips | Floating IPs |
iam | users, roles, service-accounts, api-tokens, and more | Identity & Access Management |
iam | openstack-credentials, openstack-api-access | OpenStack API Access |
observability | alert-rules, notification-channels | Monitoring & Alerts |
billing | summary, cost-reports, budgets, commitments, invoices | Cost Management |
activity | activity-events | Activity Log |
A size is called a flavor in the API: flavors lists the sizes. A few paths aren't under a project:
| Path | Purpose |
|---|---|
/account/whoami | Your identity and the tenants, subscriptions, and projects that you can access. |
/operations/<operation-id> | Read an asynchronous operation. See Synchronous and asynchronous requests. |
/operations/<operation-id>/actions/cancel | Cancel an operation that hasn't finished. |
/regions/<region>/volume-types | The volume types of a region. |
A path that matches no service returns 404 Not Found.
Methods
| Method | Use |
|---|---|
GET | Read a resource or list a collection. |
POST | Create a resource, or run an action at /actions/<action>. |
PATCH | Change some fields of a resource. |
PUT | Replace a setting as a whole, such as a resource's tags at /tags. |
DELETE | Delete a resource. |
Request headers
| Header | Send it with | Value |
|---|---|---|
Authorization | Every request | Bearer followed by an API token or a service account key. See Authenticate with API tokens. |
Content-Type | Requests that have a body | application/json |
Idempotency-Key | Every POST, PUT, PATCH, and DELETE request. With an API token or a service account key, it's required on POST requests that create a resource. | A new UUID for each new request. See Idempotent requests. |
If-Match | Updates and deletes that check the version | The ETag value from your last read. See Concurrency control. |
X-Request-Id | Optional | Your own ID for the request. The API returns it in the response. |
Response headers
| Header | Returned with | Value |
|---|---|---|
X-Request-Id | Every response | The request's ID: yours, or one that the API generated. |
ETag | Reads and updates of many resources | A version tag of the resource, such as W/"3a7bd3e2360a3d29eea436fcfb7e44c735d117c4". |
Retry-After | 429 Too Many Requests | The number of seconds to wait before you retry. |
X-RateLimit-Limit | Requests with an API token or a service account key | The number of requests that the current window allows. |
X-RateLimit-Remaining | Requests with an API token or a service account key | The number of requests left in the current window. |
X-RateLimit-Reset | Requests with an API token or a service account key | The number of seconds until the window resets. |
Body format
- JSON. Request and response bodies are JSON. Field names are in camel case, such as
deletionProtectionorsubscriptionId. - Fields without a value. In a response, an optional field that has no value is left out rather than set to
null. A field that the schema always includes is present, and isnullwhen it has no value. - Timestamps. ISO 8601 strings in UTC, such as
2026-10-08T09:30:00Z. - IDs. Opaque strings. Use them exactly as the API returns them.
- Lists. A list operation returns
{ "data": [...], "meta": {...} }. See Pagination. - Errors. An error response has its own body. See Errors.
Amounts
Amounts of money are integers in ten-thousandths of the currency unit. A field whose name ends in Minor carries such an integer, and a money object carries one in amount, with the currency in currency:
{ "amount": 125000, "currency": "TRY" }This amount is 12.5 units of its currency: divide by 10,000 to get the amount in the currency unit. Don't read these integers as cents.
Example
curl "https://<api-host>/api/v1/scopes/<project-id>/compute/instances?page=1&pageSize=50" \
-H "Authorization: Bearer $PC_TOKEN"<api-host>: the host name of the API.<project-id>: the ID of the project.PC_TOKEN: an environment variable that holds your API token.