Azure API Management REST API Reference
This section provides detailed documentation for the Azure API Management REST API. You can use this API to programmatically manage your API Management services, including creating and configuring APIs, products, users, subscriptions, and more.
API Overview
The API Management REST API allows for comprehensive management of your API Management instance. It supports operations for creating, reading, updating, and deleting various resources within your service.
API Operations
Below are common operations available through the API Management REST API.
Retrieves a list of all APIs in the API Management service.
Query Parameters
| Name | Type | Description |
|---|---|---|
| $filter | string | Optional. Filter the results using the OData filter syntax. For example, to get APIs with a display name containing "Sample", use $filter=contains(displayName, 'Sample'). |
| $top | integer | Optional. Number of records to return. |
| $skip | integer | Optional. Number of records to skip. |
Responses
| Status Code | Description |
|---|---|
| 200 OK | Successfully retrieved the list of APIs. |
| 400 Bad Request | The request is malformed or invalid. |
| 401 Unauthorized | The caller is not authorized to perform the operation. |
Example
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis?api-version=2021-08-01&api-key={masterKey}
Creates a new API or imports an existing API into the API Management service.
Request Body
{
"properties": {
"displayName": "My New API",
"description": "This is my new API",
"path": "mynewapi",
"isCurrent": true,
"protocols": ["https"]
}
}
Responses
| Status Code | Description |
|---|---|
| 201 Created | API created successfully. |
| 400 Bad Request | The request body is invalid. |
Example
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis?api-version=2021-08-01&api-key={masterKey}
Retrieves a specific API using its unique identifier.
Path Parameters
| Name | Type | Description |
|---|---|---|
| apiId | string | The unique identifier of the API. |
Responses
| Status Code | Description |
|---|---|
| 200 OK | Successfully retrieved the API details. |
Authentication
Authentication to the API Management REST API is typically done using subscription keys or Azure Active Directory (AAD) tokens. The master subscription key is recommended for administrative tasks.
Authorization: SharedAccessSignature uid=xxxx;rt=xxxx;ist=xxxx;sig=xxxx
Error Handling
API requests that result in an error will return a standard HTTP status code and a JSON response body containing error details.
{
"error": {
"code": "InvalidResourceName",
"message": "The resource name 'invalid-name' is invalid.",
"details": []
}
}